Skip to content

Commit 801093c

Browse files
committed
review eslint core rules: add some rules for preventing possible errors
1 parent 98994ff commit 801093c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/eslint/eslint.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const base = {
4040
'no-class-assign': ERROR,
4141
// disallow comparing against -0
4242
'no-compare-neg-zero': ERROR,
43+
// disallow reassigning `const` variables
44+
'no-const-assign': ERROR,
4345
// disallows expressions where the operation doesn't affect the value
4446
'no-constant-binary-expression': ERROR,
4547
// disallow constant expressions in conditions
@@ -86,8 +88,12 @@ const base = {
8688
'no-template-curly-in-string': ERROR,
8789
// disallow `this` / `super` before calling `super()` in constructors
8890
'no-this-before-super': ERROR,
91+
// disallow unmodified loop conditions
92+
'no-unmodified-loop-condition': ERROR,
8993
// disallow use of undeclared variables unless mentioned in a /*global */ block
9094
'no-undef': [ERROR],
95+
// disallow control flow statements in `finally` blocks
96+
'no-unsafe-finally': ERROR,
9197
// avoid code that looks like two expressions but is actually one
9298
'no-unexpected-multiline': ERROR,
9399
// disallow unreachable statements after a return, throw, continue, or break statement

0 commit comments

Comments
 (0)