Bug 1944416: Restore individual tabs from closed groups in closed windows r=dao,sessi...
[gecko.git] / browser / components / aboutwelcome / .eslintrc.js
blob78ea8667000343e490e03dbbdeec36b70bfbaa51
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/. */
5 module.exports = {
6 // When adding items to this file please check for effects on sub-directories.
7 plugins: ["import", "react", "jsx-a11y"],
8 settings: {
9 react: {
10 version: "16.2.0",
13 extends: ["plugin:jsx-a11y/recommended"],
14 overrides: [
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"],
19 parserOptions: {
20 sourceType: "module",
24 // These files use fluent-dom to insert content
25 files: [
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",
33 rules: {
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/**"],
42 env: {
43 node: true,
47 // Use a configuration that's appropriate for modules, workers and
48 // non-production files.
49 files: ["tests/**"],
50 rules: {
51 "no-implicit-globals": "off",
55 files: ["content-src/**", "tests/unit/**"],
56 rules: {
57 // Disallow commonjs in these directories.
58 "import/no-commonjs": 2,
62 // These tests simulate the browser environment.
63 files: "tests/unit/**",
64 env: {
65 browser: true,
66 mocha: true,
68 globals: {
69 assert: true,
70 chai: true,
71 sinon: true,
75 files: "tests/**",
76 rules: {
77 "func-name-matching": 0,
78 "lines-between-class-members": 0,
82 rules: {
83 "react/jsx-boolean-value": ["error", "always"],
84 "react/jsx-key": "error",
85 "react/jsx-no-bind": [
86 "error",
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": [
104 "error",
106 // Custom HTML attributes used in aboutwelcome React components.
107 ignore: [
108 "flow",
109 "alignment",
110 "button-size",
111 "layout",
112 "pos",
113 "hide-secondary-section",
114 "reverse-split",
115 "no-rdm",
116 "above-button",
117 "fullscreen",
118 "narrow",
119 "srcset",
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"],
129 eqeqeq: "error",
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 }],
136 "no-alert": "error",
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",
147 "no-new": "error",
148 "no-new-func": "error",
149 "no-octal-escape": "error",
150 "no-param-reassign": "error",
151 "no-proto": "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",
163 "no-var": "error",
164 "no-void": ["error", { allowAsStatement: true }],
165 "one-var": ["error", "never"],
166 "operator-assignment": ["error", "always"],
167 "prefer-destructuring": [
168 "error",
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"],