Skip to content

Commit

Permalink
Remove the eslint-plugin-mozilla dependency
Browse files Browse the repository at this point in the history
We only used two rules from the plugin which can both easily be replaced
nowadays:

- `mozilla/avoid-removeChild` is equal to the already active
  `unicorn/prefer-dom-node-remove` rule; please see [1] and [2].
- `mozilla/import-globals` is mostly obsolete nowadays ever since we
  removed the Firefox extension code from this repository and we
  eliminated most globals usage. The three remaining occurrences can be
  replaced with explicit `/* globals */` comments that we already use
  elsewhere, which overall is also more consistent.

[1] https://firefox-source-docs.mozilla.org/code-quality/lint/linters/eslint-plugin-mozilla/rules/avoid-removeChild.html
[2] https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-remove.md
  • Loading branch information
timvandermeij committed Aug 8, 2024
1 parent cd3d188 commit be93d53
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 439 deletions.
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"plugins": [
"import",
"json",
"mozilla",
"no-unsanitized",
"sort-exports",
"unicorn",
Expand Down Expand Up @@ -44,7 +43,6 @@
"import/no-unresolved": ["error", {
"ignore": ["display", "pdfjs", "pdfjs-lib", "pdfjs-web", "web", "fluent-bundle", "fluent-dom"],
}],
"mozilla/avoid-removeChild": "error",
"no-unsanitized/method": "error",
"no-unsanitized/property": "error",
"sort-exports/sort-exports": ["error", {
Expand Down
5 changes: 0 additions & 5 deletions extensions/chromium/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
"webextensions": true
},

"plugins": [
"mozilla"
],

"parserOptions": {
"sourceType": "script"
},

"rules": {
"mozilla/import-globals": "error",
"no-var": "off",
},
}
2 changes: 1 addition & 1 deletion extensions/chromium/pdfHandler-vcros.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
/* eslint strict: ["error", "function"] */
/* import-globals-from pdfHandler.js */
/* globals getViewerURL */

(function () {
"use strict";
Expand Down
2 changes: 1 addition & 1 deletion extensions/chromium/pdfHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* import-globals-from preserve-referer.js */
/* globals saveReferer */

"use strict";

Expand Down
2 changes: 1 addition & 1 deletion extensions/chromium/preserve-referer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* import-globals-from pdfHandler.js */
/* globals getHeaderFromHeaders */
/* exported saveReferer */

"use strict";
Expand Down
Loading

0 comments on commit be93d53

Please sign in to comment.