Bug 1867190 - Add prefs for PHC probablities r=glandium
[gecko.git] / security / .eslintrc.js
blob3709eff7f831552f7d2ab2985a505c9588ee6917
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 module.exports = {
8   rules: {
9     // Enforce return statements in callbacks of array methods.
10     "array-callback-return": "error",
12     // Verify calls of super() in constructors.
13     "constructor-super": "error",
15     // Require default case in switch statements.
16     "default-case": "error",
18     // Disallow use of alert(), confirm(), and prompt().
19     "no-alert": "error",
21     // Disallow likely erroneous `switch` scoped lexical declarations in
22     // case/default clauses.
23     "no-case-declarations": "error",
25     // Disallow use of the console API.
26     "no-console": ["error", { allow: ["error"] }],
28     // Disallow constant expressions in conditions (except for loops).
29     "no-constant-condition": ["error", { checkLoops: false }],
31     // Disallow extending of native objects.
32     "no-extend-native": "error",
34     // Disallow case statement fallthrough without explicit `// falls through`
35     // annotation.
36     "no-fallthrough": "error",
38     // No reassigning native JS objects or read only globals.
39     "no-global-assign": "error",
41     // Disallow use of assignment in return statement.
42     "no-return-assign": ["error", "always"],
44     // Disallow template literal placeholder syntax in regular strings.
45     "no-template-curly-in-string": "error",
47     // Disallow use of this/super before calling super() in constructors.
48     "no-this-before-super": "error",
50     // Disallow unmodified loop conditions.
51     "no-unmodified-loop-condition": "error",
53     // No expressions where a statement is expected
54     "no-unused-expressions": "error",
56     // Disallow unnecessary escape usage in strings and regular expressions.
57     "no-useless-escape": "error",
59     // Require "use strict" to be defined globally in the script.
60     strict: ["error", "global"],
62     // Disallow Yoda conditions.
63     yoda: ["error", "never"],
64   },