1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // When adding items to this file please check for effects on sub-directories.
7 plugins
: ["import", "react", "jsx-a11y"],
13 extends: ["plugin:jsx-a11y/recommended"],
16 // TODO: Bug 1773467 - Move these to .mjs or figure out a generic way
17 // to identify these as modules.
18 files
: ["tests/unit/**/*.js"],
24 // These files use fluent-dom to insert content
26 "content-src/components/Zap.jsx",
27 "content-src/components/MultiStageAboutWelcome.jsx",
28 "content-src/components/MultiStageScreen.jsx",
29 "content-src/components/MultiStageProtonScreen.jsx",
30 "content-src/components/MultiSelect.jsx",
31 "content-src/components/ReturnToAMO.jsx",
34 "jsx-a11y/anchor-has-content": "off",
35 "jsx-a11y/heading-has-content": "off",
36 "jsx-a11y/label-has-associated-control": "off",
37 "jsx-a11y/no-onchange": "off",
41 files
: ["content-src/**", "tests/unit/**"],
47 // Use a configuration that's appropriate for modules, workers and
48 // non-production files.
51 "no-implicit-globals": "off",
55 files
: ["content-src/**", "tests/unit/**"],
57 // Disallow commonjs in these directories.
58 "import/no-commonjs": 2,
62 // These tests simulate the browser environment.
63 files
: "tests/unit/**",
77 "func-name-matching": 0,
78 "lines-between-class-members": 0,
83 "react/jsx-boolean-value": ["error", "always"],
84 "react/jsx-key": "error",
85 "react/jsx-no-bind": [
87 { allowArrowFunctions
: true, allowFunctions
: true },
89 "react/jsx-no-comment-textnodes": "error",
90 "react/jsx-no-duplicate-props": "error",
91 "react/jsx-no-target-blank": "error",
92 "react/jsx-no-undef": "error",
93 "react/jsx-pascal-case": "error",
94 "react/jsx-uses-react": "error",
95 "react/jsx-uses-vars": "error",
96 "react/no-access-state-in-setstate": "error",
97 "react/no-danger": "error",
98 "react/no-deprecated": "error",
99 "react/no-did-mount-set-state": "error",
100 "react/no-did-update-set-state": "error",
101 "react/no-direct-mutation-state": "error",
102 "react/no-is-mounted": "error",
103 "react/no-unknown-property": [
106 // Custom HTML attributes used in aboutwelcome React components.
113 "hide-secondary-section",
123 "react/require-render-return": "error",
125 "accessor-pairs": ["error", { setWithoutGet
: true, getWithoutSet
: false }],
126 "array-callback-return": "error",
127 "block-scoped-var": "error",
128 "consistent-this": ["error", "use-bind"],
130 "func-name-matching": "error",
131 "guard-for-in": "error",
132 "max-nested-callbacks": ["error", 4],
133 "max-params": ["error", 6],
134 "max-statements": ["error", 50],
135 "new-cap": ["error", { newIsCap
: true, capIsNew
: false }],
137 "no-div-regex": "error",
138 "no-duplicate-imports": "error",
139 "no-eq-null": "error",
140 "no-extend-native": "error",
141 "no-extra-label": "error",
142 "no-implicit-coercion": ["error", { allow
: ["!!"] }],
143 "no-implicit-globals": "error",
144 "no-loop-func": "error",
145 "no-multi-assign": "error",
146 "no-multi-str": "error",
148 "no-new-func": "error",
149 "no-octal-escape": "error",
150 "no-param-reassign": "error",
152 "no-prototype-builtins": "error",
153 "no-return-assign": ["error", "except-parens"],
154 "no-script-url": "error",
155 "no-template-curly-in-string": "error",
156 "no-undef-init": "error",
157 "no-unmodified-loop-condition": "error",
158 "no-unused-expressions": "error",
159 "no-use-before-define": "error",
160 "no-useless-computed-key": "error",
161 "no-useless-constructor": "error",
162 "no-useless-rename": "error",
164 "no-void": ["error", { allowAsStatement
: true }],
165 "one-var": ["error", "never"],
166 "operator-assignment": ["error", "always"],
167 "prefer-destructuring": [
170 AssignmentExpression
: { array
: true },
171 VariableDeclarator
: { array
: true, object
: true },
174 "prefer-numeric-literals": "error",
175 "prefer-promise-reject-errors": "error",
176 "prefer-rest-params": "error",
177 "prefer-spread": "error",
178 "prefer-template": "error",
179 radix
: ["error", "always"],
180 "sort-vars": "error",
181 "symbol-description": "error",
182 "vars-on-top": "error",
183 yoda
: ["error", "never"],