tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

eslint-ignores.config.mjs (12501B)


      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/. */
      4 
      5 /**
      6 * Files to exclude from ESLint.
      7 *
      8 * Please DO NOT add more third party files to this file.
      9 * They should be added to tools/rewriting/ThirdPartyPaths.txt instead.
     10 *
     11 * Please also DO NOT add  generated files that are for some reason checked
     12 * into source - add them to tools/rewriting/Generated.txt instead.
     13 *
     14 * This file should only be used for exclusions where we have:
     15 * - preprocessed files
     16 * - intentionally invalid files
     17 * - build directories and other items that we need to ignore
     18 *
     19 * @type {string[]}
     20 */
     21 export default [
     22  // Include all js dot files.
     23  "!.*.js",
     24 
     25  // Exclude TypeScript files.
     26  "*.ts",
     27 
     28  // Ignore VSCode files
     29  ".vscode/",
     30 
     31  // Always ignore node_modules.
     32  "**/node_modules/",
     33 
     34  // Always ignore crashtests - specially crafted files that originally caused a
     35  // crash.
     36  "**/crashtest/",
     37  "**/crashtests/",
     38  // Also ignore reftest - specially crafted to produce expected output.
     39  "**/reftest/",
     40  "**/reftests/",
     41  // Don't ignore the reftest harness files.
     42  "!layout/tools/reftest/",
     43 
     44  // Exclude expected objdirs.
     45  "obj*/",
     46 
     47  // build/ third-party code
     48  "build/pgo/js-input/",
     49 
     50  // browser/ exclusions
     51  "browser/app/",
     52  "browser/branding/**/firefox-branding.js",
     53  // Gzipped test file.
     54  "browser/base/content/test/general/gZipOfflineChild.html",
     55  "browser/base/content/test/urlbar/file_blank_but_not_blank.html",
     56  // Pre-processed template file
     57  "browser/components/backup/content/archive.template.html",
     58  // Test files that are really json not js, and don't need to be linted.
     59  "browser/components/sessionstore/test/unit/data/sessionstore_valid.js",
     60  "browser/components/sessionstore/test/unit/data/sessionstore_invalid.js",
     61  // This file is split into two in order to keep it as a valid json file
     62  // for documentation purposes (policies.json) but to be accessed by the
     63  // code as a .sys.mjs (schema.sys.mjs)
     64  "browser/components/enterprisepolicies/schemas/schema.sys.mjs",
     65  // Include the Storybook config files.
     66  "!browser/components/storybook/.storybook/",
     67  "!browser/components/storybook/.storybook/*.js",
     68 
     69  // Ignore webpack about:welcome files
     70  "browser/components/aboutwelcome/webpack.aboutwelcome.config.js",
     71 
     72  // The only file in browser/locales/ is pre-processed.
     73  "browser/locales/",
     74  // Generated data files
     75  "browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.sys.mjs",
     76 
     77  // JS file using the #include pre-processor macro, leading to syntax errors.
     78  "browser/extensions/webcompat/run.js",
     79 
     80  // Ignore newtab files
     81  "browser/extensions/newtab/logs/",
     82 
     83  // Ignore devtools debugger files which aren't intended for linting.
     84  "devtools/client/debugger/bin/",
     85  "devtools/client/debugger/configs/",
     86  "devtools/client/debugger/dist/",
     87  "devtools/client/debugger/images/",
     88  "devtools/client/debugger/packages/",
     89  "devtools/client/debugger/test/mochitest/examples/",
     90  "devtools/client/debugger/index.html",
     91  "devtools/client/debugger/webpack.config.js",
     92 
     93  // Ignore devtools preferences files
     94  "devtools/client/preferences/",
     95 
     96  // Ignore devtools generated code
     97  "devtools/**/*.snapshot.mjs",
     98  "tools/profiler/tests/browser/browser_test_feature_jstracing_objtestutils.snapshot.mjs",
     99  "devtools/client/webconsole/test/node/fixtures/stubs/*.js",
    100  "!devtools/client/webconsole/test/node/fixtures/stubs/index.js",
    101  "devtools/client/shared/source-map-loader/test/browser/fixtures/*.js",
    102 
    103  // Ignore devtools files testing sourcemaps / code style
    104  "devtools/client/framework/test/code_*",
    105  "devtools/client/inspector/markup/test/events/events_bundle.js",
    106  "devtools/client/netmonitor/test/xhr_bundle.js",
    107  "devtools/client/webconsole/test/browser/code_bundle_nosource.js",
    108  "devtools/client/webconsole/test/browser/code_bundle_invalidmap.js",
    109  "devtools/client/webconsole/test/browser/test-autocomplete-mapped.js",
    110  "devtools/client/webconsole/test/browser/test-autocomplete-mapped.src.js",
    111  "devtools/client/inspector/markup/test/shadowdom/shadowdom_open_debugger.min.js",
    112  "devtools/client/webconsole/test/browser/test-click-function-to-source*.js",
    113  "devtools/client/webconsole/test/browser/test-external-script-errors.js",
    114  "devtools/client/webconsole/test/browser/test-mangled-function.*",
    115  "devtools/client/webconsole/test/browser/test-message-categories-canvas-css.js",
    116  "devtools/client/webconsole/test/browser/test-message-categories-empty-getelementbyid.js",
    117  "devtools/client/webconsole/test/browser/test-sourcemap*.js",
    118  "devtools/server/tests/xpcshell/setBreakpoint*",
    119  "devtools/server/tests/xpcshell/sourcemapped.js",
    120 
    121  // Ignore generated code from wasm-bindgen
    122  "devtools/shared/performance-new/profiler_get_symbols.js",
    123 
    124  // Testing syntax error
    125  "devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json",
    126  "devtools/client/jsonview/test/invalid_json.json",
    127  "devtools/client/webconsole/test/browser/test-syntaxerror-worklet.js",
    128  "devtools/server/tests/xpcshell/addons/invalid-extension-manifest-badjson/manifest.json",
    129 
    130  // devtools specific format test file
    131  "devtools/server/tests/xpcshell/xpcshell_debugging_script.js",
    132  "devtools/shared/webconsole/test/browser/data.json",
    133 
    134  // Generated
    135  "dom/canvas/test/webgl-conf/generated/",
    136 
    137  // Intentionally invalid/not parsable
    138  "dom/html/test/test_bug677658.html",
    139  "dom/svg/test/test_nonAnimStrings.xhtml",
    140  "dom/svg/test/test_SVG_namespace_ids.html",
    141 
    142  // Strange encodings
    143  "dom/base/test/file_bug687859-16.js",
    144  "dom/base/test/file_bug707142_bom.json",
    145  "dom/base/test/file_bug707142_utf-16.json",
    146  "dom/encoding/test/test_utf16_files.html",
    147  "dom/encoding/test/file_utf16_be_bom.js",
    148  "dom/encoding/test/file_utf16_le_bom.js",
    149 
    150  // Service workers fixtures which require specific resource caching.
    151  "dom/base/test/file_js_cache.js",
    152  "dom/serviceworkers/test/file_js_cache.js",
    153 
    154  // Intentional broken files
    155  "dom/base/test/file_js_cache_syntax_error.js",
    156  "dom/base/test/file_js_cache_large_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/jsmodules/parse_error.js",
    164  "dom/base/test/test_bug687859.html",
    165  "dom/media/webrtc/tests/mochitests/identity/idp-bad.js",
    166  "dom/security/test/general/file_nonscript.json",
    167  "dom/serviceworkers/test/file_js_cache_syntax_error.js",
    168  "dom/serviceworkers/test/parse_error_worker.js",
    169  "dom/tests/mochitest/bugs/test_bug531176.html",
    170  "dom/webauthn/tests/cbor.js",
    171  "dom/workers/test/importScripts_worker_imported3.js",
    172  "dom/workers/test/invalid.js",
    173  "dom/workers/test/threadErrors_worker1.js",
    174 
    175  // Test files for serialization tests
    176  "dom/serializers/tests/mochitest/file_htmlserializer_1*",
    177  "dom/serializers/tests/mochitest/file_xhtmlserializer_1*",
    178 
    179  // Tests the module loader's path handling.
    180  // Dynamic imports contains non-optimal paths.
    181  "dom/workers/test/xpcshell/data/base_uri_worker.js",
    182  "dom/workers/test/xpcshell/data/base_uri_module.mjs",
    183 
    184  // Bug 1527075: This directory is linted in github repository
    185  "intl/l10n/",
    186 
    187  // Exclude everything but self-hosted JS
    188  "js/examples/",
    189  "js/public/",
    190  "js/src/devtools/",
    191  "js/src/jit-test/",
    192  "js/src/tests/",
    193  "js/src/Y.js",
    194 
    195  // Changes to XPConnect tests must be carefully audited.
    196  "js/xpconnect/tests/mochitest/",
    197  "js/xpconnect/tests/unit/",
    198 
    199  // Fuzzing code for testing only, targeting the JS shell
    200  "js/src/fuzz-tests/",
    201 
    202  // Template file
    203  "mobile/android/docs/geckoview/assets/js/search-data.json",
    204 
    205  // Uses `//filter substitution`
    206  "mobile/android/app/geckoview-prefs.js",
    207 
    208  // Not much JS to lint and non-standard at that
    209  "mobile/android/installer/",
    210  "mobile/android/locales/",
    211 
    212  // Android - Web extensions: manifest.json files may be generated by the build system.
    213  "mobile/android/android-components/components/feature/readerview/src/main/assets/extensions/readerview/manifest.json",
    214  "mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.json",
    215 
    216  // Bug 1903138: remaining issues from the firefox-android migration
    217  "mobile/android/android-components/docs/assets/js/icon-js.js",
    218  "mobile/android/fenix/app/src/androidTest/assets/",
    219  "mobile/android/focus-android/app/src/androidTest/assets/",
    220 
    221  // Contains pref files.
    222  "mobile/ios/app/",
    223 
    224  // Pre-processed/pref files
    225  "modules/libpref/greprefs.js",
    226  "modules/libpref/init/all.js",
    227  "modules/libpref/test/unit/*data/",
    228  "toolkit/components/backgroundtasks/defaults/backgroundtasks.js",
    229  "toolkit/components/backgroundtasks/defaults/backgroundtasks_browser.js",
    230 
    231  // Only contains non-standard test files.
    232  "python/",
    233 
    234  // These are (mainly) imported code that we don't want to lint to make imports easier.
    235  "remote/cdp/Protocol.sys.mjs",
    236  "remote/cdp/test/browser/chrome-remote-interface.js",
    237  "remote/marionette/atom.sys.mjs",
    238 
    239  // This file explicitly has a syntax error and cannot be parsed by eslint.
    240  "remote/shared/messagehandler/test/browser/resources/modules/root/invalid.sys.mjs",
    241 
    242  // services/ exclusions
    243 
    244  // Webpack-bundled library
    245  "services/fxaccounts/FxAccountsPairingChannel.sys.mjs",
    246 
    247  // Servo is imported.
    248  "servo/",
    249 
    250  // Rust/Cargo output from running `cargo` directly
    251  "target/",
    252  "servo/ports/geckolib/target/",
    253  "dom/base/rust/target/",
    254  "servo/components/style/target/",
    255  "dom/webgpu/tests/cts/vendor/target/",
    256 
    257  // Test files that we don't want to lint (preprocessed, minified etc)
    258  "testing/condprofile/condprof/tests/profile",
    259  "testing/mozbase/mozprofile/tests/files/prefs_with_comments.js",
    260  "testing/mozharness/configs/test/test_malformed.json",
    261  "testing/talos/talos/startup_test/sessionrestore/profile/sessionstore.js",
    262  "testing/talos/talos/startup_test/sessionrestore/profile-manywindows/sessionstore.js",
    263  // Python json.
    264  "testing/talos/talos/unittests/test_talosconfig_browser_config.json",
    265  "testing/talos/talos/unittests/test_talosconfig_test_config.json",
    266  // Runing Talos may extract data here, see bug 1435677.
    267  "testing/talos/talos/tests/tp5n/",
    268  "testing/talos/talos/fis/tp5n/",
    269 
    270  // Mainly third-party related code, that shouldn't be linted.
    271  "testing/web-platform/",
    272 
    273  // toolkit/ exclusions
    274 
    275  // Intentionally invalid files
    276  "toolkit/components/workerloader/tests/moduleF-syntax-error.js",
    277  "toolkit/components/enterprisepolicies/tests/browser/config_broken_json.json",
    278  "toolkit/components/normandy/test/unit/mock_api/api/v1/extension/index.json",
    279  "toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_fail.json",
    280 
    281  // Built files
    282  "toolkit/components/pdfjs/content/build",
    283  "toolkit/components/pdfjs/content/web",
    284 
    285  // Uses preprocessing
    286  "toolkit/components/reader/Readerable.sys.mjs",
    287 
    288  // Generated & special files in cld2
    289  "toolkit/components/translations/cld2/",
    290 
    291  // Uses preprocessing
    292  "toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js",
    293  "toolkit/modules/AppConstants.sys.mjs",
    294 
    295  // ESLint tests.
    296  "tools/lint/test/files",
    297  "tools/lint/eslint/eslint-plugin-mozilla/tests/globals-data/import-globals-from-invalid.js",
    298 
    299  // Uses special template formatting.
    300  "tools/tryselect/selectors/chooser/templates/chooser.html",
    301 
    302  // Ignore preprocessed *(P)refs.js files in update-packaging.
    303  "tools/update-packaging/**/*refs.js",
    304 
    305  // Ignore pre-generated webpack and typescript transpiled files for translations
    306  "browser/extensions/translations/extension/",
    307 
    308  // "scaffolding" used by uniffi which isn't valid JS in its original form.
    309  "toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/",
    310  "toolkit/components/uniffi-bindgen-gecko-js/components/generated/*",
    311 
    312  // Test files for circular import in modules.
    313  "dom/base/test/jsmodules/import_circular.mjs",
    314  "dom/base/test/jsmodules/import_circular_1.mjs",
    315 
    316  "browser/app/profile/001-base-profile.js",
    317  "browser/app/profile/000-tor-browser.js",
    318  "mobile/android/app/000-tor-browser-android.js",
    319  "toolkit/content/pt_config.json",
    320  "toolkit/content/moat_contries_dev_build.json",
    321  "toolkit/components/lox/lox_wasm.jsm",
    322 ];