tor-browser

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

.eslintrc.mjs (1695B)


      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 export default [
      6  {
      7    languageOptions: {
      8      globals: {
      9        // JS files in this folder are commonly xpcshell scripts where |arguments|
     10        // is defined in the global scope.
     11        arguments: false,
     12      },
     13    },
     14    rules: {
     15      // Enforce return statements in callbacks of array methods.
     16      "array-callback-return": "error",
     17 
     18      // Require default case in switch statements.
     19      "default-case": "error",
     20 
     21      // Disallow use of alert(), confirm(), and prompt().
     22      "no-alert": "error",
     23 
     24      // Disallow likely erroneous `switch` scoped lexical declarations in
     25      // case/default clauses.
     26      "no-case-declarations": "error",
     27 
     28      // Disallow constant expressions in conditions (except for loops).
     29      "no-constant-condition": ["error", { checkLoops: false }],
     30 
     31      // Disallow extending of native objects.
     32      "no-extend-native": "error",
     33 
     34      // Disallow use of assignment in return statement.
     35      "no-return-assign": ["error", "always"],
     36 
     37      // Disallow template literal placeholder syntax in regular strings.
     38      "no-template-curly-in-string": "error",
     39 
     40      // Disallow unmodified loop conditions.
     41      "no-unmodified-loop-condition": "error",
     42 
     43      // No expressions where a statement is expected
     44      "no-unused-expressions": "error",
     45 
     46      // Require "use strict" to be defined globally in the script.
     47      strict: ["error", "global"],
     48 
     49      // Disallow Yoda conditions.
     50      yoda: ["error", "never"],
     51    },
     52  },
     53 ];