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 extends: ["plugin:mozilla/valid-jsdoc"],
11 // Enforce return statements in callbacks of array methods.
12 "array-callback-return": "error",
14 // Verify calls of super() in constructors.
15 "constructor-super": "error",
17 // Require default case in switch statements.
18 "default-case": "error",
20 // Disallow use of alert(), confirm(), and prompt().
23 // Disallow likely erroneous `switch` scoped lexical declarations in
24 // case/default clauses.
25 "no-case-declarations": "error",
27 // Disallow use of the console API.
28 "no-console": ["error", { allow: ["error"] }],
30 // Disallow constant expressions in conditions (except for loops).
31 "no-constant-condition": ["error", { checkLoops: false }],
33 // Disallow extending of native objects.
34 "no-extend-native": "error",
36 // Disallow case statement fallthrough without explicit `// falls through`
38 "no-fallthrough": "error",
40 // No reassigning native JS objects or read only globals.
41 "no-global-assign": "error",
43 // Disallow use of assignment in return statement.
44 "no-return-assign": ["error", "always"],
46 // Disallow template literal placeholder syntax in regular strings.
47 "no-template-curly-in-string": "error",
49 // Disallow use of this/super before calling super() in constructors.
50 "no-this-before-super": "error",
52 // Disallow unmodified loop conditions.
53 "no-unmodified-loop-condition": "error",
55 // No expressions where a statement is expected
56 "no-unused-expressions": "error",
58 // Disallow unnecessary escape usage in strings and regular expressions.
59 "no-useless-escape": "error",
61 // Require "use strict" to be defined globally in the script.
62 strict: ["error", "global"],
64 // Disallow Yoda conditions.
65 yoda: ["error", "never"],