diff --git a/.eslintrc.js b/.eslintrc.js index 92691d9..c3cf58a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,11 +2,27 @@ "use strict"; -/* All Mozilla specific rules and enviroments at: - * http://firefox-source-docs.mozilla.org/tools/lint/linters/eslint-plugin-mozilla.html - */ +// All Mozilla specific rules and environments at: +// http://firefox-source-docs.mozilla.org/tools/lint/linters/eslint-plugin-mozilla.html module.exports = { + env: { + es6: true, + }, + extends: [ + "eslint:recommended", + // list of rules at: https://dxr.mozilla.org/mozilla-central/source/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js + "plugin:mozilla/recommended", + ], + overrides: [ + { + files: "src/**", + env: { + browser: true, + webextensions: true, + }, + }, + ], parserOptions: { ecmaVersion: 8, sourceType: "module", @@ -15,31 +31,25 @@ module.exports = { experimentalObjectRestSpread: true, }, }, - env: { - es6: true, - }, - extends: [ - "eslint:recommended", - /* list of rules at: - * https://dxr.mozilla.org/mozilla-central/source/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js - */ - "plugin:mozilla/recommended", + plugins: [ + "json", + "mozilla", ], - - plugins: ["json", "mozilla"], - + root: true, rules: { "babel/new-cap": "off", - "comma-dangle": ["error", "always-multiline"], - eqeqeq: "error", - indent: ["warn", 2, { SwitchCase: 1 }], "mozilla/no-aArgs": "warn", "mozilla/balanced-listeners": "off", + "comma-dangle": ["error", "always-multiline"], + "eqeqeq": "error", + "indent": ["warn", 2, { SwitchCase: 1 }], "no-console": "warn", + "no-var": "error", "no-shadow": "error", "no-unused-vars": "error", "prefer-const": "warn", "prefer-spread": "error", - semi: ["error", "always"], + "semi": ["error", "always"], + "valid-jsdoc": "warn", }, }; diff --git a/src/.eslintrc.json b/src/.eslintrc.json deleted file mode 100644 index 5c7cc9e..0000000 --- a/src/.eslintrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "env": { - "browser": true, - "es6": true, - "webextensions": true - }, - "extends": ["eslint:recommended"], - "rules": { - "no-console": "warn" - } -}