mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1620542 - Automatically fix ESLint errors in .eslintrc.js files. r=mossop
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D65703 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
f102f74183
commit
15cfe23b88
1777
.eslintrc.js
1777
.eslintrc.js
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
rules: {
|
||||
"mozilla/no-aArgs": "error",
|
||||
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
||||
"mozilla/var-only-at-top-level": "error",
|
||||
|
||||
"block-scoped-var": "error",
|
||||
"camelcase": ["error", { "properties": "never" }],
|
||||
"complexity": ["error", 20],
|
||||
camelcase: ["error", { properties: "never" }],
|
||||
complexity: ["error", 20],
|
||||
|
||||
"handle-callback-err": ["error", "er"],
|
||||
"max-nested-callbacks": ["error", 4],
|
||||
"new-cap": ["error", {"capIsNew": false}],
|
||||
"new-cap": ["error", { capIsNew: false }],
|
||||
"no-fallthrough": "error",
|
||||
"no-multi-str": "error",
|
||||
"no-proto": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-shadow": "error",
|
||||
"no-unused-vars": ["error", {"vars": "all", "args": "none"}],
|
||||
"no-unused-vars": ["error", { vars: "all", args: "none" }],
|
||||
"one-var": ["error", "never"],
|
||||
"radix": "error",
|
||||
"strict": ["error", "global"],
|
||||
"yoda": "error",
|
||||
radix: "error",
|
||||
strict: ["error", "global"],
|
||||
yoda: "error",
|
||||
"no-undef-init": "error",
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1,22 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
rules: {
|
||||
// XXX These are rules that are enabled in the recommended configuration, but
|
||||
// disabled here due to failures when initially implemented. They should be
|
||||
// removed (and hence enabled) at some stage.
|
||||
"no-nested-ternary": "off",
|
||||
},
|
||||
|
||||
"overrides": [{
|
||||
"files": [
|
||||
// Bug 1602061 TODO: These tests access DOM elements via
|
||||
// id-as-variable-name, which eslint doesn't have support for yet.
|
||||
"attributes/test_listbox.html",
|
||||
"treeupdate/test_ariaowns.html",
|
||||
],
|
||||
"rules": {
|
||||
"no-undef": "off",
|
||||
}
|
||||
}]
|
||||
overrides: [
|
||||
{
|
||||
files: [
|
||||
// Bug 1602061 TODO: These tests access DOM elements via
|
||||
// id-as-variable-name, which eslint doesn't have support for yet.
|
||||
"attributes/test_listbox.html",
|
||||
"treeupdate/test_ariaowns.html",
|
||||
],
|
||||
rules: {
|
||||
"no-undef": "off",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
@ -1,10 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
rules: {
|
||||
// XXX Bug 1326071 - This should be reduced down - probably to 20 or to
|
||||
// be removed & synced with the mozilla/recommended value.
|
||||
"complexity": ["error", {"max": 44}],
|
||||
complexity: ["error", { max: 44 }],
|
||||
|
||||
// Disallow empty statements. This will report an error for:
|
||||
// try { something(); } catch (e) {}
|
||||
@ -22,5 +22,5 @@ module.exports = {
|
||||
"no-shadow": "error",
|
||||
|
||||
"mozilla/no-task": "error",
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,8 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,8 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test",
|
||||
"plugin:mozilla/mochitest-test",
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test", "plugin:mozilla/mochitest-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,8 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test",
|
||||
"plugin:mozilla/mochitest-test",
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test", "plugin:mozilla/mochitest-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test",
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test",
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test",
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,11 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
],
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
|
||||
"env": {
|
||||
"webextensions": true,
|
||||
env: {
|
||||
webextensions: true,
|
||||
},
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -4,6 +4,6 @@ module.exports = {
|
||||
rules: {
|
||||
// XXX Bug 1326071 - This should be reduced down - probably to 20 or to
|
||||
// be removed & synced with the mozilla/recommended value.
|
||||
"complexity": ["error", 61],
|
||||
}
|
||||
complexity: ["error", 61],
|
||||
},
|
||||
};
|
||||
|
@ -1,11 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
env: {
|
||||
"mozilla/browser-window": true,
|
||||
},
|
||||
|
||||
"plugins": [
|
||||
"mozilla",
|
||||
]
|
||||
plugins: ["mozilla"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": "../../../toolkit/components/extensions/.eslintrc.js",
|
||||
extends: "../../../toolkit/components/extensions/.eslintrc.js",
|
||||
};
|
||||
|
@ -1,6 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": "../../../../toolkit/components/extensions/child/.eslintrc.js",
|
||||
extends: "../../../../toolkit/components/extensions/child/.eslintrc.js",
|
||||
};
|
||||
|
||||
|
@ -1,32 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": "../../../../toolkit/components/extensions/parent/.eslintrc.js",
|
||||
extends: "../../../../toolkit/components/extensions/parent/.eslintrc.js",
|
||||
|
||||
"globals": {
|
||||
"Tab": true,
|
||||
"TabContext": true,
|
||||
"Window": true,
|
||||
"actionContextMenu": true,
|
||||
"browserActionFor": true,
|
||||
"clickModifiersFromEvent": true,
|
||||
"getContainerForCookieStoreId": true,
|
||||
"getDevToolsTargetForContext": true,
|
||||
"getInspectedWindowFront": true,
|
||||
"getTargetTabIdForToolbox": true,
|
||||
"getToolboxEvalOptions": true,
|
||||
"isContainerCookieStoreId": true,
|
||||
"isPrivateCookieStoreId": true,
|
||||
"isValidCookieStoreId": true,
|
||||
"makeWidgetId": true,
|
||||
"openOptionsPage": true,
|
||||
"pageActionFor": true,
|
||||
"replaceUrlInTab": true,
|
||||
"searchInitialized": true,
|
||||
"sidebarActionFor": true,
|
||||
"tabGetSender": true,
|
||||
"tabTracker": true,
|
||||
"waitForTabLoaded": true,
|
||||
"windowTracker": true,
|
||||
globals: {
|
||||
Tab: true,
|
||||
TabContext: true,
|
||||
Window: true,
|
||||
actionContextMenu: true,
|
||||
browserActionFor: true,
|
||||
clickModifiersFromEvent: true,
|
||||
getContainerForCookieStoreId: true,
|
||||
getDevToolsTargetForContext: true,
|
||||
getInspectedWindowFront: true,
|
||||
getTargetTabIdForToolbox: true,
|
||||
getToolboxEvalOptions: true,
|
||||
isContainerCookieStoreId: true,
|
||||
isPrivateCookieStoreId: true,
|
||||
isValidCookieStoreId: true,
|
||||
makeWidgetId: true,
|
||||
openOptionsPage: true,
|
||||
pageActionFor: true,
|
||||
replaceUrlInTab: true,
|
||||
searchInitialized: true,
|
||||
sidebarActionFor: true,
|
||||
tabGetSender: true,
|
||||
tabTracker: true,
|
||||
waitForTabLoaded: true,
|
||||
windowTracker: true,
|
||||
},
|
||||
};
|
||||
|
@ -1,11 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"webextensions": true,
|
||||
env: {
|
||||
webextensions: true,
|
||||
},
|
||||
|
||||
"rules": {
|
||||
rules: {
|
||||
"no-shadow": 0,
|
||||
},
|
||||
};
|
||||
|
@ -1,8 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"webextensions": true,
|
||||
env: {
|
||||
browser: true,
|
||||
webextensions: true,
|
||||
},
|
||||
};
|
||||
|
@ -1,9 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
env: {
|
||||
// The tests in this folder are testing based on WebExtensions, so lets
|
||||
// just define the webextensions environment here.
|
||||
"webextensions": true
|
||||
}
|
||||
webextensions: true,
|
||||
},
|
||||
};
|
||||
|
@ -1,27 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
rules: {
|
||||
"block-scoped-var": "error",
|
||||
"complexity": ["error", {"max": 22}],
|
||||
complexity: ["error", { max: 22 }],
|
||||
"max-nested-callbacks": ["error", 3],
|
||||
"no-extend-native": "error",
|
||||
"no-fallthrough": ["error", { "commentPattern": ".*[Ii]ntentional(?:ly)?\\s+fall(?:ing)?[\\s-]*through.*" }],
|
||||
"no-fallthrough": [
|
||||
"error",
|
||||
{
|
||||
commentPattern:
|
||||
".*[Ii]ntentional(?:ly)?\\s+fall(?:ing)?[\\s-]*through.*",
|
||||
},
|
||||
],
|
||||
"no-multi-str": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-shadow": "error",
|
||||
"no-unused-vars": ["error", { "args": "after-used", "vars": "all" }],
|
||||
"strict": ["error", "global"],
|
||||
"yoda": "error"
|
||||
"no-unused-vars": ["error", { args: "after-used", vars: "all" }],
|
||||
strict: ["error", "global"],
|
||||
yoda: "error",
|
||||
},
|
||||
|
||||
"overrides": [{
|
||||
"files": "tests/unit/head*.js",
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "local",
|
||||
}],
|
||||
overrides: [
|
||||
{
|
||||
files: "tests/unit/head*.js",
|
||||
rules: {
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
vars: "local",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
};
|
||||
|
@ -1,27 +1,27 @@
|
||||
module.exports = {
|
||||
// When adding items to this file please check for effects on sub-directories.
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
parser: "babel-eslint",
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
"sourceType": "module"
|
||||
sourceType: "module",
|
||||
},
|
||||
"env": {
|
||||
"node": true
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
"plugins": [
|
||||
plugins: [
|
||||
"import", // require("eslint-plugin-import")
|
||||
"react", // require("eslint-plugin-react")
|
||||
"jsx-a11y", // require("eslint-plugin-jsx-a11y")
|
||||
],
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "16.2.0"
|
||||
}
|
||||
settings: {
|
||||
react: {
|
||||
version: "16.2.0",
|
||||
},
|
||||
},
|
||||
"extends": [
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:jsx-a11y/recommended", // require("eslint-plugin-jsx-a11y")
|
||||
"plugin:mozilla/recommended", // require("eslint-plugin-mozilla") require("eslint-plugin-fetch-options") require("eslint-plugin-html") require("eslint-plugin-no-unsanitized")
|
||||
@ -31,10 +31,10 @@ module.exports = {
|
||||
"plugin:prettier/recommended", // require("eslint-plugin-prettier")
|
||||
"prettier/react", // require("eslint-config-prettier")
|
||||
],
|
||||
"overrides": [
|
||||
overrides: [
|
||||
{
|
||||
// These files use fluent-dom to insert content
|
||||
"files": [
|
||||
files: [
|
||||
"content-src/aboutwelcome/components/HeroText.jsx",
|
||||
"content-src/asrouter/templates/OnboardingMessage/**",
|
||||
"content-src/asrouter/templates/FirstRun/**",
|
||||
@ -45,28 +45,28 @@ module.exports = {
|
||||
"content-src/components/MoreRecommendations/MoreRecommendations.jsx",
|
||||
"content-src/components/CollapsibleSection/CollapsibleSection.jsx",
|
||||
"content-src/components/DiscoveryStreamComponents/DSEmptyState/DSEmptyState.jsx",
|
||||
"content-src/components/DiscoveryStreamComponents/DSPrivacyModal/DSPrivacyModal.jsx"
|
||||
"content-src/components/DiscoveryStreamComponents/DSPrivacyModal/DSPrivacyModal.jsx",
|
||||
],
|
||||
"rules": {
|
||||
rules: {
|
||||
"jsx-a11y/anchor-has-content": 0,
|
||||
"jsx-a11y/heading-has-content": 0,
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
// Use a configuration that's more appropriate for JSMs
|
||||
"files": "**/*.jsm",
|
||||
"parserOptions": {
|
||||
"sourceType": "script"
|
||||
files: "**/*.jsm",
|
||||
parserOptions: {
|
||||
sourceType: "script",
|
||||
},
|
||||
"env": {
|
||||
"node": false
|
||||
env: {
|
||||
node: false,
|
||||
},
|
||||
"rules": {
|
||||
"no-implicit-globals": 0
|
||||
}
|
||||
}
|
||||
rules: {
|
||||
"no-implicit-globals": 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
"rules": {
|
||||
rules: {
|
||||
"fetch-options/no-fetch-credentials": 2,
|
||||
|
||||
"react/jsx-boolean-value": [2, "always"],
|
||||
@ -89,16 +89,16 @@ module.exports = {
|
||||
"react/no-unknown-property": 2,
|
||||
"react/require-render-return": 2,
|
||||
|
||||
"accessor-pairs": [2, {"setWithoutGet": true, "getWithoutSet": false}],
|
||||
"accessor-pairs": [2, { setWithoutGet: true, getWithoutSet: false }],
|
||||
"array-callback-return": 2,
|
||||
"block-scoped-var": 2,
|
||||
"callback-return": 0,
|
||||
"camelcase": 0,
|
||||
camelcase: 0,
|
||||
"capitalized-comments": 0,
|
||||
"class-methods-use-this": 0,
|
||||
"consistent-this": [2, "use-bind"],
|
||||
"default-case": 0,
|
||||
"eqeqeq": 2,
|
||||
eqeqeq: 2,
|
||||
"for-direction": 2,
|
||||
"func-name-matching": 2,
|
||||
"func-names": 0,
|
||||
@ -118,9 +118,9 @@ module.exports = {
|
||||
"max-nested-callbacks": [2, 4],
|
||||
"max-params": [2, 6],
|
||||
"max-statements": [2, 50],
|
||||
"max-statements-per-line": [2, {"max": 2}],
|
||||
"max-statements-per-line": [2, { max: 2 }],
|
||||
"multiline-comment-style": 0,
|
||||
"new-cap": [2, {"newIsCap": true, "capIsNew": false}],
|
||||
"new-cap": [2, { newIsCap: true, capIsNew: false }],
|
||||
"newline-after-var": 0,
|
||||
"newline-before-return": 0,
|
||||
"no-alert": 2,
|
||||
@ -136,7 +136,7 @@ module.exports = {
|
||||
"no-eq-null": 2,
|
||||
"no-extend-native": 2,
|
||||
"no-extra-label": 2,
|
||||
"no-implicit-coercion": [2, {"allow": ["!!"]}],
|
||||
"no-implicit-coercion": [2, { allow: ["!!"] }],
|
||||
"no-implicit-globals": 2,
|
||||
"no-inline-comments": 0,
|
||||
"no-invalid-this": 0,
|
||||
@ -186,22 +186,35 @@ module.exports = {
|
||||
"operator-assignment": [2, "always"],
|
||||
"padding-line-between-statements": 0,
|
||||
"prefer-const": 0, // TODO: Change to `1`?
|
||||
"prefer-destructuring": [2, {"AssignmentExpression": {"array": true}, "VariableDeclarator": {"array": true, "object": true}}],
|
||||
"prefer-destructuring": [
|
||||
2,
|
||||
{
|
||||
AssignmentExpression: { array: true },
|
||||
VariableDeclarator: { array: true, object: true },
|
||||
},
|
||||
],
|
||||
"prefer-numeric-literals": 2,
|
||||
"prefer-promise-reject-errors": 2,
|
||||
"prefer-reflect": 0,
|
||||
"prefer-rest-params": 2,
|
||||
"prefer-spread": 2,
|
||||
"prefer-template": 2,
|
||||
"radix": [2, "always"],
|
||||
radix: [2, "always"],
|
||||
"require-await": 2,
|
||||
"require-jsdoc": 0,
|
||||
"sort-keys": 0,
|
||||
"sort-vars": 2,
|
||||
"strict": 0,
|
||||
strict: 0,
|
||||
"symbol-description": 2,
|
||||
"valid-jsdoc": [0, {"requireReturn": false, "requireParamDescription": false, "requireReturnDescription": false}],
|
||||
"valid-jsdoc": [
|
||||
0,
|
||||
{
|
||||
requireReturn: false,
|
||||
requireParamDescription: false,
|
||||
requireReturnDescription: false,
|
||||
},
|
||||
],
|
||||
"vars-on-top": 2,
|
||||
"yoda": [2, "never"]
|
||||
}
|
||||
yoda: [2, "never"],
|
||||
},
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
module.exports = {
|
||||
rules: {
|
||||
"import/no-commonjs": 2
|
||||
}
|
||||
}
|
||||
"import/no-commonjs": 2,
|
||||
},
|
||||
};
|
||||
|
@ -1,17 +1,17 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"mocha": true
|
||||
env: {
|
||||
mocha: true,
|
||||
},
|
||||
"globals": {
|
||||
"assert": true,
|
||||
"chai": true,
|
||||
"sinon": true
|
||||
globals: {
|
||||
assert: true,
|
||||
chai: true,
|
||||
sinon: true,
|
||||
},
|
||||
"rules": {
|
||||
rules: {
|
||||
"func-name-matching": 0,
|
||||
"import/no-commonjs": 2,
|
||||
"lines-between-class-members": 0,
|
||||
"react/jsx-no-bind": 0,
|
||||
"require-await": 0
|
||||
}
|
||||
"require-await": 0,
|
||||
},
|
||||
};
|
||||
|
@ -16,12 +16,15 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": "test/unit/head.js",
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "local",
|
||||
}],
|
||||
files: "test/unit/head.js",
|
||||
rules: {
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
vars: "local",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -29,37 +32,49 @@ module.exports = {
|
||||
"mozilla/var-only-at-top-level": "error",
|
||||
|
||||
"block-scoped-var": "error",
|
||||
complexity: ["error", {
|
||||
max: 20,
|
||||
}],
|
||||
complexity: [
|
||||
"error",
|
||||
{
|
||||
max: 20,
|
||||
},
|
||||
],
|
||||
"max-nested-callbacks": ["error", 4],
|
||||
"no-console": ["error", { allow: ["error"] }],
|
||||
"no-fallthrough": "error",
|
||||
"no-multi-str": "error",
|
||||
"no-proto": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-unused-vars": ["error", {
|
||||
args: "none",
|
||||
vars: "all"
|
||||
}],
|
||||
"no-use-before-define": ["error", {
|
||||
functions: false,
|
||||
}],
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
vars: "all",
|
||||
},
|
||||
],
|
||||
"no-use-before-define": [
|
||||
"error",
|
||||
{
|
||||
functions: false,
|
||||
},
|
||||
],
|
||||
radix: "error",
|
||||
"valid-jsdoc": ["error", {
|
||||
prefer: {
|
||||
return: "returns",
|
||||
"valid-jsdoc": [
|
||||
"error",
|
||||
{
|
||||
prefer: {
|
||||
return: "returns",
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
bool: "boolean",
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
bool: "boolean",
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
}],
|
||||
],
|
||||
yoda: "error",
|
||||
},
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/mochitest-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/mochitest-test"],
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
"no-eval": "off"
|
||||
rules: {
|
||||
"no-eval": "off",
|
||||
},
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -3,29 +3,35 @@
|
||||
module.exports = {
|
||||
rules: {
|
||||
"mozilla/var-only-at-top-level": "error",
|
||||
"require-jsdoc": ["error", {
|
||||
"require": {
|
||||
"FunctionDeclaration": false,
|
||||
"MethodDefinition": false,
|
||||
"ClassDeclaration": true,
|
||||
"ArrowFunctionExpression": false,
|
||||
"FunctionExpression": false
|
||||
}
|
||||
}],
|
||||
"valid-jsdoc": ["error", {
|
||||
prefer: {
|
||||
return: "returns",
|
||||
"require-jsdoc": [
|
||||
"error",
|
||||
{
|
||||
require: {
|
||||
FunctionDeclaration: false,
|
||||
MethodDefinition: false,
|
||||
ClassDeclaration: true,
|
||||
ArrowFunctionExpression: false,
|
||||
FunctionExpression: false,
|
||||
},
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
Object: "object",
|
||||
bool: "boolean",
|
||||
],
|
||||
"valid-jsdoc": [
|
||||
"error",
|
||||
{
|
||||
prefer: {
|
||||
return: "returns",
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
Object: "object",
|
||||
bool: "boolean",
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
}],
|
||||
}
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -5,7 +5,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
}
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,11 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
env: {
|
||||
"mozilla/browser-window": true,
|
||||
},
|
||||
|
||||
"plugins": [
|
||||
"mozilla",
|
||||
]
|
||||
plugins: ["mozilla"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -3,30 +3,36 @@
|
||||
module.exports = {
|
||||
rules: {
|
||||
"mozilla/var-only-at-top-level": "error",
|
||||
"require-jsdoc": ["error", {
|
||||
"require": {
|
||||
"FunctionDeclaration": false,
|
||||
"MethodDefinition": false,
|
||||
"ClassDeclaration": true,
|
||||
"ArrowFunctionExpression": false,
|
||||
"FunctionExpression": false
|
||||
}
|
||||
}],
|
||||
"valid-jsdoc": ["error", {
|
||||
prefer: {
|
||||
return: "returns",
|
||||
"require-jsdoc": [
|
||||
"error",
|
||||
{
|
||||
require: {
|
||||
FunctionDeclaration: false,
|
||||
MethodDefinition: false,
|
||||
ClassDeclaration: true,
|
||||
ArrowFunctionExpression: false,
|
||||
FunctionExpression: false,
|
||||
},
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
Object: "object",
|
||||
bool: "boolean",
|
||||
],
|
||||
"valid-jsdoc": [
|
||||
"error",
|
||||
{
|
||||
prefer: {
|
||||
return: "returns",
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
Object: "object",
|
||||
bool: "boolean",
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
}],
|
||||
],
|
||||
"no-unused-expressions": "error",
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"webextensions": true,
|
||||
env: {
|
||||
webextensions: true,
|
||||
},
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"webextensions": true,
|
||||
env: {
|
||||
webextensions: true,
|
||||
},
|
||||
};
|
||||
|
@ -1,34 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
rules: {
|
||||
// Rules from the mozilla plugin
|
||||
"mozilla/balanced-listeners": "error",
|
||||
"mozilla/no-aArgs": "error",
|
||||
"mozilla/var-only-at-top-level": "error",
|
||||
|
||||
"valid-jsdoc": ["error", {
|
||||
"prefer": {
|
||||
"return": "returns",
|
||||
"valid-jsdoc": [
|
||||
"error",
|
||||
{
|
||||
prefer: {
|
||||
return: "returns",
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
bool: "boolean",
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
},
|
||||
"preferType": {
|
||||
"Boolean": "boolean",
|
||||
"Number": "number",
|
||||
"String": "string",
|
||||
"bool": "boolean",
|
||||
},
|
||||
"requireParamDescription": false,
|
||||
"requireReturn": false,
|
||||
"requireReturnDescription": false,
|
||||
}],
|
||||
],
|
||||
|
||||
// No expressions where a statement is expected
|
||||
"no-unused-expressions": "error",
|
||||
|
||||
// No declaring variables that are never used
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none", "vars": "all"
|
||||
}],
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
vars: "all",
|
||||
},
|
||||
],
|
||||
|
||||
// No using variables before defined
|
||||
"no-use-before-define": "error",
|
||||
@ -38,7 +45,7 @@ module.exports = {
|
||||
"block-scoped-var": "error",
|
||||
|
||||
// Warn about cyclomatic complexity in functions.
|
||||
"complexity": ["error", {"max": 26}],
|
||||
complexity: ["error", { max: 26 }],
|
||||
|
||||
// Maximum depth callbacks can be nested.
|
||||
"max-nested-callbacks": ["error", 4],
|
||||
@ -60,25 +67,30 @@ module.exports = {
|
||||
"no-return-assign": "error",
|
||||
|
||||
// Require use of the second argument for parseInt().
|
||||
"radix": "error",
|
||||
radix: "error",
|
||||
|
||||
// Require "use strict" to be defined globally in the script.
|
||||
"strict": ["error", "global"],
|
||||
strict: ["error", "global"],
|
||||
|
||||
// Disallow Yoda conditions (where literal value comes first).
|
||||
"yoda": "error",
|
||||
yoda: "error",
|
||||
|
||||
// Disallow function or variable declarations in nested blocks
|
||||
"no-inner-declarations": "error",
|
||||
},
|
||||
|
||||
"overrides": [{
|
||||
"files": "test/unit/head.js",
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "local",
|
||||
}],
|
||||
overrides: [
|
||||
{
|
||||
files: "test/unit/head.js",
|
||||
rules: {
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
vars: "local",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,26 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
rules: {
|
||||
// Rules from the mozilla plugin
|
||||
"mozilla/balanced-listeners": "error",
|
||||
"mozilla/no-aArgs": "error",
|
||||
"mozilla/var-only-at-top-level": "error",
|
||||
|
||||
"valid-jsdoc": ["error", {
|
||||
"prefer": {
|
||||
"return": "returns",
|
||||
"valid-jsdoc": [
|
||||
"error",
|
||||
{
|
||||
prefer: {
|
||||
return: "returns",
|
||||
},
|
||||
preferType: {
|
||||
Boolean: "boolean",
|
||||
Number: "number",
|
||||
String: "string",
|
||||
bool: "boolean",
|
||||
},
|
||||
requireParamDescription: false,
|
||||
requireReturn: false,
|
||||
requireReturnDescription: false,
|
||||
},
|
||||
"preferType": {
|
||||
"Boolean": "boolean",
|
||||
"Number": "number",
|
||||
"String": "string",
|
||||
"bool": "boolean",
|
||||
},
|
||||
"requireParamDescription": false,
|
||||
"requireReturn": false,
|
||||
"requireReturnDescription": false,
|
||||
}],
|
||||
],
|
||||
|
||||
// No expressions where a statement is expected
|
||||
"no-unused-expressions": "error",
|
||||
@ -33,13 +36,13 @@ module.exports = {
|
||||
"block-scoped-var": "error",
|
||||
|
||||
// Warn about cyclomatic complexity in functions.
|
||||
"complexity": ["error", {"max": 26}],
|
||||
complexity: ["error", { max: 26 }],
|
||||
|
||||
// Maximum depth callbacks can be nested.
|
||||
"max-nested-callbacks": ["error", 4],
|
||||
|
||||
// Allow the console API aside from console.log.
|
||||
"no-console": ["error", {allow: ["error", "info", "trace", "warn"]}],
|
||||
"no-console": ["error", { allow: ["error", "info", "trace", "warn"] }],
|
||||
|
||||
// Disallow fallthrough of case statements, except if there is a comment.
|
||||
"no-fallthrough": "error",
|
||||
@ -55,13 +58,13 @@ module.exports = {
|
||||
"no-return-assign": "error",
|
||||
|
||||
// Require use of the second argument for parseInt().
|
||||
"radix": "error",
|
||||
radix: "error",
|
||||
|
||||
// Require "use strict" to be defined globally in the script.
|
||||
"strict": ["error", "global"],
|
||||
strict: ["error", "global"],
|
||||
|
||||
// Disallow Yoda conditions (where literal value comes first).
|
||||
"yoda": "error",
|
||||
yoda: "error",
|
||||
|
||||
// Disallow function or variable declarations in nested blocks
|
||||
"no-inner-declarations": "error",
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,14 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/browser-test"
|
||||
],
|
||||
extends: ["plugin:mozilla/browser-test"],
|
||||
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "all"
|
||||
}]
|
||||
}
|
||||
rules: {
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
vars: "all",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -1,8 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/mochitest-test",
|
||||
"plugin:mozilla/browser-test"
|
||||
]
|
||||
extends: ["plugin:mozilla/mochitest-test", "plugin:mozilla/browser-test"],
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"plugin:mozilla/xpcshell-test"
|
||||
]
|
||||
};
|
||||
extends: ["plugin:mozilla/xpcshell-test"],
|
||||
};
|
||||
|
@ -1,155 +1,153 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"plugins": [
|
||||
"react"
|
||||
],
|
||||
"globals": {
|
||||
"exports": true,
|
||||
"isWorker": true,
|
||||
"loader": true,
|
||||
"module": true,
|
||||
"reportError": true,
|
||||
"require": true,
|
||||
plugins: ["react"],
|
||||
globals: {
|
||||
exports: true,
|
||||
isWorker: true,
|
||||
loader: true,
|
||||
module: true,
|
||||
reportError: true,
|
||||
require: true,
|
||||
},
|
||||
"overrides": [{
|
||||
"files": [
|
||||
"client/framework/**",
|
||||
],
|
||||
"rules": {
|
||||
"no-return-assign": "off",
|
||||
}
|
||||
}, {
|
||||
"files": [
|
||||
"client/shared/*.jsm",
|
||||
],
|
||||
"rules": {
|
||||
"camelcase": "off",
|
||||
}
|
||||
}, {
|
||||
"files": [
|
||||
"client/framework/**",
|
||||
"client/shared/*.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/storage/VariablesView.jsm",
|
||||
],
|
||||
"rules": {
|
||||
"consistent-return": "off",
|
||||
}
|
||||
}, {
|
||||
"files": [
|
||||
"client/framework/**",
|
||||
],
|
||||
"rules": {
|
||||
"max-nested-callbacks": "off",
|
||||
}
|
||||
}, {
|
||||
"files": [
|
||||
"client/framework/**",
|
||||
"client/shared/*.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/storage/VariablesView.jsm",
|
||||
"shared/webconsole/test/chrome/*.html",
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/no-aArgs": "off",
|
||||
}
|
||||
}, {
|
||||
"files": [
|
||||
"client/framework/test/**",
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/var-only-at-top-level": "off",
|
||||
}
|
||||
}, {
|
||||
"files": [
|
||||
"client/framework/**",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/storage/VariablesView.jsm",
|
||||
],
|
||||
"rules": {
|
||||
"no-shadow": "off",
|
||||
}
|
||||
}, {
|
||||
"files": [
|
||||
"client/framework/**",
|
||||
],
|
||||
"rules": {
|
||||
"strict": "off",
|
||||
}
|
||||
}, {
|
||||
// For all head*.js files, turn off no-unused-vars at a global level
|
||||
"files": [
|
||||
"**/head*.js",
|
||||
],
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {"args": "none", "vars": "local"}],
|
||||
}
|
||||
}, {
|
||||
// For all server files, prevent requiring devtools/client modules.
|
||||
"files": [
|
||||
"server/**",
|
||||
// The rule also applies to all `shared` files, with the exception of
|
||||
// shared/fronts.
|
||||
// This first pattern matches files in a shared subfolder other than "fronts".
|
||||
"shared/!(fronts)/**",
|
||||
// This second pattern matches files directly under shared.
|
||||
"shared/*.**",
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/reject-some-requires": ["error", "^(resource\://)?devtools/client"],
|
||||
}
|
||||
}, {
|
||||
// Cu, Cc etc... are not available in most devtools modules loaded by require.
|
||||
"files": [
|
||||
"**"
|
||||
],
|
||||
"excludedFiles": [
|
||||
// Enable the rule on JSM, test head files and some specific files.
|
||||
"**/*.jsm",
|
||||
"**/test/**/head.js",
|
||||
"**/test/**/shared-head.js",
|
||||
"client/debugger/test/mochitest/code_frame-script.js",
|
||||
"client/inspector/animation-old/test/doc_frame_script.js",
|
||||
"client/inspector/animation/test/doc_frame_script.js",
|
||||
"client/inspector/rules/test/doc_frame_script.js",
|
||||
"client/inspector/shared/test/doc_frame_script.js",
|
||||
"client/jsonview/converter-observer.js",
|
||||
"client/jsonview/test/doc_frame_script.js",
|
||||
"client/responsive.html/browser/content.js",
|
||||
"client/shared/browser-loader.js",
|
||||
"server/actors/webconsole/content-process-forward.js",
|
||||
"server/actors/worker/service-worker-process.js",
|
||||
"server/startup/content-process.js",
|
||||
"server/startup/frame.js",
|
||||
"shared/base-loader.js",
|
||||
"shared/worker/loader.js",
|
||||
"startup/aboutdebugging-registration.js",
|
||||
"startup/aboutdevtools/aboutdevtools-registration.js",
|
||||
"startup/aboutdevtoolstoolbox-registration.js",
|
||||
"startup/devtools-startup.js",
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/no-define-cc-etc": "off",
|
||||
}
|
||||
}, {
|
||||
// All DevTools files should avoid relative paths.
|
||||
"files": [
|
||||
"**"
|
||||
],
|
||||
"excludedFiles": [
|
||||
// Debugger modules have a custom bundling logic which relies on relative
|
||||
// paths.
|
||||
"client/debugger/**",
|
||||
// `client/shared/build` contains node helpers to build the debugger and
|
||||
// not devtools modules.
|
||||
"client/shared/build/**",
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/reject-relative-requires": "error",
|
||||
}
|
||||
}],
|
||||
"rules": {
|
||||
overrides: [
|
||||
{
|
||||
files: ["client/framework/**"],
|
||||
rules: {
|
||||
"no-return-assign": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["client/shared/*.jsm"],
|
||||
rules: {
|
||||
camelcase: "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
"client/framework/**",
|
||||
"client/shared/*.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/storage/VariablesView.jsm",
|
||||
],
|
||||
rules: {
|
||||
"consistent-return": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["client/framework/**"],
|
||||
rules: {
|
||||
"max-nested-callbacks": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
"client/framework/**",
|
||||
"client/shared/*.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/storage/VariablesView.jsm",
|
||||
"shared/webconsole/test/chrome/*.html",
|
||||
],
|
||||
rules: {
|
||||
"mozilla/no-aArgs": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["client/framework/test/**"],
|
||||
rules: {
|
||||
"mozilla/var-only-at-top-level": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
"client/framework/**",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/storage/VariablesView.jsm",
|
||||
],
|
||||
rules: {
|
||||
"no-shadow": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["client/framework/**"],
|
||||
rules: {
|
||||
strict: "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
// For all head*.js files, turn off no-unused-vars at a global level
|
||||
files: ["**/head*.js"],
|
||||
rules: {
|
||||
"no-unused-vars": ["error", { args: "none", vars: "local" }],
|
||||
},
|
||||
},
|
||||
{
|
||||
// For all server files, prevent requiring devtools/client modules.
|
||||
files: [
|
||||
"server/**",
|
||||
// The rule also applies to all `shared` files, with the exception of
|
||||
// shared/fronts.
|
||||
// This first pattern matches files in a shared subfolder other than "fronts".
|
||||
"shared/!(fronts)/**",
|
||||
// This second pattern matches files directly under shared.
|
||||
"shared/*.**",
|
||||
],
|
||||
rules: {
|
||||
"mozilla/reject-some-requires": [
|
||||
"error",
|
||||
"^(resource://)?devtools/client",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
// Cu, Cc etc... are not available in most devtools modules loaded by require.
|
||||
files: ["**"],
|
||||
excludedFiles: [
|
||||
// Enable the rule on JSM, test head files and some specific files.
|
||||
"**/*.jsm",
|
||||
"**/test/**/head.js",
|
||||
"**/test/**/shared-head.js",
|
||||
"client/debugger/test/mochitest/code_frame-script.js",
|
||||
"client/inspector/animation-old/test/doc_frame_script.js",
|
||||
"client/inspector/animation/test/doc_frame_script.js",
|
||||
"client/inspector/rules/test/doc_frame_script.js",
|
||||
"client/inspector/shared/test/doc_frame_script.js",
|
||||
"client/jsonview/converter-observer.js",
|
||||
"client/jsonview/test/doc_frame_script.js",
|
||||
"client/responsive.html/browser/content.js",
|
||||
"client/shared/browser-loader.js",
|
||||
"server/actors/webconsole/content-process-forward.js",
|
||||
"server/actors/worker/service-worker-process.js",
|
||||
"server/startup/content-process.js",
|
||||
"server/startup/frame.js",
|
||||
"shared/base-loader.js",
|
||||
"shared/worker/loader.js",
|
||||
"startup/aboutdebugging-registration.js",
|
||||
"startup/aboutdevtools/aboutdevtools-registration.js",
|
||||
"startup/aboutdevtoolstoolbox-registration.js",
|
||||
"startup/devtools-startup.js",
|
||||
],
|
||||
rules: {
|
||||
"mozilla/no-define-cc-etc": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
// All DevTools files should avoid relative paths.
|
||||
files: ["**"],
|
||||
excludedFiles: [
|
||||
// Debugger modules have a custom bundling logic which relies on relative
|
||||
// paths.
|
||||
"client/debugger/**",
|
||||
// `client/shared/build` contains node helpers to build the debugger and
|
||||
// not devtools modules.
|
||||
"client/shared/build/**",
|
||||
],
|
||||
rules: {
|
||||
"mozilla/reject-relative-requires": "error",
|
||||
},
|
||||
},
|
||||
],
|
||||
rules: {
|
||||
// These are the rules that have been configured so far to match the
|
||||
// devtools coding style.
|
||||
|
||||
@ -160,9 +158,12 @@ module.exports = {
|
||||
// devtools/shared/platform is special; see the README.md in that
|
||||
// directory for details. We reject requires using explicit
|
||||
// subdirectories of this directory.
|
||||
"mozilla/reject-some-requires": ["error", "^devtools/shared/platform/(chome|content)/"],
|
||||
"mozilla/reject-some-requires": [
|
||||
"error",
|
||||
"^devtools/shared/platform/(chome|content)/",
|
||||
],
|
||||
"mozilla/var-only-at-top-level": "error",
|
||||
"mozilla/use-chromeutils-import": ["error", {allowCu: true}],
|
||||
"mozilla/use-chromeutils-import": ["error", { allowCu: true }],
|
||||
|
||||
// Rules from the React plugin
|
||||
"react/display-name": "error",
|
||||
@ -173,49 +174,47 @@ module.exports = {
|
||||
"react/no-unknown-property": "error",
|
||||
"react/prefer-es6-class": ["off", "always"],
|
||||
"react/prop-types": "error",
|
||||
"react/sort-comp": ["error", {
|
||||
order: [
|
||||
"static-methods",
|
||||
"lifecycle",
|
||||
"everything-else",
|
||||
"render"
|
||||
],
|
||||
groups: {
|
||||
lifecycle: [
|
||||
"displayName",
|
||||
"propTypes",
|
||||
"contextTypes",
|
||||
"childContextTypes",
|
||||
"mixins",
|
||||
"statics",
|
||||
"defaultProps",
|
||||
"constructor",
|
||||
"getDefaultProps",
|
||||
"getInitialState",
|
||||
"state",
|
||||
"getChildContext",
|
||||
"componentWillMount",
|
||||
"componentDidMount",
|
||||
"componentWillReceiveProps",
|
||||
"shouldComponentUpdate",
|
||||
"componentWillUpdate",
|
||||
"componentDidUpdate",
|
||||
"componentWillUnmount"
|
||||
]
|
||||
}
|
||||
}],
|
||||
"react/sort-comp": [
|
||||
"error",
|
||||
{
|
||||
order: ["static-methods", "lifecycle", "everything-else", "render"],
|
||||
groups: {
|
||||
lifecycle: [
|
||||
"displayName",
|
||||
"propTypes",
|
||||
"contextTypes",
|
||||
"childContextTypes",
|
||||
"mixins",
|
||||
"statics",
|
||||
"defaultProps",
|
||||
"constructor",
|
||||
"getDefaultProps",
|
||||
"getInitialState",
|
||||
"state",
|
||||
"getChildContext",
|
||||
"componentWillMount",
|
||||
"componentDidMount",
|
||||
"componentWillReceiveProps",
|
||||
"shouldComponentUpdate",
|
||||
"componentWillUpdate",
|
||||
"componentDidUpdate",
|
||||
"componentWillUnmount",
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
// Disallow using variables outside the blocks they are defined (especially
|
||||
// since only let and const are used, see "no-var").
|
||||
"block-scoped-var": "error",
|
||||
// Require camel case names
|
||||
"camelcase": ["error", { "properties": "never" }],
|
||||
camelcase: ["error", { properties: "never" }],
|
||||
// Warn about cyclomatic complexity in functions.
|
||||
// 20 is ESLint's default, and we want to keep it this way to prevent new highly
|
||||
// complex functions from being introduced. However, because Mozilla's eslintrc has
|
||||
// some other value defined, we need to override it here. See bug 1553449 for more
|
||||
// information on complex DevTools functions that are currently excluded.
|
||||
"complexity": ["error", 20],
|
||||
complexity: ["error", 20],
|
||||
// Don't warn for inconsistent naming when capturing this (not so important
|
||||
// with auto-binding fat arrow functions).
|
||||
"consistent-this": "off",
|
||||
@ -224,7 +223,7 @@ module.exports = {
|
||||
"default-case": "off",
|
||||
// Allow using == instead of ===, in the interest of landing something since
|
||||
// the devtools codebase is split on convention here.
|
||||
"eqeqeq": "off",
|
||||
eqeqeq: "off",
|
||||
// Don't require function expressions to have a name.
|
||||
// This makes the code more verbose and hard to read. Our engine already
|
||||
// does a fantastic job assigning a name to the function, which includes
|
||||
@ -245,7 +244,7 @@ module.exports = {
|
||||
// Require a capital letter for constructors, only check if all new
|
||||
// operators are followed by a capital letter. Don't warn when capitalized
|
||||
// functions are used without the new operator.
|
||||
"new-cap": ["error", {"capIsNew": false}],
|
||||
"new-cap": ["error", { capIsNew: false }],
|
||||
// Allow use of bitwise operators.
|
||||
"no-bitwise": "off",
|
||||
// Allow using the console API.
|
||||
@ -291,10 +290,13 @@ module.exports = {
|
||||
// Don't restrict usage of specified node modules (not a node environment).
|
||||
"no-restricted-modules": "off",
|
||||
// Prevent using some properties
|
||||
"no-restricted-properties": ["error", {
|
||||
"property": "setupInParent",
|
||||
"message": "avoid child/parent communication with setupInParent"
|
||||
}],
|
||||
"no-restricted-properties": [
|
||||
"error",
|
||||
{
|
||||
property: "setupInParent",
|
||||
message: "avoid child/parent communication with setupInParent",
|
||||
},
|
||||
],
|
||||
// Disallow use of assignment in return statement. It is preferable for a
|
||||
// single line of code to have only one easily predictable effect.
|
||||
"no-return-assign": "error",
|
||||
@ -316,7 +318,7 @@ module.exports = {
|
||||
"no-undefined": "off",
|
||||
// Disallow global and local variables that aren't used, but allow unused
|
||||
// function arguments.
|
||||
"no-unused-vars": ["error", {"args": "none", "vars": "all"}],
|
||||
"no-unused-vars": ["error", { args: "none", vars: "all" }],
|
||||
// Allow using variables before they are defined.
|
||||
"no-use-before-define": "off",
|
||||
// We use var-only-at-top-level instead of no-var as we allow top level
|
||||
@ -331,14 +333,14 @@ module.exports = {
|
||||
// Allow more than one variable declaration per function.
|
||||
"one-var": "off",
|
||||
// Enforce using `let` only when variables are reassigned.
|
||||
"prefer-const": ["error", { "destructuring": "all" }],
|
||||
"prefer-const": ["error", { destructuring: "all" }],
|
||||
// Require use of the second argument for parseInt().
|
||||
"radix": "error",
|
||||
radix: "error",
|
||||
// Don't require to sort variables within the same declaration block.
|
||||
// Anyway, one-var is disabled.
|
||||
"sort-vars": "off",
|
||||
// Require "use strict" to be defined globally in the script.
|
||||
"strict": ["error", "global"],
|
||||
strict: ["error", "global"],
|
||||
// Warn about invalid JSDoc comments.
|
||||
// Disabled for now because of https://github.com/eslint/eslint/issues/2270
|
||||
// The rule fails on some jsdoc comments like in:
|
||||
@ -347,7 +349,7 @@ module.exports = {
|
||||
// Allow vars to be declared anywhere in the scope.
|
||||
"vars-on-top": "off",
|
||||
// Disallow Yoda conditions (where literal value comes first).
|
||||
"yoda": "error",
|
||||
yoda: "error",
|
||||
|
||||
// And these are the rules that haven't been discussed so far, and that are
|
||||
// disabled for now until we introduce them, one at a time.
|
||||
@ -398,5 +400,5 @@ module.exports = {
|
||||
// require assignment operator shorthand where possible or prohibit it
|
||||
// entirely
|
||||
"operator-assignment": "off",
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": { "browser": true },
|
||||
"globals": {
|
||||
"define": true,
|
||||
env: { browser: true },
|
||||
globals: {
|
||||
define: true,
|
||||
},
|
||||
"rules": {
|
||||
rules: {
|
||||
// See bug 1288147, the devtools front-end wants to be able to run in
|
||||
// content privileged windows, where ownerGlobal doesn't exist.
|
||||
"mozilla/use-ownerGlobal": "off",
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -6,5 +6,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"jest": true,
|
||||
env: {
|
||||
jest: true,
|
||||
},
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell.js"
|
||||
extends: "../../../../.eslintrc.xpcshell.js",
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -5,7 +5,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"jest": true,
|
||||
env: {
|
||||
jest: true,
|
||||
},
|
||||
};
|
||||
|
@ -6,5 +6,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"jest": true,
|
||||
env: {
|
||||
jest: true,
|
||||
},
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell.js"
|
||||
extends: "../../../../.eslintrc.xpcshell.js",
|
||||
};
|
||||
|
@ -1,64 +1,68 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
module.exports = {
|
||||
"parser": "babel-eslint",
|
||||
"plugins": [
|
||||
parser: "babel-eslint",
|
||||
plugins: [
|
||||
"react",
|
||||
"mozilla",
|
||||
"flowtype",
|
||||
"babel",
|
||||
"prettier",
|
||||
"import",
|
||||
"file-header"
|
||||
"file-header",
|
||||
],
|
||||
"globals": {
|
||||
"atob": true,
|
||||
"btoa": true,
|
||||
"Cc": true,
|
||||
"Ci": true,
|
||||
"Components": true,
|
||||
"console": true,
|
||||
"Cr": true,
|
||||
"Cu": true,
|
||||
"devtools": true,
|
||||
"dump": true,
|
||||
"EventEmitter": true,
|
||||
"isWorker": true,
|
||||
"loader": true,
|
||||
"reportError": true,
|
||||
"Services": true,
|
||||
"Task": true,
|
||||
"XPCNativeWrapper": true,
|
||||
"XPCOMUtils": true,
|
||||
"_Iterator": true,
|
||||
"__dirname": true,
|
||||
"process": true,
|
||||
"global": true,
|
||||
"L10N": true
|
||||
globals: {
|
||||
atob: true,
|
||||
btoa: true,
|
||||
Cc: true,
|
||||
Ci: true,
|
||||
Components: true,
|
||||
console: true,
|
||||
Cr: true,
|
||||
Cu: true,
|
||||
devtools: true,
|
||||
dump: true,
|
||||
EventEmitter: true,
|
||||
isWorker: true,
|
||||
loader: true,
|
||||
reportError: true,
|
||||
Services: true,
|
||||
Task: true,
|
||||
XPCNativeWrapper: true,
|
||||
XPCOMUtils: true,
|
||||
_Iterator: true,
|
||||
__dirname: true,
|
||||
process: true,
|
||||
global: true,
|
||||
L10N: true,
|
||||
},
|
||||
"extends": [
|
||||
extends: [
|
||||
"prettier",
|
||||
"prettier/flowtype",
|
||||
"prettier/react",
|
||||
"plugin:jest/recommended"
|
||||
"plugin:jest/recommended",
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2016,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": { "jsx": true },
|
||||
parserOptions: {
|
||||
ecmaVersion: 2016,
|
||||
sourceType: "module",
|
||||
ecmaFeatures: { jsx: true },
|
||||
|
||||
// When the linter runs from the MC root, it won't pick up this project's
|
||||
// babel.config.js, so we explicitly set Babel's root location so that
|
||||
// it knows where to look.
|
||||
"babelOptions": {
|
||||
"root": __dirname,
|
||||
babelOptions: {
|
||||
root: __dirname,
|
||||
},
|
||||
},
|
||||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"jest": true
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
commonjs: true,
|
||||
jest: true,
|
||||
},
|
||||
"rules": {
|
||||
rules: {
|
||||
// These are the rules that have been configured so far to match the
|
||||
// devtools coding style.
|
||||
|
||||
@ -81,8 +85,8 @@ module.exports = {
|
||||
"react/sort-comp": [
|
||||
1,
|
||||
{
|
||||
order: ["propTypes", "everything-else", "render"]
|
||||
}
|
||||
order: ["propTypes", "everything-else", "render"],
|
||||
},
|
||||
],
|
||||
|
||||
// Check for import errors.
|
||||
@ -100,9 +104,9 @@ module.exports = {
|
||||
// since only let and const are used, see "no-var").
|
||||
"block-scoped-var": 2,
|
||||
// Require camel case names
|
||||
"camelcase": ["error", { "properties": "never" }],
|
||||
camelcase: ["error", { properties: "never" }],
|
||||
// Warn about cyclomatic complexity in functions.
|
||||
"complexity": ["error", { "max": 22 }],
|
||||
complexity: ["error", { max: 22 }],
|
||||
// Don't warn for inconsistent naming when capturing this (not so important
|
||||
// with auto-binding fat arrow functions).
|
||||
"consistent-this": 0,
|
||||
@ -113,7 +117,7 @@ module.exports = {
|
||||
"dot-notation": 2,
|
||||
// Allow using == instead of ===, in the interest of landing something since
|
||||
// the devtools codebase is split on convention here.
|
||||
"eqeqeq": 0,
|
||||
eqeqeq: 0,
|
||||
// Don't require function expressions to have a name.
|
||||
// This makes the code more verbose and hard to read. Our engine already
|
||||
// does a fantastic job assigning a name to the function, which includes
|
||||
@ -139,7 +143,7 @@ module.exports = {
|
||||
// Require a capital letter for constructors, only check if all new
|
||||
// operators are followed by a capital letter. Don't warn when capitalized
|
||||
// functions are used without the new operator.
|
||||
"new-cap": [2, { "capIsNew": false }],
|
||||
"new-cap": [2, { capIsNew: false }],
|
||||
// Disallow use of the Array constructor.
|
||||
"no-array-constructor": 2,
|
||||
// Allow use of bitwise operators.
|
||||
@ -211,9 +215,9 @@ module.exports = {
|
||||
"prefer-const": [
|
||||
"error",
|
||||
{
|
||||
"destructuring": "all",
|
||||
"ignoreReadBeforeAssign": false
|
||||
}
|
||||
destructuring: "all",
|
||||
ignoreReadBeforeAssign: false,
|
||||
},
|
||||
],
|
||||
// Disallow reassignments of native objects.
|
||||
"no-native-reassign": 2,
|
||||
@ -283,7 +287,7 @@ module.exports = {
|
||||
// statement.
|
||||
"no-unreachable": 2,
|
||||
// Disallow global and local variables that arent used, but allow unused function arguments.
|
||||
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
|
||||
"no-unused-vars": [2, { vars: "all", args: "none" }],
|
||||
// Allow using variables before they are defined.
|
||||
"no-use-before-define": 0,
|
||||
// We use var-only-at-top-level instead of no-var as we allow top level
|
||||
@ -300,12 +304,12 @@ module.exports = {
|
||||
// Allow more than one variable declaration per function.
|
||||
"one-var": 0,
|
||||
// Require use of the second argument for parseInt().
|
||||
"radix": 2,
|
||||
radix: 2,
|
||||
// Dont require to sort variables within the same declaration block.
|
||||
// Anyway, one-var is disabled.
|
||||
"sort-vars": 0,
|
||||
// Require "use strict" to be defined globally in the script.
|
||||
"strict": [2, "global"],
|
||||
strict: [2, "global"],
|
||||
// Disallow comparisons with the value NaN.
|
||||
"use-isnan": 2,
|
||||
// Warn about invalid JSDoc comments.
|
||||
@ -318,7 +322,7 @@ module.exports = {
|
||||
// Allow vars to be declared anywhere in the scope.
|
||||
"vars-on-top": 0,
|
||||
// Disallow Yoda conditions (where literal value comes first).
|
||||
"yoda": 2,
|
||||
yoda: 2,
|
||||
|
||||
// And these are the rules that haven't been discussed so far, and that are
|
||||
// disabled for now until we introduce them, one at a time.
|
||||
@ -382,12 +386,11 @@ module.exports = {
|
||||
[
|
||||
"This Source Code Form is subject to the terms of the Mozilla Public",
|
||||
"License, v. 2.0. If a copy of the MPL was not distributed with this",
|
||||
"file, You can obtain one at <http://mozilla.org/MPL/2.0/>."
|
||||
"file, You can obtain one at <http://mozilla.org/MPL/2.0/>.",
|
||||
],
|
||||
"block",
|
||||
["-\\*-(.*)-\\*-", "eslint(.*)", "vim(.*)"]
|
||||
["-\\*-(.*)-\\*-", "eslint(.*)", "vim(.*)"],
|
||||
],
|
||||
"consistent-return": "off",
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"globals": {
|
||||
"XMLHttpRequest": true,
|
||||
"window": true,
|
||||
"define": true,
|
||||
"addEventListener": true,
|
||||
"document": true,
|
||||
"dispatchEvent": true,
|
||||
"MessageEvent": true
|
||||
}
|
||||
globals: {
|
||||
XMLHttpRequest: true,
|
||||
window: true,
|
||||
define: true,
|
||||
addEventListener: true,
|
||||
document: true,
|
||||
dispatchEvent: true,
|
||||
MessageEvent: true,
|
||||
},
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../.eslintrc.mochitests.js",
|
||||
extends: "../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"env": {
|
||||
"jest": true,
|
||||
env: {
|
||||
jest: true,
|
||||
},
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.xpcshell.js"
|
||||
extends: "../../../../.eslintrc.xpcshell.js",
|
||||
};
|
||||
|
@ -2,14 +2,16 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the devtools eslintrc.
|
||||
"extends": "../../.eslintrc.js",
|
||||
extends: "../../.eslintrc.js",
|
||||
|
||||
"rules": {
|
||||
rules: {
|
||||
// The inspector is being migrated to HTML and cleaned of
|
||||
// chrome-privileged code, so this rule disallows requiring chrome
|
||||
// code. Some files in the inspector disable this rule still. The
|
||||
// goal is to enable the rule globally on all files.
|
||||
"mozilla/reject-some-requires": ["error",
|
||||
"^(chrome|chrome:.*|resource:.*|devtools/server/.*|.*\\.jsm|devtools/shared/platform/(chome|content)/.*)$"],
|
||||
"mozilla/reject-some-requires": [
|
||||
"error",
|
||||
"^(chrome|chrome:.*|resource:.*|devtools/server/.*|.*\\.jsm|devtools/shared/platform/(chome|content)/.*)$",
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js"
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the shared list of defined globals for mochitests.
|
||||
"extends": "../../../../.eslintrc.mochitests.js",
|
||||
extends: "../../../../.eslintrc.mochitests.js",
|
||||
};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
module.exports = {
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../../.eslintrc.xpcshell.js"
|
||||
extends: "../../../../../.eslintrc.xpcshell.js",
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user