2017-03-22 10:36:06 +03:00
|
|
|
module.exports = {
|
2016-02-01 17:05:16 +03:00
|
|
|
// When adding items to this file please check for effects on sub-directories.
|
2018-11-27 01:56:41 +03:00
|
|
|
"parser": "babel-eslint",
|
2016-02-27 01:45:00 +03:00
|
|
|
"parserOptions": {
|
2018-11-27 01:56:41 +03:00
|
|
|
"ecmaVersion": 2018,
|
2016-02-27 01:45:00 +03:00
|
|
|
"ecmaFeatures": {
|
|
|
|
"jsx": true
|
2017-12-06 23:32:28 +03:00
|
|
|
},
|
|
|
|
"sourceType": "module"
|
2016-02-27 01:45:00 +03:00
|
|
|
},
|
|
|
|
"env": {
|
2017-12-19 23:31:12 +03:00
|
|
|
"node": true
|
2016-02-27 01:45:00 +03:00
|
|
|
},
|
2016-02-01 17:05:16 +03:00
|
|
|
"plugins": [
|
2017-12-19 23:31:23 +03:00
|
|
|
"import", // require("eslint-plugin-import")
|
2019-02-27 01:20:53 +03:00
|
|
|
"react", // require("eslint-plugin-react")
|
2019-06-10 21:11:23 +03:00
|
|
|
"jsx-a11y", // require("eslint-plugin-jsx-a11y")
|
2019-05-29 21:30:54 +03:00
|
|
|
// Temporarily disabled since they aren't vendored into in mozilla central yet
|
|
|
|
// "react-hooks", // require("react-hooks")
|
2016-02-01 17:05:16 +03:00
|
|
|
],
|
2018-11-27 01:56:41 +03:00
|
|
|
"settings": {
|
|
|
|
"react": {
|
|
|
|
"version": "16.2.0"
|
|
|
|
}
|
|
|
|
},
|
2016-02-10 00:55:12 +03:00
|
|
|
"extends": [
|
2017-04-19 19:24:11 +03:00
|
|
|
"eslint:recommended",
|
2019-05-29 21:30:54 +03:00
|
|
|
"plugin:jsx-a11y/recommended", // require("eslint-plugin-jsx-a11y")
|
2019-09-09 21:15:53 +03:00
|
|
|
"plugin:mozilla/recommended", // require("eslint-plugin-mozilla") require("eslint-plugin-fetch-options") require("eslint-plugin-html") require("eslint-plugin-no-unsanitized")
|
2019-03-29 14:17:51 +03:00
|
|
|
"plugin:mozilla/browser-test",
|
|
|
|
"plugin:mozilla/mochitest-test",
|
2019-05-29 20:25:03 +03:00
|
|
|
"plugin:mozilla/xpcshell-test",
|
2019-06-26 05:53:38 +03:00
|
|
|
"plugin:prettier/recommended", // require("eslint-plugin-prettier")
|
|
|
|
"prettier/react", // require("eslint-config-prettier")
|
2016-02-10 00:55:12 +03:00
|
|
|
],
|
2018-06-28 21:20:18 +03:00
|
|
|
"globals": {
|
|
|
|
// Remove this when m-c updates their eslint: See https://github.com/mozilla/activity-stream/pull/4219
|
2019-03-20 21:04:32 +03:00
|
|
|
"RPMSendAsyncMessage": true,
|
|
|
|
"NewTabPagePreloading": true,
|
2018-06-28 21:20:18 +03:00
|
|
|
},
|
2019-05-29 21:30:54 +03:00
|
|
|
"overrides": [
|
|
|
|
{
|
|
|
|
// These files use fluent-dom to insert content
|
|
|
|
"files": [
|
|
|
|
"content-src/asrouter/templates/OnboardingMessage/**",
|
2019-07-08 19:53:16 +03:00
|
|
|
"content-src/asrouter/templates/FirstRun/**",
|
2019-05-29 21:30:54 +03:00
|
|
|
"content-src/asrouter/templates/Trailhead/**",
|
2019-10-11 00:52:55 +03:00
|
|
|
"content-src/asrouter/templates/FullPageInterrupt/FullPageInterrupt.jsx",
|
|
|
|
"content-src/asrouter/components/FxASignupForm/FxASignupForm.jsx",
|
2019-06-07 02:49:35 +03:00
|
|
|
"content-src/components/TopSites/**",
|
2019-06-25 03:08:53 +03:00
|
|
|
"content-src/components/MoreRecommendations/MoreRecommendations.jsx",
|
2019-07-15 21:32:03 +03:00
|
|
|
"content-src/components/CollapsibleSection/CollapsibleSection.jsx",
|
2019-10-02 23:07:43 +03:00
|
|
|
"content-src/components/DiscoveryStreamComponents/DSEmptyState/DSEmptyState.jsx",
|
|
|
|
"content-src/components/DiscoveryStreamComponents/DSPrivacyModal/DSPrivacyModal.jsx"
|
2019-05-29 21:30:54 +03:00
|
|
|
],
|
|
|
|
"rules": {
|
|
|
|
"jsx-a11y/anchor-has-content": 0,
|
|
|
|
"jsx-a11y/heading-has-content": 0,
|
|
|
|
}
|
2018-03-01 22:08:44 +03:00
|
|
|
},
|
2019-05-29 21:30:54 +03:00
|
|
|
{
|
|
|
|
// Use a configuration that's more appropriate for JSMs
|
|
|
|
"files": "**/*.jsm",
|
|
|
|
"parserOptions": {
|
|
|
|
"sourceType": "script"
|
|
|
|
},
|
|
|
|
"env": {
|
|
|
|
"node": false
|
|
|
|
},
|
|
|
|
"rules": {
|
|
|
|
"no-implicit-globals": 0
|
|
|
|
}
|
2018-03-01 22:08:44 +03:00
|
|
|
}
|
2019-05-29 21:30:54 +03:00
|
|
|
],
|
2016-02-01 17:05:16 +03:00
|
|
|
"rules": {
|
2019-05-29 21:30:54 +03:00
|
|
|
// "react-hooks/rules-of-hooks": 2,
|
2019-04-02 18:22:19 +03:00
|
|
|
|
2019-06-10 21:11:23 +03:00
|
|
|
"fetch-options/no-fetch-credentials": 2,
|
2016-10-31 19:56:05 +03:00
|
|
|
|
2016-08-04 23:43:27 +03:00
|
|
|
"react/jsx-boolean-value": [2, "always"],
|
2016-08-09 22:01:29 +03:00
|
|
|
"react/jsx-key": 2,
|
2019-07-15 21:38:21 +03:00
|
|
|
"react/jsx-no-bind": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"react/jsx-no-comment-textnodes": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"react/jsx-no-duplicate-props": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"react/jsx-no-target-blank": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"react/jsx-no-undef": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"react/jsx-pascal-case": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"react/jsx-uses-react": 2,
|
|
|
|
"react/jsx-uses-vars": 2,
|
2018-01-19 20:41:31 +03:00
|
|
|
"react/no-access-state-in-setstate": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"react/no-danger": 2,
|
|
|
|
"react/no-deprecated": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"react/no-did-mount-set-state": 2,
|
2016-08-05 09:48:48 +03:00
|
|
|
"react/no-did-update-set-state": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"react/no-direct-mutation-state": 2,
|
|
|
|
"react/no-is-mounted": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"react/no-unknown-property": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"react/require-render-return": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
|
|
|
|
"accessor-pairs": [2, {"setWithoutGet": true, "getWithoutSet": false}],
|
|
|
|
"array-callback-return": 2,
|
|
|
|
"block-scoped-var": 2,
|
2016-08-10 10:49:37 +03:00
|
|
|
"callback-return": 0,
|
2016-02-27 01:45:00 +03:00
|
|
|
"camelcase": 0,
|
2018-01-19 22:56:41 +03:00
|
|
|
"capitalized-comments": 0,
|
|
|
|
"class-methods-use-this": 0,
|
2016-08-04 20:31:27 +03:00
|
|
|
"consistent-this": [2, "use-bind"],
|
2016-02-27 01:45:00 +03:00
|
|
|
"default-case": 0,
|
2016-03-24 01:32:32 +03:00
|
|
|
"eqeqeq": 2,
|
2018-01-19 22:20:07 +03:00
|
|
|
"for-direction": 2,
|
2018-01-19 03:23:16 +03:00
|
|
|
"func-name-matching": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"func-names": 0,
|
|
|
|
"func-style": 0,
|
2018-01-19 22:20:07 +03:00
|
|
|
"getter-return": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"global-require": 0,
|
2016-08-10 07:23:57 +03:00
|
|
|
"guard-for-in": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"handle-callback-err": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"id-blacklist": 0,
|
|
|
|
"id-length": 0,
|
|
|
|
"id-match": 0,
|
|
|
|
"init-declarations": 0,
|
2018-01-19 22:56:41 +03:00
|
|
|
"line-comment-position": 0,
|
2018-01-19 03:28:26 +03:00
|
|
|
"lines-between-class-members": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"max-depth": [2, 4],
|
2016-08-10 04:44:12 +03:00
|
|
|
"max-lines": 0,
|
2016-08-09 22:01:29 +03:00
|
|
|
"max-nested-callbacks": [2, 4],
|
2016-08-10 01:41:12 +03:00
|
|
|
"max-params": [2, 6],
|
2016-08-10 11:22:02 +03:00
|
|
|
"max-statements": [2, 50],
|
2016-08-10 04:40:49 +03:00
|
|
|
"max-statements-per-line": [2, {"max": 2}],
|
2018-01-19 22:56:41 +03:00
|
|
|
"multiline-comment-style": 0,
|
2016-08-10 01:43:59 +03:00
|
|
|
"new-cap": [2, {"newIsCap": true, "capIsNew": false}],
|
2016-02-27 01:45:00 +03:00
|
|
|
"newline-after-var": 0,
|
2016-08-10 01:44:53 +03:00
|
|
|
"newline-before-return": 0,
|
2016-08-10 10:56:25 +03:00
|
|
|
"no-alert": 2,
|
2018-01-19 22:56:41 +03:00
|
|
|
"no-await-in-loop": 0,
|
2016-02-27 01:45:00 +03:00
|
|
|
"no-bitwise": 0,
|
2018-01-19 22:20:07 +03:00
|
|
|
"no-buffer-constructor": 2,
|
2016-08-05 02:37:44 +03:00
|
|
|
"no-catch-shadow": 2,
|
2016-02-10 00:55:12 +03:00
|
|
|
"no-console": 1,
|
2016-08-10 10:54:55 +03:00
|
|
|
"no-continue": 0,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-div-regex": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"no-duplicate-imports": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"no-empty-function": 0,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-eq-null": 2,
|
|
|
|
"no-extend-native": 2,
|
|
|
|
"no-extra-label": 2,
|
2016-08-10 10:16:13 +03:00
|
|
|
"no-implicit-coercion": [2, {"allow": ["!!"]}],
|
2016-08-09 22:01:29 +03:00
|
|
|
"no-implicit-globals": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"no-inline-comments": 0,
|
|
|
|
"no-invalid-this": 0,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-label-var": 2,
|
|
|
|
"no-loop-func": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"no-magic-numbers": 0,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-mixed-requires": 2,
|
2018-01-19 03:49:39 +03:00
|
|
|
"no-multi-assign": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-multi-str": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"no-negated-condition": 0,
|
2016-08-09 22:01:29 +03:00
|
|
|
"no-negated-in-lhs": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-new": 2,
|
|
|
|
"no-new-func": 2,
|
|
|
|
"no-new-require": 2,
|
|
|
|
"no-octal-escape": 2,
|
2016-08-10 07:15:26 +03:00
|
|
|
"no-param-reassign": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-path-concat": 2,
|
2016-08-10 02:37:18 +03:00
|
|
|
"no-plusplus": 0,
|
2016-08-10 10:52:01 +03:00
|
|
|
"no-process-env": 0,
|
2016-08-09 22:01:29 +03:00
|
|
|
"no-process-exit": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-proto": 2,
|
2016-08-10 11:02:03 +03:00
|
|
|
"no-prototype-builtins": 2,
|
2018-01-19 22:56:41 +03:00
|
|
|
"no-restricted-globals": 0,
|
|
|
|
"no-restricted-imports": 0,
|
|
|
|
"no-restricted-modules": 0,
|
|
|
|
"no-restricted-properties": 0,
|
|
|
|
"no-restricted-syntax": 0,
|
2016-08-05 02:53:45 +03:00
|
|
|
"no-return-assign": [2, "except-parens"],
|
2016-08-05 00:09:49 +03:00
|
|
|
"no-script-url": 2,
|
2017-03-22 11:32:42 +03:00
|
|
|
"no-shadow": 2,
|
2017-10-21 00:50:41 +03:00
|
|
|
"no-sync": 0,
|
2016-11-10 02:51:47 +03:00
|
|
|
"no-template-curly-in-string": 2,
|
2016-08-10 02:37:58 +03:00
|
|
|
"no-ternary": 0,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-undef-init": 2,
|
2016-08-10 01:56:32 +03:00
|
|
|
"no-undefined": 0,
|
2016-02-27 01:45:00 +03:00
|
|
|
"no-underscore-dangle": 0,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-unmodified-loop-condition": 2,
|
2016-08-10 10:59:16 +03:00
|
|
|
"no-unused-expressions": 2,
|
2016-08-10 07:02:35 +03:00
|
|
|
"no-use-before-define": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"no-useless-computed-key": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-useless-constructor": 2,
|
2016-08-09 22:01:29 +03:00
|
|
|
"no-useless-rename": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"no-var": 2,
|
|
|
|
"no-void": 2,
|
2016-03-11 01:38:17 +03:00
|
|
|
"no-warning-comments": 0, // TODO: Change to `1`?
|
2016-08-05 01:49:02 +03:00
|
|
|
"one-var": [2, "never"],
|
2016-08-04 20:31:27 +03:00
|
|
|
"operator-assignment": [2, "always"],
|
2018-01-19 22:56:41 +03:00
|
|
|
"padding-line-between-statements": 0,
|
2016-03-11 01:38:17 +03:00
|
|
|
"prefer-const": 0, // TODO: Change to `1`?
|
2018-01-19 21:47:22 +03:00
|
|
|
"prefer-destructuring": [2, {"AssignmentExpression": {"array": true}, "VariableDeclarator": {"array": true, "object": true}}],
|
2018-01-19 22:20:07 +03:00
|
|
|
"prefer-numeric-literals": 2,
|
2018-01-19 21:55:58 +03:00
|
|
|
"prefer-promise-reject-errors": 2,
|
2016-02-27 01:45:00 +03:00
|
|
|
"prefer-reflect": 0,
|
2016-08-10 10:43:27 +03:00
|
|
|
"prefer-rest-params": 2,
|
2016-08-10 10:15:43 +03:00
|
|
|
"prefer-spread": 2,
|
2016-08-10 03:43:07 +03:00
|
|
|
"prefer-template": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"radix": [2, "always"],
|
2018-01-19 22:11:16 +03:00
|
|
|
"require-await": 2,
|
2016-08-10 01:45:32 +03:00
|
|
|
"require-jsdoc": 0,
|
2018-01-19 22:56:41 +03:00
|
|
|
"sort-keys": 0,
|
2016-08-09 22:01:29 +03:00
|
|
|
"sort-vars": 2,
|
2016-08-04 20:31:27 +03:00
|
|
|
"strict": 0,
|
2018-01-19 22:20:07 +03:00
|
|
|
"symbol-description": 2,
|
2016-08-05 01:49:02 +03:00
|
|
|
"valid-jsdoc": [0, {"requireReturn": false, "requireParamDescription": false, "requireReturnDescription": false}],
|
2016-08-09 22:01:29 +03:00
|
|
|
"vars-on-top": 2,
|
2016-08-05 01:49:02 +03:00
|
|
|
"yoda": [2, "never"]
|
2016-02-01 21:20:30 +03:00
|
|
|
}
|
2017-03-22 10:36:06 +03:00
|
|
|
};
|