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/. */
8 * Files to exclude from ESLint.
10 * Please DO NOT add more third party files to this file.
11 * They should be added to tools/rewriting/ThirdPartyPaths.txt instead.
13 * Please also DO NOT add generated files that are for some reason checked
14 * into source - add them to tools/rewriting/Generated.txt instead.
16 * This file should only be used for exclusions where we have:
17 * - preprocessed files
18 * - intentionally invalid files
19 * - build directories and other items that we need to ignore
24 // Include all js dot files.
27 // Ignore VSCode files
30 // Always ignore node_modules.
33 // Always ignore crashtests - specially crafted files that originally caused a
37 // Also ignore reftest - specially crafted to produce expected output.
40 // Don't ignore the reftest harness files.
41 "!/layout/tools/reftest/",
43 // Exclude expected objdirs.
46 // build/ third-party code
47 "build/pgo/js-input/",
49 // browser/ exclusions
51 "browser/branding/**/firefox-branding.js",
53 "browser/base/content/test/general/gZipOfflineChild.html",
54 "browser/base/content/test/urlbar/file_blank_but_not_blank.html",
55 // Pre-processed template file
56 "browser/components/backup/content/archive.template.html",
57 // Test files that are really json not js, and don't need to be linted.
58 "browser/components/sessionstore/test/unit/data/sessionstore_valid.js",
59 "browser/components/sessionstore/test/unit/data/sessionstore_invalid.js",
60 // This file is split into two in order to keep it as a valid json file
61 // for documentation purposes (policies.json) but to be accessed by the
62 // code as a .sys.mjs (schema.sys.mjs)
63 "browser/components/enterprisepolicies/schemas/schema.sys.mjs",
64 // generated or library files in pocket
65 "browser/components/pocket/content/panels/js/tmpl.js",
66 "browser/components/pocket/content/panels/js/vendor.bundle.js",
67 "browser/components/pocket/content/panels/js/main.bundle.js",
68 // Include the Storybook config files.
69 "!browser/components/storybook/.storybook/",
70 "!browser/components/storybook/.storybook/*.js",
72 // Ignore webpack about:welcome files
73 "browser/components/aboutwelcome/webpack.aboutwelcome.config.js",
75 // The only file in browser/locales/ is pre-processed.
77 // Generated data files
78 "browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.sys.mjs",
80 // JS file using the #include pre-processor macro, leading to syntax errors.
81 "browser/extensions/webcompat/run.js",
83 // Ignore newtab files
84 "browser/extensions/newtab/logs/",
86 // Ignore devtools debugger files which aren't intended for linting.
87 "devtools/client/debugger/bin/",
88 "devtools/client/debugger/configs/",
89 "devtools/client/debugger/dist/",
90 "devtools/client/debugger/images/",
91 "devtools/client/debugger/packages/",
92 "devtools/client/debugger/test/mochitest/examples/",
93 "devtools/client/debugger/index.html",
94 "devtools/client/debugger/webpack.config.js",
96 // Ignore devtools preferences files
97 "devtools/client/preferences/",
99 // Ignore devtools generated code
100 "devtools/client/webconsole/test/node/fixtures/stubs/*.js",
101 "!devtools/client/webconsole/test/node/fixtures/stubs/index.js",
102 "devtools/client/shared/components/test/node/stubs/reps/*.js",
103 "devtools/client/shared/source-map-loader/test/browser/fixtures/*.js",
105 // Ignore devtools files testing sourcemaps / code style
106 "devtools/client/framework/test/code_*",
107 "devtools/client/inspector/markup/test/events_bundle.js",
108 "devtools/client/netmonitor/test/xhr_bundle.js",
109 "devtools/client/webconsole/test/browser/code_bundle_nosource.js",
110 "devtools/client/webconsole/test/browser/code_bundle_invalidmap.js",
111 "devtools/client/webconsole/test/browser/test-autocomplete-mapped.js",
112 "devtools/client/webconsole/test/browser/test-autocomplete-mapped.src.js",
113 "devtools/client/inspector/markup/test/shadowdom_open_debugger.min.js",
114 "devtools/client/webconsole/test/browser/test-click-function-to-source*.js",
115 "devtools/client/webconsole/test/browser/test-external-script-errors.js",
116 "devtools/client/webconsole/test/browser/test-mangled-function.*",
117 "devtools/client/webconsole/test/browser/test-message-categories-canvas-css.js",
118 "devtools/client/webconsole/test/browser/test-message-categories-empty-getelementbyid.js",
119 "devtools/client/webconsole/test/browser/test-sourcemap*.js",
120 "devtools/server/tests/xpcshell/setBreakpoint*",
121 "devtools/server/tests/xpcshell/sourcemapped.js",
123 // Ignore generated code from wasm-bindgen
124 "devtools/client/performance-new/shared/profiler_get_symbols.js",
126 // Testing syntax error
127 "devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json",
128 "devtools/client/jsonview/test/invalid_json.json",
129 "devtools/client/webconsole/test/browser/test-syntaxerror-worklet.js",
131 // devtools specific format test file
132 "devtools/server/tests/xpcshell/xpcshell_debugging_script.js",
133 "devtools/shared/webconsole/test/browser/data.json",
136 "dom/canvas/test/webgl-conf/generated/",
138 // Intentionally invalid/not parsable
139 "dom/html/test/test_bug677658.html",
140 "dom/svg/test/test_nonAnimStrings.xhtml",
141 "dom/svg/test/test_SVG_namespace_ids.html",
144 "dom/base/test/file_bug687859-16.js",
145 "dom/base/test/file_bug707142_bom.json",
146 "dom/base/test/file_bug707142_utf-16.json",
147 "dom/encoding/test/test_utf16_files.html",
148 "dom/encoding/test/file_utf16_be_bom.js",
149 "dom/encoding/test/file_utf16_le_bom.js",
151 // Service workers fixtures which require specific resource caching.
152 "dom/base/test/file_js_cache.js",
153 "dom/serviceworkers/test/file_js_cache.js",
155 // Intentional broken files
156 "dom/base/test/file_js_cache_syntax_error.js",
157 "dom/base/test/jsmodules/test_scriptNotParsedAsModule.html",
158 "dom/base/test/jsmodules/test_syntaxError.html",
159 "dom/base/test/jsmodules/test_syntaxErrorAsync.html",
160 "dom/base/test/jsmodules/module_badSyntax.mjs",
161 "dom/base/test/jsmodules/test_syntaxErrorInline.html",
162 "dom/base/test/jsmodules/test_syntaxErrorInlineAsync.html",
163 "dom/base/test/test_bug687859.html",
164 "dom/media/webrtc/tests/mochitests/identity/idp-bad.js",
165 "dom/security/test/general/file_nonscript.json",
166 "dom/serviceworkers/test/file_js_cache_syntax_error.js",
167 "dom/serviceworkers/test/parse_error_worker.js",
168 "dom/tests/mochitest/bugs/test_bug531176.html",
169 "dom/webauthn/tests/cbor.js",
170 "dom/workers/test/importScripts_worker_imported3.js",
171 "dom/workers/test/invalid.js",
172 "dom/workers/test/threadErrors_worker1.js",
174 // Tests the module loader's path handling.
175 // Dynamic imports contains non-optimal paths.
176 "dom/workers/test/xpcshell/data/base_uri_worker.js",
177 "dom/workers/test/xpcshell/data/base_uri_module.mjs",
179 // Bug 1527075: This directory is linted in github repository
182 // Exclude everything but self-hosted JS
190 // Changes to XPConnect tests must be carefully audited.
191 "js/xpconnect/tests/mochitest/",
192 "js/xpconnect/tests/unit/",
194 // Fuzzing code for testing only, targeting the JS shell
195 "js/src/fuzz-tests/",
198 "mobile/android/docs/geckoview/assets/js/search-data.json",
200 // Uses `//filter substitution`
201 "mobile/android/app/geckoview-prefs.js",
203 // Not much JS to lint and non-standard at that
204 "mobile/android/installer/",
205 "mobile/android/locales/",
207 // Android - Web extensions: manifest.json files may be generated by the build system.
208 "mobile/android/android-components/components/feature/readerview/src/main/assets/extensions/readerview/manifest.json",
209 "mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.json",
211 // Bug 1903138: remaining issues from the firefox-android migration
212 "mobile/android/android-components/docs/assets/js/icon-js.js",
213 "mobile/android/fenix/app/src/androidTest/assets/",
214 "mobile/android/focus-android/app/src/androidTest/assets/",
216 // Pre-processed/pref files
217 "modules/libpref/greprefs.js",
218 "modules/libpref/init/all.js",
219 "modules/libpref/test/unit/*data/",
220 "toolkit/components/backgroundtasks/defaults/backgroundtasks.js",
221 "toolkit/components/backgroundtasks/defaults/backgroundtasks_browser.js",
223 // Only contains non-standard test files.
226 // These are (mainly) imported code that we don't want to lint to make imports easier.
227 "remote/cdp/Protocol.sys.mjs",
228 "remote/cdp/test/browser/chrome-remote-interface.js",
229 "remote/marionette/atom.sys.mjs",
231 // This file explicitly has a syntax error and cannot be parsed by eslint.
232 "remote/shared/messagehandler/test/browser/resources/modules/root/invalid.sys.mjs",
234 // services/ exclusions
236 // Webpack-bundled library
237 "services/fxaccounts/FxAccountsPairingChannel.sys.mjs",
239 // Servo is imported.
242 // Rust/Cargo output from running `cargo` directly
244 "servo/ports/geckolib/target/",
245 "dom/base/rust/target/",
246 "servo/components/style/target/",
247 "dom/webgpu/tests/cts/vendor/target/",
249 // Test files that we don't want to lint (preprocessed, minified etc)
250 "testing/condprofile/condprof/tests/profile",
251 "testing/mozbase/mozprofile/tests/files/prefs_with_comments.js",
252 "testing/mozharness/configs/test/test_malformed.json",
253 "testing/talos/talos/startup_test/sessionrestore/profile/sessionstore.js",
254 "testing/talos/talos/startup_test/sessionrestore/profile-manywindows/sessionstore.js",
256 "testing/talos/talos/unittests/test_talosconfig_browser_config.json",
257 "testing/talos/talos/unittests/test_talosconfig_test_config.json",
258 // Runing Talos may extract data here, see bug 1435677.
259 "testing/talos/talos/tests/tp5n/",
260 "testing/talos/talos/fis/tp5n/",
262 // Mainly third-party related code, that shouldn't be linted.
263 "testing/web-platform/",
265 // toolkit/ exclusions
267 // Intentionally invalid files
268 "toolkit/components/workerloader/tests/moduleF-syntax-error.js",
269 "toolkit/components/enterprisepolicies/tests/browser/config_broken_json.json",
270 "toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_fail.json",
273 "toolkit/components/pdfjs/content/build",
274 "toolkit/components/pdfjs/content/web",
276 // Uses preprocessing
277 "toolkit/components/reader/Readerable.sys.mjs",
279 // Generated & special files in cld2
280 "toolkit/components/translation/cld2/",
282 // Uses preprocessing
283 "toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js",
284 "toolkit/modules/AppConstants.sys.mjs",
286 // Tests of ESLint command.
287 "tools/lint/test/files",
289 // Uses special template formatting.
290 "tools/tryselect/selectors/chooser/templates/chooser.html",
292 // Ignore preprocessed *(P)refs.js files in update-packaging.
293 "tools/update-packaging/**/*refs.js",
295 // Ignore pre-generated webpack and typescript transpiled files for translations
296 "browser/extensions/translations/extension/",
298 // "scaffolding" used by uniffi which isn't valid JS in its original form.
299 "toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/",
300 "toolkit/components/uniffi-bindgen-gecko-js/components/generated/*",
302 // Test files for circular import in modules.
303 "dom/base/test/jsmodules/import_circular.mjs",
304 "dom/base/test/jsmodules/import_circular_1.mjs",