Bug 1630268 Part 1: Rename devtools/client/inspector/rules/test/browser.ini. r=ochameau
[gecko.git] / .eslintrc.js
blob1ea481920c75efd70cfc42126288bfd830c24bc2
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 "use strict";
7 const xpcshellTestConfig = require("eslint-plugin-mozilla/lib/configs/xpcshell-test.js");
8 const browserTestConfig = require("eslint-plugin-mozilla/lib/configs/browser-test.js");
9 const mochitestTestConfig = require("eslint-plugin-mozilla/lib/configs/mochitest-test.js");
10 const chromeTestConfig = require("eslint-plugin-mozilla/lib/configs/chrome-test.js");
11 const fs = require("fs");
12 const path = require("path");
14 /**
15  * Some configurations have overrides, which can't be specified within overrides,
16  * so we need to remove them.
17  */
18 function removeOverrides(config) {
19   config = { ...config };
20   delete config.overrides;
21   return config;
24 const xpcshellTestPaths = ["**/test*/unit*/", "**/test*/xpcshell/"];
26 const browserTestPaths = ["**/test*/**/browser*/"];
28 const mochitestTestPaths = [
29   // Note: we do not want to match testing/mochitest as that would apply
30   // too many globals for that directory.
31   "**/test/mochitest/",
32   "**/tests/mochitest/",
33   "**/test/mochitests/",
34   "testing/mochitest/tests/SimpleTest/",
35   "testing/mochitest/tests/Harness_sanity/",
38 const chromeTestPaths = ["**/test*/chrome/"];
40 const ignorePatterns = [
41   ...fs
42     .readFileSync(
43       path.join(__dirname, "tools", "rewriting", "ThirdPartyPaths.txt")
44     )
45     .toString("utf-8")
46     .split("\n"),
47   ...fs
48     .readFileSync(
49       path.join(__dirname, "devtools", "client", "debugger", ".eslintignore")
50     )
51     .toString("utf-8")
52     .split("\n")
53     .filter(p => p && !p.startsWith("#"))
54     .map(p => `devtools/client/debugger/${p}`),
57 module.exports = {
58   parser: "babel-eslint",
59   parserOptions: {
60     sourceType: "script",
61     babelOptions: {
62       configFile: path.join(__dirname, ".babel-eslint.rc.js"),
63     },
64   },
65   ignorePatterns,
66   // Ignore eslint configurations in parent directories.
67   root: true,
68   // New rules and configurations should generally be added in
69   // tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js to
70   // allow external repositories that use the plugin to pick them up as well.
71   extends: ["plugin:mozilla/recommended"],
72   plugins: ["mozilla"],
73   overrides: [
74     {
75       // All .eslintrc.js files are in the node environment, so turn that
76       // on here.
77       // https://github.com/eslint/eslint/issues/13008
78       files: [".eslintrc.js"],
79       env: {
80         node: true,
81         browser: false,
82       },
83     },
84     {
85       files: [
86         "*.html",
87         "*.xhtml",
88         "*.xul",
89         "*.xml",
90         "js/src/builtin/**/*.js",
91         "js/src/shell/**/*.js",
92       ],
93       rules: {
94         // Curly brackets are required for all the tree via recommended.js,
95         // however these files aren't auto-fixable at the moment.
96         curly: "off",
97       },
98     },
99     {
100       // TODO: Bug 1515949. Enable no-undef for gfx/
101       files: "gfx/layers/apz/test/mochitest/**",
102       rules: {
103         "no-undef": "off",
104       },
105     },
106     {
107       ...removeOverrides(xpcshellTestConfig),
108       files: xpcshellTestPaths.map(path => `${path}**`),
109       excludedFiles: "devtools/**",
110     },
111     {
112       // If it is an xpcshell head file, we turn off global unused variable checks, as it
113       // would require searching the other test files to know if they are used or not.
114       // This would be expensive and slow, and it isn't worth it for head files.
115       // We could get developers to declare as exported, but that doesn't seem worth it.
116       files: xpcshellTestPaths.map(path => `${path}head*.js`),
117       rules: {
118         "no-unused-vars": [
119           "error",
120           {
121             args: "none",
122             vars: "local",
123           },
124         ],
125       },
126     },
127     {
128       ...browserTestConfig,
129       files: browserTestPaths.map(path => `${path}**`),
130       excludedFiles: "devtools/**",
131     },
132     {
133       ...removeOverrides(mochitestTestConfig),
134       files: mochitestTestPaths.map(path => `${path}**`),
135       excludedFiles: [
136         "devtools/**",
137         "security/manager/ssl/tests/mochitest/browser/**",
138       ],
139     },
140     {
141       ...removeOverrides(chromeTestConfig),
142       files: chromeTestPaths.map(path => `${path}**`),
143       excludedFiles: ["devtools/**"],
144     },
145     {
146       env: {
147         // Ideally we wouldn't be using the simpletest env here, but our uses of
148         // js files mean we pick up everything from the global scope, which could
149         // be any one of a number of html files. So we just allow the basics...
150         "mozilla/simpletest": true,
151       },
152       files: [
153         ...mochitestTestPaths.map(path => `${path}/**/*.js`),
154         ...chromeTestPaths.map(path => `${path}/**/*.js`),
155       ],
156     },
157     {
158       files: [
159         "netwerk/cookie/test/browser/**",
160         "netwerk/test/browser/**",
161         "netwerk/test/mochitests/**",
162         "netwerk/test/unit*/**",
163       ],
164       rules: {
165         "mozilla/no-arbitrary-setTimeout": "off",
166         "mozilla/no-define-cc-etc": "off",
167         "mozilla/use-services": "off",
168         "consistent-return": "off",
169         "no-eval": "off",
170         "no-global-assign": "off",
171         "no-nested-ternary": "off",
172         "no-redeclare": "off",
173         "no-shadow": "off",
174         "no-throw-literal": "off",
175         "no-unused-vars": "off",
176       },
177     },
178     {
179       files: ["layout/**"],
180       rules: {
181         "object-shorthand": "off",
182         "mozilla/avoid-removeChild": "off",
183         "mozilla/consistent-if-bracing": "off",
184         "mozilla/reject-importGlobalProperties": "off",
185         "mozilla/no-arbitrary-setTimeout": "off",
186         "mozilla/no-define-cc-etc": "off",
187         "mozilla/no-useless-parameters": "off",
188         "mozilla/no-useless-removeEventListener": "off",
189         "mozilla/use-chromeutils-generateqi": "off",
190         "mozilla/use-default-preference-values": "off",
191         "mozilla/use-includes-instead-of-indexOf": "off",
192         "mozilla/use-services": "off",
193         "mozilla/use-ownerGlobal": "off",
194         complexity: "off",
195         "consistent-return": "off",
196         "no-array-constructor": "off",
197         "no-caller": "off",
198         "no-cond-assign": "off",
199         "no-extra-boolean-cast": "off",
200         "no-eval": "off",
201         "no-func-assign": "off",
202         "no-global-assign": "off",
203         "no-implied-eval": "off",
204         "no-lonely-if": "off",
205         "no-nested-ternary": "off",
206         "no-new-wrappers": "off",
207         "no-redeclare": "off",
208         "no-restricted-globals": "off",
209         "no-return-await": "off",
210         "no-sequences": "off",
211         "no-shadow": "off",
212         "no-throw-literal": "off",
213         "no-useless-concat": "off",
214         "no-undef": "off",
215         "no-unreachable": "off",
216         "no-unsanitized/method": "off",
217         "no-unsanitized/property": "off",
218         "no-unsafe-negation": "off",
219         "no-unused-vars": "off",
220         "no-useless-return": "off",
221       },
222     },
223     {
224       files: [
225         "dom/animation/**",
226         "dom/base/test/*.*",
227         "dom/base/test/unit/test_serializers_entities*.js",
228         "dom/base/test/unit_ipc/**",
229         "dom/base/test/jsmodules/**",
230         "dom/base/*.*",
231         "dom/canvas/**",
232         "dom/encoding/**",
233         "dom/events/**",
234         "dom/fetch/**",
235         "dom/file/**",
236         "dom/html/**",
237         "dom/jsurl/**",
238         "dom/media/tests/**",
239         "dom/media/webaudio/**",
240         "dom/media/webspeech/**",
241         "dom/messagechannel/**",
242         "dom/midi/**",
243         "dom/network/**",
244         "dom/payments/**",
245         "dom/performance/**",
246         "dom/permission/**",
247         "dom/quota/**",
248         "dom/security/test/cors/**",
249         "dom/security/test/csp/**",
250         "dom/security/test/general/**",
251         "dom/security/test/https-only/**",
252         "dom/security/test/mixedcontentblocker/**",
253         "dom/security/test/sri/**",
254         "dom/security/test/referrer-policy/**",
255         "dom/serviceworkers/**",
256         "dom/smil/**",
257         "dom/tests/mochitest/**",
258         "dom/u2f/**",
259         "dom/vr/**",
260         "dom/webauthn/**",
261         "dom/webgpu/**",
262         "dom/websocket/**",
263         "dom/workers/**",
264         "dom/worklet/**",
265         "dom/xml/**",
266         "dom/xslt/**",
267         "dom/xul/**",
268         "dom/ipc/test.xhtml",
269       ],
270       rules: {
271         "consistent-return": "off",
272         "mozilla/avoid-removeChild": "off",
273         "mozilla/consistent-if-bracing": "off",
274         "mozilla/no-arbitrary-setTimeout": "off",
275         "mozilla/no-compare-against-boolean-literals": "off",
276         "mozilla/no-define-cc-etc": "off",
277         "mozilla/reject-importGlobalProperties": "off",
278         "mozilla/use-cc-etc": "off",
279         "mozilla/use-chromeutils-generateqi": "off",
280         "mozilla/use-chromeutils-import": "off",
281         "mozilla/use-includes-instead-of-indexOf": "off",
282         "mozilla/use-ownerGlobal": "off",
283         "mozilla/use-services": "off",
284         "no-array-constructor": "off",
285         "no-caller": "off",
286         "no-cond-assign": "off",
287         "no-control-regex": "off",
288         "no-debugger": "off",
289         "no-else-return": "off",
290         "no-empty": "off",
291         "no-eval": "off",
292         "no-func-assign": "off",
293         "no-global-assign": "off",
294         "no-implied-eval": "off",
295         "no-lone-blocks": "off",
296         "no-lonely-if": "off",
297         "no-nested-ternary": "off",
298         "no-new-object": "off",
299         "no-new-wrappers": "off",
300         "no-octal": "off",
301         "no-redeclare": "off",
302         "no-return-await": "off",
303         "no-restricted-globals": "off",
304         "no-self-assign": "off",
305         "no-self-compare": "off",
306         "no-sequences": "off",
307         "no-shadow": "off",
308         "no-shadow-restricted-names": "off",
309         "no-sparse-arrays": "off",
310         "no-throw-literal": "off",
311         "no-unreachable": "off",
312         "no-unsanitized/method": "off",
313         "no-unsanitized/property": "off",
314         "no-undef": "off",
315         "no-unused-vars": "off",
316         "no-useless-call": "off",
317         "no-useless-concat": "off",
318         "no-useless-return": "off",
319         "no-with": "off",
320       },
321     },
322     {
323       files: [
324         "dom/l10n/tests/mochitest/document_l10n/non-system-principal/test.html",
325         "dom/payments/test/test_basiccard.html",
326         "dom/payments/test/test_bug1478740.html",
327         "dom/payments/test/test_canMakePayment.html",
328         "dom/payments/test/test_closePayment.html",
329         "dom/payments/test/test_showPayment.html",
330         "dom/tests/browser/browser_persist_cookies.js",
331         "dom/tests/browser/browser_persist_mixed_content_image.js",
332         "netwerk/test/unit/test_http2-proxy.js",
333       ],
334       rules: {
335         "no-async-promise-executor": "off",
336       },
337     },
338     {
339       files: [
340         "browser/base/content/test/chrome/test_aboutCrashed.xhtml",
341         "browser/base/content/test/chrome/test_aboutRestartRequired.xhtml",
342         "browser/base/content/test/general/browser_tab_dragdrop2_frame1.xhtml",
343         "browser/components/places/tests/chrome/test_0_bug510634.xhtml",
344         "browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xhtml",
345         "browser/components/places/tests/chrome/test_0_bug510634.xhtml",
346         "browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xhtml",
347         "browser/components/places/tests/chrome/test_bug549192.xhtml",
348         "browser/components/places/tests/chrome/test_bug549491.xhtml",
349         "browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xhtml",
350         "browser/components/places/tests/chrome/test_treeview_date.xhtml",
351       ],
352       rules: {
353         "mozilla/no-arbitrary-setTimeout": "off",
354         "object-shorthand": "off",
355         "no-undef": "off",
356         "no-unused-vars": "off",
357       },
358     },
359     {
360       files: [
361         "accessible/tests/mochitest/actions/test_keys_menu.xhtml",
362         "accessible/tests/mochitest/elm/test_listbox.xhtml",
363         "accessible/tests/mochitest/events/test_focus_autocomplete.xhtml",
364         "accessible/tests/mochitest/events/test_focus_contextmenu.xhtml",
365         "accessible/tests/mochitest/events/test_tree.xhtml",
366         "accessible/tests/mochitest/hittest/test_zoom_tree.xhtml",
367         "accessible/tests/mochitest/name/test_general.xhtml",
368         "accessible/tests/mochitest/name/test_tree.xhtml",
369         "accessible/tests/mochitest/selectable/test_listbox.xhtml",
370         "accessible/tests/mochitest/states/test_expandable.xhtml",
371         "accessible/tests/mochitest/tree/test_button.xhtml",
372         "accessible/tests/mochitest/tree/test_tree.xhtml",
373         "accessible/tests/mochitest/treeupdate/test_contextmenu.xhtml",
374         "accessible/tests/mochitest/treeupdate/test_menu.xhtml",
375       ],
376       rules: {
377         "object-shorthand": "off",
378         "mozilla/no-compare-against-boolean-literals": "off",
379         "mozilla/use-cc-etc": "off",
380         "consistent-return": "off",
381         "no-redeclare": "off",
382         "no-sequences": "off",
383         "no-shadow": "off",
384         "no-unused-vars": "off",
385         "no-useless-call": "off",
386       },
387     },
388     {
389       files: [
390         "testing/mochitest/browser-harness.xhtml",
391         "testing/mochitest/chrome/test_chromeGetTestFile.xhtml",
392         "testing/mochitest/chrome/test_sanityEventUtils.xhtml",
393         "testing/mochitest/chrome/test_sanityException.xhtml",
394         "testing/mochitest/chrome/test_sanityException2.xhtml",
395         "testing/mochitest/harness.xhtml",
396       ],
397       rules: {
398         "dot-notation": "off",
399         "object-shorthand": "off",
400         "mozilla/use-services": "off",
401         "mozilla/no-compare-against-boolean-literals": "off",
402         "mozilla/no-useless-parameters": "off",
403         "mozilla/no-useless-removeEventListener": "off",
404         "mozilla/use-cc-etc": "off",
405         "consistent-return": "off",
406         "no-fallthrough": "off",
407         "no-nested-ternary": "off",
408         "no-redeclare": "off",
409         "no-sequences": "off",
410         "no-shadow": "off",
411         "no-throw-literal": "off",
412         "no-undef": "off",
413         "no-unsanitized/property": "off",
414         "no-unused-vars": "off",
415         "no-useless-call": "off",
416       },
417     },
418     {
419       files: [
420         "docshell/test/chrome/bug113934_window.xhtml",
421         "docshell/test/chrome/bug215405_window.xhtml",
422         "docshell/test/chrome/bug293235_window.xhtml",
423         "docshell/test/chrome/bug294258_window.xhtml",
424         "docshell/test/chrome/bug298622_window.xhtml",
425         "docshell/test/chrome/bug301397_window.xhtml",
426         "docshell/test/chrome/bug303267_window.xhtml",
427         "docshell/test/chrome/bug311007_window.xhtml",
428         "docshell/test/chrome/bug321671_window.xhtml",
429         "docshell/test/chrome/bug360511_window.xhtml",
430         "docshell/test/chrome/bug396519_window.xhtml",
431         "docshell/test/chrome/bug396649_window.xhtml",
432         "docshell/test/chrome/bug449778_window.xhtml",
433         "docshell/test/chrome/bug449780_window.xhtml",
434         "docshell/test/chrome/bug582176_window.xhtml",
435         "docshell/test/chrome/bug662200_window.xhtml",
436         "docshell/test/chrome/bug690056_window.xhtml",
437         "docshell/test/chrome/bug89419_window.xhtml",
438         "docshell/test/chrome/mozFrameType_window.xhtml",
439         "docshell/test/chrome/test_bug453650.xhtml",
440         "docshell/test/chrome/test_bug454235.xhtml",
441         "docshell/test/chrome/test_bug565388.xhtml",
442         "docshell/test/chrome/test_bug608669.xhtml",
443         "docshell/test/chrome/test_bug789773.xhtml",
444         "docshell/test/chrome/test_bug846906.xhtml",
445         "docshell/test/chrome/test_docRedirect.xhtml",
446         "docshell/test/chrome/test_principalInherit.xhtml",
447         "docshell/test/chrome/test_viewsource_forbidden_in_iframe.xhtml",
448       ],
449       rules: {
450         "dot-notation": "off",
451         "no-global-assign": "off",
452         "no-octal": "off",
453         "object-shorthand": "off",
454         "mozilla/consistent-if-bracing": "off",
455         "mozilla/no-compare-against-boolean-literals": "off",
456         "mozilla/no-useless-parameters": "off",
457         "mozilla/no-useless-removeEventListener": "off",
458         "mozilla/use-cc-etc": "off",
459         "mozilla/use-services": "off",
460         "mozilla/use-chromeutils-generateqi": "off",
461         "consistent-return": "off",
462         "no-delete-var": "off",
463         "no-redeclare": "off",
464         "no-sequences": "off",
465         "no-shadow": "off",
466         "no-undef": "off",
467         "no-unused-vars": "off",
468         "no-useless-call": "off",
469       },
470     },
471     {
472       files: [
473         "editor/composer/test/test_bug434998.xhtml",
474         "editor/libeditor/tests/test_bug607584.xhtml",
475         "editor/libeditor/tests/test_bug616590.xhtml",
476         "editor/libeditor/tests/test_bug780908.xhtml",
477       ],
478       rules: {
479         "object-shorthand": "off",
480         "no-undef": "off",
481       },
482     },
483     {
484       files: [
485         "widget/tests/native_menus_window.xhtml",
486         "widget/tests/native_mouse_mac_window.xhtml",
487         "widget/tests/standalone_native_menu_window.xhtml",
488         "widget/tests/system_font_changes.xhtml",
489         "widget/tests/taskbar_previews.xhtml",
490         "widget/tests/test_bug1123480.xhtml",
491         "widget/tests/test_bug343416.xhtml",
492         "widget/tests/test_bug428405.xhtml",
493         "widget/tests/test_bug429954.xhtml",
494         "widget/tests/test_bug466599.xhtml",
495         "widget/tests/test_bug485118.xhtml",
496         "widget/tests/test_bug517396.xhtml",
497         "widget/tests/test_bug538242.xhtml",
498         "widget/tests/test_bug596600.xhtml",
499         "widget/tests/test_bug673301.xhtml",
500         "widget/tests/test_bug760802.xhtml",
501         "widget/tests/test_chrome_context_menus_win.xhtml",
502         "widget/tests/test_clipboard.xhtml",
503         "widget/tests/test_input_events_on_deactive_window.xhtml",
504         "widget/tests/test_key_event_counts.xhtml",
505         "widget/tests/test_keycodes.xhtml",
506         "widget/tests/test_panel_mouse_coords.xhtml",
507         "widget/tests/test_position_on_resize.xhtml",
508         "widget/tests/test_sizemode_events.xhtml",
509         "widget/tests/test_taskbar_progress.xhtml",
510         "widget/tests/test_transferable_overflow.xhtml",
511         "widget/tests/window_bug429954.xhtml",
512         "widget/tests/window_bug478536.xhtml",
513         "widget/tests/window_composition_text_querycontent.xhtml",
514         "widget/tests/window_state_windows.xhtml",
515         "widget/tests/window_wheeltransaction.xhtml",
516       ],
517       rules: {
518         complexity: "off",
519         "consistent-return": "off",
520         "dot-notation": "off",
521         "mozilla/prefer-boolean-length-check": "off",
522         "mozilla/no-useless-parameters": "off",
523         "mozilla/no-useless-removeEventListener": "off",
524         "mozilla/use-cc-etc": "off",
525         "mozilla/use-chromeutils-generateqi": "off",
526         "mozilla/use-services": "off",
527         "object-shorthand": "off",
528         "no-caller": "off",
529         "no-delete-var": "off",
530         "no-nested-ternary": "off",
531         "no-new-object": "off",
532         "no-redeclare": "off",
533         "no-sequences": "off",
534         "no-shadow": "off",
535         "no-undef": "off",
536         "no-unsafe-finally": "off",
537         "no-unsanitized/property": "off",
538         "no-unused-vars": "off",
539         "no-useless-return": "off",
540       },
541     },
542     {
543       files: [
544         "dom/base/test/chrome/file_bug1139964.xhtml",
545         "dom/base/test/chrome/file_bug549682.xhtml",
546         "dom/base/test/chrome/file_bug616841.xhtml",
547         "dom/base/test/chrome/file_bug990812-1.xhtml",
548         "dom/base/test/chrome/file_bug990812-2.xhtml",
549         "dom/base/test/chrome/file_bug990812-3.xhtml",
550         "dom/base/test/chrome/file_bug990812-4.xhtml",
551         "dom/base/test/chrome/file_bug990812-5.xhtml",
552         "dom/base/test/chrome/file_bug990812.xhtml",
553         "dom/base/test/chrome/test_bug1098074_throw_from_ReceiveMessage.xhtml",
554         "dom/base/test/chrome/test_bug339494.xhtml",
555         "dom/base/test/chrome/test_bug429785.xhtml",
556         "dom/base/test/chrome/test_bug467123.xhtml",
557         "dom/base/test/chrome/test_bug683852.xhtml",
558         "dom/base/test/chrome/test_bug780529.xhtml",
559         "dom/base/test/chrome/test_bug800386.xhtml",
560         "dom/base/test/chrome/test_bug884693.xhtml",
561         "dom/base/test/chrome/test_document-element-inserted.xhtml",
562         "dom/base/test/chrome/test_domparsing.xhtml",
563         "dom/base/test/chrome/test_fileconstructor.xhtml",
564         "dom/base/test/chrome/title_window.xhtml",
565         "dom/base/test/chrome/window_nsITextInputProcessor.xhtml",
566         "dom/base/test/chrome/window_swapFrameLoaders.xhtml",
567         "dom/base/test/test_domrequesthelper.xhtml",
568         "dom/bindings/test/test_bug1123516_maplikesetlikechrome.xhtml",
569         "dom/console/tests/test_jsm.xhtml",
570         "dom/events/test/test_bug1412775.xhtml",
571         "dom/events/test/test_bug336682_2.xhtml",
572         "dom/events/test/test_bug415498.xhtml",
573         "dom/events/test/test_bug602962.xhtml",
574         "dom/events/test/test_bug617528.xhtml",
575         "dom/events/test/test_bug679494.xhtml",
576         "dom/indexedDB/test/test_globalObjects_chrome.xhtml",
577         "dom/indexedDB/test/test_wrappedArray.xhtml",
578         "dom/ipc/test.xhtml",
579         "dom/ipc/tests/test_process_error.xhtml",
580         "dom/notification/test/chrome/test_notification_system_principal.xhtml",
581         "dom/plugins/test/mochitest/test_busy_hang.xhtml",
582         "dom/plugins/test/mochitest/test_convertpoint.xhtml",
583         "dom/plugins/test/mochitest/test_crash_notify.xhtml",
584         "dom/plugins/test/mochitest/test_crash_notify_no_report.xhtml",
585         "dom/plugins/test/mochitest/test_crash_submit.xhtml",
586         "dom/plugins/test/mochitest/test_hang_submit.xhtml",
587         "dom/plugins/test/mochitest/test_hangui.xhtml",
588         "dom/plugins/test/mochitest/test_idle_hang.xhtml",
589         "dom/plugins/test/mochitest/test_xulbrowser_plugin_visibility.xhtml",
590         "dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xhtml",
591         "dom/security/test/general/test_bug1277803.xhtml",
592         "dom/serviceworkers/test/test_serviceworkerinfo.xhtml",
593         "dom/serviceworkers/test/test_serviceworkermanager.xhtml",
594         "dom/system/tests/test_constants.xhtml",
595         "dom/tests/mochitest/chrome/DOMWindowCreated_chrome.xhtml",
596         "dom/tests/mochitest/chrome/MozDomFullscreen_chrome.xhtml",
597         "dom/tests/mochitest/chrome/sizemode_attribute.xhtml",
598         "dom/tests/mochitest/chrome/test_cyclecollector.xhtml",
599         "dom/tests/mochitest/chrome/test_docshell_swap.xhtml",
600         "dom/tests/mochitest/chrome/window_focus.xhtml",
601         "dom/url/tests/test_bug883784.xhtml",
602         "dom/workers/test/test_WorkerDebugger.xhtml",
603         "dom/workers/test/test_WorkerDebugger_console.xhtml",
604         "dom/workers/test/test_fileReadSlice.xhtml",
605         "dom/workers/test/test_fileReaderSync.xhtml",
606         "dom/workers/test/test_fileSlice.xhtml",
607       ],
608       rules: {
609         "mozilla/no-useless-parameters": "off",
610         "mozilla/no-useless-removeEventListener": "off",
611         "mozilla/use-chromeutils-generateqi": "off",
612         "mozilla/use-services": "off",
613         complexity: "off",
614         "no-array-constructor": "off",
615         "no-caller": "off",
616         "no-empty": "off",
617         "no-eval": "off",
618         "no-lone-blocks": "off",
619         "no-octal": "off",
620         "no-redeclare": "off",
621         "no-shadow": "off",
622         "no-throw-literal": "off",
623         "no-undef": "off",
624         "no-unsanitized/method": "off",
625         "no-unused-vars": "off",
626         "no-useless-return": "off",
627         "object-shorthand": "off",
628       },
629     },
630     {
631       files: [
632         "toolkit/components/aboutmemory/tests/test_aboutmemory.xhtml",
633         "toolkit/components/aboutmemory/tests/test_aboutmemory2.xhtml",
634         "toolkit/components/aboutmemory/tests/test_aboutmemory3.xhtml",
635         "toolkit/components/aboutmemory/tests/test_aboutmemory4.xhtml",
636         "toolkit/components/aboutmemory/tests/test_aboutmemory5.xhtml",
637         "toolkit/components/aboutmemory/tests/test_aboutmemory7.xhtml",
638         "toolkit/components/aboutmemory/tests/test_dumpGCAndCCLogsToFile.xhtml",
639         "toolkit/components/aboutmemory/tests/test_memoryReporters.xhtml",
640         "toolkit/components/aboutmemory/tests/test_memoryReporters2.xhtml",
641         "toolkit/components/aboutmemory/tests/test_sqliteMultiReporter.xhtml",
642         "toolkit/components/ctypes/tests/chrome/test_ctypes.xhtml",
643         "toolkit/components/osfile/tests/mochi/test_osfile_back.xhtml",
644         "toolkit/components/osfile/tests/mochi/test_osfile_comms.xhtml",
645         "toolkit/components/osfile/tests/mochi/test_osfile_front.xhtml",
646         "toolkit/components/places/tests/chrome/browser_disableglobalhistory.xhtml",
647         "toolkit/components/places/tests/chrome/test_browser_disableglobalhistory.xhtml",
648         "toolkit/components/places/tests/chrome/test_favicon_annotations.xhtml",
649         "toolkit/components/workerloader/tests/test_loading.xhtml",
650         "toolkit/content/tests/chrome/bug263683_window.xhtml",
651         "toolkit/content/tests/chrome/bug304188_window.xhtml",
652         "toolkit/content/tests/chrome/bug331215_window.xhtml",
653         "toolkit/content/tests/chrome/bug360437_window.xhtml",
654         "toolkit/content/tests/chrome/bug366992_window.xhtml",
655         "toolkit/content/tests/chrome/bug409624_window.xhtml",
656         "toolkit/content/tests/chrome/bug429723_window.xhtml",
657         "toolkit/content/tests/chrome/bug451540_window.xhtml",
658         "toolkit/content/tests/chrome/dialog_dialogfocus.xhtml",
659         "toolkit/content/tests/chrome/findbar_entireword_window.xhtml",
660         "toolkit/content/tests/chrome/findbar_events_window.xhtml",
661         "toolkit/content/tests/chrome/findbar_window.xhtml",
662         "toolkit/content/tests/chrome/frame_popup_anchor.xhtml",
663         "toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xhtml",
664         "toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xhtml",
665         "toolkit/content/tests/chrome/test_arrowpanel.xhtml",
666         "toolkit/content/tests/chrome/test_autocomplete2.xhtml",
667         "toolkit/content/tests/chrome/test_autocomplete3.xhtml",
668         "toolkit/content/tests/chrome/test_autocomplete4.xhtml",
669         "toolkit/content/tests/chrome/test_autocomplete5.xhtml",
670         "toolkit/content/tests/chrome/test_autocomplete_emphasis.xhtml",
671         "toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml",
672         "toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xhtml",
673         "toolkit/content/tests/chrome/test_browser_drop.xhtml",
674         "toolkit/content/tests/chrome/test_bug1048178.xhtml",
675         "toolkit/content/tests/chrome/test_bug382990.xhtml",
676         "toolkit/content/tests/chrome/test_bug437844.xhtml",
677         "toolkit/content/tests/chrome/test_bug624329.xhtml",
678         "toolkit/content/tests/chrome/test_bug792324.xhtml",
679         "toolkit/content/tests/chrome/test_contextmenu_list.xhtml",
680         "toolkit/content/tests/chrome/test_cursorsnap.xhtml",
681         "toolkit/content/tests/chrome/test_dialogfocus.xhtml",
682         "toolkit/content/tests/chrome/test_hiddenitems.xhtml",
683         "toolkit/content/tests/chrome/test_hiddenpaging.xhtml",
684         "toolkit/content/tests/chrome/test_maximized_persist.xhtml",
685         "toolkit/content/tests/chrome/test_menu.xhtml",
686         "toolkit/content/tests/chrome/test_menuitem_blink.xhtml",
687         "toolkit/content/tests/chrome/test_menulist.xhtml",
688         "toolkit/content/tests/chrome/test_menulist_keynav.xhtml",
689         "toolkit/content/tests/chrome/test_mousescroll.xhtml",
690         "toolkit/content/tests/chrome/test_mozinputbox_dictionary.xhtml",
691         "toolkit/content/tests/chrome/test_notificationbox.xhtml",
692         "toolkit/content/tests/chrome/test_panel_focus.xhtml",
693         "toolkit/content/tests/chrome/test_popup_keys.xhtml",
694         "toolkit/content/tests/chrome/test_popup_scaled.xhtml",
695         "toolkit/content/tests/chrome/test_popupincontent.xhtml",
696         "toolkit/content/tests/chrome/test_popupremoving.xhtml",
697         "toolkit/content/tests/chrome/test_popupremoving_frame.xhtml",
698         "toolkit/content/tests/chrome/test_position.xhtml",
699         "toolkit/content/tests/chrome/test_preferences.xhtml",
700         "toolkit/content/tests/chrome/test_richlistbox.xhtml",
701         "toolkit/content/tests/chrome/test_righttoleft.xhtml",
702         "toolkit/content/tests/chrome/test_screenPersistence.xhtml",
703         "toolkit/content/tests/chrome/test_scrollbar.xhtml",
704         "toolkit/content/tests/chrome/test_showcaret.xhtml",
705         "toolkit/content/tests/chrome/test_tabbox.xhtml",
706         "toolkit/content/tests/chrome/test_textbox_search.xhtml",
707         "toolkit/content/tests/chrome/test_tree_view.xhtml",
708         "toolkit/content/tests/chrome/window_browser_drop.xhtml",
709         "toolkit/content/tests/chrome/window_cursorsnap_dialog.xhtml",
710         "toolkit/content/tests/chrome/window_cursorsnap_wizard.xhtml",
711         "toolkit/content/tests/chrome/window_keys.xhtml",
712         "toolkit/content/tests/chrome/window_largemenu.xhtml",
713         "toolkit/content/tests/chrome/window_panel.xhtml",
714         "toolkit/content/tests/chrome/window_panel_anchoradjust.xhtml",
715         "toolkit/content/tests/chrome/window_popup_preventdefault_chrome.xhtml",
716         "toolkit/content/tests/chrome/window_preferences.xhtml",
717         "toolkit/content/tests/chrome/window_preferences3.xhtml",
718         "toolkit/content/tests/chrome/window_preferences_beforeaccept.xhtml",
719         "toolkit/content/tests/chrome/window_preferences_commandretarget.xhtml",
720         "toolkit/content/tests/chrome/window_preferences_disabled.xhtml",
721         "toolkit/content/tests/chrome/window_preferences_onsyncfrompreference.xhtml",
722         "toolkit/content/tests/chrome/window_subframe_origin.xhtml",
723         "toolkit/content/tests/chrome/window_titlebar.xhtml",
724         "toolkit/content/tests/chrome/window_tooltip.xhtml",
725         "toolkit/content/tests/widgets/test_contextmenu_menugroup.xhtml",
726         "toolkit/content/tests/widgets/test_contextmenu_nested.xhtml",
727         "toolkit/content/tests/widgets/test_editor_currentURI.xhtml",
728         "toolkit/content/tests/widgets/test_popupanchor.xhtml",
729         "toolkit/content/tests/widgets/test_popupreflows.xhtml",
730         "toolkit/content/tests/widgets/window_menubar.xhtml",
731         "toolkit/modules/tests/chrome/test_bug544442_checkCert.xhtml",
732         "toolkit/profile/test/test_create_profile.xhtml",
733       ],
734       rules: {
735         "object-shorthand": "off",
736         "consistent-return": "off",
737         "mozilla/consistent-if-bracing": "off",
738         "mozilla/no-compare-against-boolean-literals": "off",
739         "mozilla/no-useless-parameters": "off",
740         "mozilla/no-useless-removeEventListener": "off",
741         "mozilla/prefer-boolean-length-check": "off",
742         "mozilla/use-cc-etc": "off",
743         "mozilla/use-chromeutils-generateqi": "off",
744         "mozilla/use-chromeutils-import": "off",
745         "mozilla/use-default-preference-values": "off",
746         "mozilla/use-services": "off",
747         "no-caller": "off",
748         "no-else-return": "off",
749         "no-eval": "off",
750         "no-fallthrough": "off",
751         "no-irregular-whitespace": "off",
752         "no-lonely-if": "off",
753         "no-nested-ternary": "off",
754         "no-redeclare": "off",
755         "no-sequences": "off",
756         "no-shadow": "off",
757         "no-throw-literal": "off",
758         "no-undef": "off",
759         "no-unneeded-ternary": "off",
760         "no-unused-vars": "off",
761         "no-useless-concat": "off",
762         "no-useless-return": "off",
763       },
764     },
765     {
766       files: [
767         "accessible/**",
768         "devtools/**",
769         "dom/**",
770         "docshell/**",
771         "editor/libeditor/tests/**",
772         "editor/spellchecker/tests/test_bug338427.html",
773         "gfx/**",
774         "image/test/browser/browser_image.js",
775         "js/src/builtin/**",
776         "layout/**",
777         "mobile/android/**",
778         "modules/**",
779         "netwerk/**",
780         "remote/**",
781         "security/manager/**",
782         "services/**",
783         "storage/test/unit/test_vacuum.js",
784         "taskcluster/docker/periodic-updates/scripts/**",
785         "testing/**",
786         "tools/**",
787         "widget/tests/test_assign_event_data.html",
788       ],
789       rules: {
790         "mozilla/prefer-boolean-length-check": "off",
791       },
792     },
793     {
794       // TODO: Bug 1609271 Fix all violations for ChromeUtils.import(..., null)
795       files: [
796         "browser/base/content/test/forms/head.js",
797         "browser/base/content/test/general/browser_datachoices_notification.js",
798         "browser/base/content/test/plugins/head.js",
799         "browser/base/content/test/sync/browser_fxa_web_channel.js",
800         "browser/base/content/test/webextensions/head.js",
801         "browser/components/customizableui/test/browser_1042100_default_placements_update.js",
802         "browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js",
803         "browser/components/customizableui/test/browser_1161838_inserted_new_default_buttons.js",
804         "browser/components/customizableui/test/browser_989338_saved_placements_not_resaved.js",
805         "browser/components/customizableui/test/browser_currentset_post_reset.js",
806         "browser/components/customizableui/test/browser_panel_keyboard_navigation.js",
807         "browser/components/enterprisepolicies/tests/browser/browser_policies_setAndLockPref_API.js",
808         "browser/components/enterprisepolicies/tests/browser/head.js",
809         "browser/components/enterprisepolicies/tests/xpcshell/head.js",
810         "browser/components/enterprisepolicies/tests/xpcshell/test_proxy.js",
811         "browser/components/enterprisepolicies/tests/xpcshell/test_runOnce_helper.js",
812         "browser/components/extensions/test/browser/browser_ext_browserAction_context.js",
813         "browser/components/extensions/test/browser/browser_ext_browserAction_popup.js",
814         "browser/components/extensions/test/browser/browser_ext_browserAction_popup_preload.js",
815         "browser/components/extensions/test/browser/browser_ext_currentWindow.js",
816         "browser/components/extensions/test/browser/browser_ext_getViews.js",
817         "browser/components/extensions/test/browser/browser_ext_management.js",
818         "browser/components/extensions/test/browser/browser_ext_menus_events.js",
819         "browser/components/extensions/test/browser/browser_ext_openPanel.js",
820         "browser/components/extensions/test/browser/browser_ext_pageAction_context.js",
821         "browser/components/extensions/test/browser/browser_ext_pageAction_popup.js",
822         "browser/components/extensions/test/browser/browser_ext_pageAction_show_matches.js",
823         "browser/components/extensions/test/browser/browser_ext_sessions_getRecentlyClosed_private.js",
824         "browser/components/extensions/test/browser/browser_ext_sessions_restore.js",
825         "browser/components/extensions/test/browser/browser_ext_tabs_audio.js",
826         "browser/components/extensions/test/browser/browser_ext_tabs_create_url.js",
827         "browser/components/extensions/test/browser/browser_ext_tabs_duplicate.js",
828         "browser/components/extensions/test/browser/browser_ext_tabs_newtab_private.js",
829         "browser/components/extensions/test/browser/browser_ext_tabs_removeCSS.js",
830         "browser/components/extensions/test/browser/browser_ext_tabs_zoom.js",
831         "browser/components/extensions/test/browser/browser_ext_windows.js",
832         "browser/components/extensions/test/browser/browser_ext_windows_events.js",
833         "browser/components/extensions/test/browser/head.js",
834         "browser/components/extensions/test/browser/head_webNavigation.js",
835         "browser/components/extensions/test/xpcshell/test_ext_url_overrides_newtab.js",
836         "browser/components/migration/tests/unit/test_Edge_db_migration.js",
837         "browser/components/preferences/tests/browser_contentblocking.js",
838         "browser/components/translation/test/unit/test_cld2.js",
839         "browser/components/urlbar/tests/ext/browser/update/browser_getBrowserUpdateStatus_updateDisabledByPolicy.js",
840         "browser/extensions/doh-rollout/experiments/doorhanger/api.js",
841         "browser/extensions/doh-rollout/experiments/doorhanger/api.js",
842         "browser/extensions/doh-rollout/test/browser/browser_policyOverride.js",
843         "browser/extensions/doh-rollout/test/unit/test_localStorageMigration.js",
844         "browser/extensions/formautofill/test/unit/head.js",
845         "browser/extensions/formautofill/test/unit/test_creditCardRecords.js",
846         "browser/extensions/formautofill/test/unit/test_migrateRecords.js",
847         "browser/extensions/formautofill/test/unit/test_storage_remove.js",
848         "browser/extensions/formautofill/test/unit/test_storage_tombstones.js",
849         "browser/extensions/formautofill/test/unit/test_sync.js",
850         "browser/extensions/formautofill/test/unit/test_transformFields.js",
851         "browser/extensions/report-site-issue/experimentalAPIs/pageActionExtras.js",
852         "browser/extensions/report-site-issue/test/browser/head.js",
853         "browser/modules/test/unit/test_LiveBookmarkMigrator.js",
854         "devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js",
855         "dom/ipc/tests/browser_memory_distribution_telemetry.js",
856         "dom/push/test/xpcshell/head.js",
857         "dom/push/test/xpcshell/test_broadcast_success.js",
858         "dom/push/test/xpcshell/test_crypto.js",
859         "gfx/layers/apz/test/mochitest/browser_test_select_zoom.js",
860         "security/manager/ssl/RemoteSecuritySettings.jsm",
861         "security/manager/ssl/tests/unit/test_der.js",
862         "security/manager/ssl/X509.jsm",
863         "services/common/tests/unit/head_helpers.js",
864         "services/common/tests/unit/test_uptake_telemetry.js",
865         "services/fxaccounts/tests/xpcshell/test_accounts.js",
866         "services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js",
867         "services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js",
868         "services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js",
869         "services/fxaccounts/tests/xpcshell/test_oauth_tokens.js",
870         "services/fxaccounts/tests/xpcshell/test_web_channel.js",
871         "services/sync/modules-testing/utils.js",
872         "services/sync/tests/unit/test_doctor.js",
873         "services/sync/tests/unit/test_postqueue.js",
874         "testing/marionette/components/marionette.js",
875         "testing/marionette/driver.js",
876         "testing/marionette/format.js",
877         "testing/marionette/server.js",
878         "testing/marionette/test/unit/test_prefs.js",
879         "testing/mochitest/browser-test.js",
880         "testing/mochitest/BrowserTestUtils/content/content-task.js",
881         "testing/xpcshell/head.js",
882         "toolkit/components/cloudstorage/tests/unit/test_cloudstorage.js",
883         "toolkit/components/crashes/tests/xpcshell/test_crash_manager.js",
884         "toolkit/components/crashes/tests/xpcshell/test_crash_service.js",
885         "toolkit/components/crashes/tests/xpcshell/test_crash_store.js",
886         "toolkit/components/enterprisepolicies/tests/browser/head.js",
887         "toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.jsm",
888         "toolkit/components/enterprisepolicies/tests/xpcshell/head.js",
889         "toolkit/components/extensions/ExtensionPreferencesManager.jsm",
890         "toolkit/components/extensions/ExtensionXPCShellUtils.jsm",
891         "toolkit/components/extensions/ExtensionXPCShellUtils.jsm",
892         "toolkit/components/extensions/parent/ext-management.js",
893         "toolkit/components/extensions/test/mochitest/test_ext_contentscript_cache.html",
894         "toolkit/components/extensions/test/xpcshell/head_native_messaging.js",
895         "toolkit/components/extensions/test/xpcshell/test_ext_api_permissions.js",
896         "toolkit/components/extensions/test/xpcshell/test_ext_background_early_shutdown.js",
897         "toolkit/components/extensions/test/xpcshell/test_ext_background_teardown.js",
898         "toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context.js",
899         "toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context_isolation.js",
900         "toolkit/components/extensions/test/xpcshell/test_ext_contentscript_teardown.js",
901         "toolkit/components/extensions/test/xpcshell/test_ext_contexts_gc.js",
902         "toolkit/components/extensions/test/xpcshell/test_ext_privacy_disable.js",
903         "toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js",
904         "toolkit/components/extensions/test/xpcshell/test_ext_shutdown_cleanup.js",
905         "toolkit/components/extensions/test/xpcshell/test_ext_storage_sync_kinto.js",
906         "toolkit/components/extensions/test/xpcshell/test_ext_storage_sync_kinto_crypto.js",
907         "toolkit/components/extensions/test/xpcshell/test_ext_tab_teardown.js",
908         "toolkit/components/extensions/test/xpcshell/test_native_manifests.js",
909         "toolkit/components/featuregates/test/unit/test_FeatureGate.js",
910         "toolkit/components/mozintl/mozIntl.jsm",
911         "toolkit/components/normandy/test/browser/browser_actions_ShowHeartbeatAction.js",
912         "toolkit/components/osfile/modules/osfile_async_front.jsm",
913         "toolkit/components/osfile/modules/osfile_native.jsm",
914         "toolkit/components/osfile/tests/xpcshell/test_osfile_kill.js",
915         "toolkit/components/passwordmgr/test/unit/test_getFormFields.js",
916         "toolkit/components/passwordmgr/test/unit/test_getPasswordFields.js",
917         "toolkit/components/passwordmgr/test/unit/test_getUserNameAndPasswordFields.js",
918         "toolkit/components/processsingleton/MainProcessSingleton.jsm",
919         "toolkit/components/telemetry/tests/unit/head.js",
920         "toolkit/components/telemetry/tests/unit/test_EcosystemTelemetry.js",
921         "toolkit/components/telemetry/tests/unit/test_EventPing.js",
922         "toolkit/components/telemetry/tests/unit/test_HealthPing.js",
923         "toolkit/components/telemetry/tests/unit/test_PingAPI.js",
924         "toolkit/components/telemetry/tests/unit/test_PrioPing.js",
925         "toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js",
926         "toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js",
927         "toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js",
928         "toolkit/components/telemetry/tests/unit/test_TelemetrySession.js",
929         "toolkit/modules/subprocess/test/xpcshell/test_subprocess.js",
930         "toolkit/modules/tests/xpcshell/test_GMPInstallManager.js",
931         "toolkit/mozapps/extensions/internal/AddonTestUtils.jsm",
932         "toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js",
933         "toolkit/mozapps/extensions/test/xpcshell/head_addons.js",
934         "toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_clients.js",
935         "toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_regexp_split.js",
936         "toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_targetapp_filter.js",
937         "toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_telemetry.js",
938         "toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklistchange.js",
939         "toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js",
940         "toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js",
941         "toolkit/mozapps/extensions/test/xpcshell/test_permissions_prefs.js",
942         "toolkit/mozapps/extensions/test/xpcshell/test_signed_updatepref.js",
943         "toolkit/mozapps/extensions/test/xpcshell/test_signed_verify.js",
944         "toolkit/mozapps/extensions/test/xpcshell/test_webextension.js",
945         "toolkit/mozapps/extensions/test/xpcshell/test_webextension_events.js",
946         "toolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js",
947         "toolkit/mozapps/installer/precompile_cache.js",
948       ],
949       rules: {
950         "mozilla/reject-chromeutils-import-null": "off",
951       },
952     },
953   ],