1 | module.exports = {
|
2 | rules: {
|
3 | // disallow await inside of loops
|
4 | // http://eslint.org/docs/rules/no-await-in-loop
|
5 | 'no-await-in-loop': 'error',
|
6 |
|
7 | // disallow assignment operators in conditional expressions
|
8 | // http://eslint.org/docs/rules/no-cond-assign
|
9 | 'no-cond-assign': ['error', 'always'],
|
10 |
|
11 | // disallow the use of console
|
12 | // http://eslint.org/docs/rules/no-console
|
13 | 'no-console': 'warn',
|
14 |
|
15 | // disallow constant expressions in conditions
|
16 | // http://eslint.org/docs/rules/no-constant-condition
|
17 | 'no-constant-condition': 'warn',
|
18 |
|
19 | // disallow control characters in regular expressions
|
20 | // http://eslint.org/docs/rules/no-control-regex
|
21 | 'no-control-regex': 'error',
|
22 |
|
23 | // disallow the use of debugger
|
24 | // http://eslint.org/docs/rules/no-debugger
|
25 | 'no-debugger': 'error',
|
26 |
|
27 | // disallow duplicate arguments in function definitions
|
28 | // http://eslint.org/docs/rules/no-dupe-args
|
29 | 'no-dupe-args': 'error',
|
30 |
|
31 | // disallow duplicate keys in object literals
|
32 | // http://eslint.org/docs/rules/no-dupe-keys
|
33 | 'no-dupe-keys': 'error',
|
34 |
|
35 | // disallow duplicate case labels
|
36 | // http://eslint.org/docs/rules/no-duplicate-case
|
37 | 'no-duplicate-case': 'error',
|
38 |
|
39 | // disallow empty character classes in regular expressions
|
40 | // http://eslint.org/docs/rules/no-empty-character-class
|
41 | 'no-empty-character-class': 'error',
|
42 |
|
43 | // disallow empty block statements
|
44 | // http://eslint.org/docs/rules/no-empty
|
45 | 'no-empty': 'error',
|
46 |
|
47 | // disallow reassigning exceptions in catch clauses
|
48 | // http://eslint.org/docs/rules/no-ex-assign
|
49 | 'no-ex-assign': 'error',
|
50 |
|
51 | // disallow unnecessary boolean casts
|
52 | // http://eslint.org/docs/rules/no-extra-boolean-cast
|
53 | 'no-extra-boolean-cast': 'error',
|
54 |
|
55 | // disallow unnecessary parentheses
|
56 | // http://eslint.org/docs/rules/no-extra-parens
|
57 | // This is handled by Prettier in Defaults 2.0
|
58 | 'no-extra-parens': 'off',
|
59 |
|
60 | // disallow unnecessary semicolons
|
61 | // http://eslint.org/docs/rules/no-extra-semi
|
62 | // This is handled by Prettier in Defaults 2.0
|
63 | 'no-extra-semi': 'off',
|
64 |
|
65 | // disallow reassigning function declarations
|
66 | // http://eslint.org/docs/rules/no-func-assign
|
67 | 'no-func-assign': 'error',
|
68 |
|
69 | // disallow variable or function declarations in nested blocks
|
70 | // http://eslint.org/docs/rules/no-inner-declarations
|
71 | 'no-inner-declarations': 'error',
|
72 |
|
73 | // disallow invalid regular expression strings in RegExp constructors
|
74 | // http://eslint.org/docs/rules/no-invalid-regexp
|
75 | 'no-invalid-regexp': 'error',
|
76 |
|
77 | // disallow irregular whitespace outside of strings and comments
|
78 | // http://eslint.org/docs/rules/no-irregular-whitespace
|
79 | 'no-irregular-whitespace': 'error',
|
80 |
|
81 | // disallow calling global object properties as functions
|
82 | // http://eslint.org/docs/rules/no-obj-calls
|
83 | 'no-obj-calls': 'error',
|
84 |
|
85 | // disallow calling some Object.prototype methods directly on objects
|
86 | // http://eslint.org/docs/rules/no-prototype-builtins
|
87 | 'no-prototype-builtins': 'error',
|
88 |
|
89 | // disallow multiple spaces in regular expressions
|
90 | // http://eslint.org/docs/rules/no-regex-spaces
|
91 | 'no-regex-spaces': 'error',
|
92 |
|
93 | // disallow sparse arrays
|
94 | // http://eslint.org/docs/rules/no-sparse-arrays
|
95 | 'no-sparse-arrays': 'error',
|
96 |
|
97 | // disallow template literal placeholder syntax in regular strings
|
98 | // http://eslint.org/docs/rules/no-template-curly-in-string
|
99 | 'no-template-curly-in-string': 'error',
|
100 |
|
101 | // disallow confusing multiline expressions
|
102 | // http://eslint.org/docs/rules/no-unexpected-multiline
|
103 | // This is handled by Prettier in Defaults 2.0
|
104 | 'no-unexpected-multiline': 'off',
|
105 |
|
106 | // disallow unreachable code after return, throw, continue, and break statements
|
107 | // http://eslint.org/docs/rules/no-unreachable
|
108 | 'no-unreachable': 'error',
|
109 |
|
110 | // disallow control flow statements in finally blocks
|
111 | // http://eslint.org/docs/rules/no-unsafe-finally
|
112 | 'no-unsafe-finally': 'error',
|
113 |
|
114 | // disallow negating the left operand of relational operators
|
115 | // http://eslint.org/docs/rules/no-unsafe-negation
|
116 | 'no-unsafe-negation': 'error',
|
117 |
|
118 | // require calls to isNaN() when checking for NaN
|
119 | // http://eslint.org/docs/rules/use-isnan
|
120 | 'use-isnan': 'error',
|
121 |
|
122 | // enforce valid JSDoc comments
|
123 | // http://eslint.org/docs/rules/valid-jsdoc
|
124 | 'valid-jsdoc': 'off',
|
125 |
|
126 | // enforce comparing typeof expressions against valid strings
|
127 | // http://eslint.org/docs/rules/valid-typeof
|
128 | 'valid-typeof': ['error', { requireStringLiterals: true }],
|
129 | },
|
130 | };
|