Skip to content

Commit f513e66

Browse files
Trottrvagg
authored andcommitted
tools: lint for empty character classes in regex
Enable linting rule to forbid empty character classes in regular expressions. See http://eslint.org/docs/rules/no-empty-character-class Organize "Possible Error" rules in .eslintrc in alphabetical order to match eslint documentation. PR-URL: #5115 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent fc3c32b commit f513e66

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.eslintrc

+10-8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ ecmaFeatures:
1717
rules:
1818
# Possible Errors
1919
# list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
20+
## disallow control characters in regular expressions
21+
no-control-regex: 2
2022
## check debugger sentence
2123
no-debugger: 2
2224
## check duplicate arguments
@@ -25,24 +27,24 @@ rules:
2527
no-dupe-keys: 2
2628
## check duplicate switch-case
2729
no-duplicate-case: 2
28-
## disallow superfluous semicolons
29-
no-extra-semi: 2
30+
## disallow the use of empty character classes in regular expressions
31+
no-empty-character-class: 2
3032
## disallow assignment of exceptional params
3133
no-ex-assign: 2
32-
## disallow unreachable code
33-
no-unreachable: 2
34-
## require valid typeof compared string like typeof foo === 'strnig'
35-
valid-typeof: 2
36-
## disallow controls characters in regular expressions
37-
no-control-regex: 2
3834
## disallow extra boolean casts
3935
no-extra-boolean-cast : 2
36+
## disallow superfluous semicolons
37+
no-extra-semi: 2
4038
## validate regular expressions
4139
no-invalid-regexp: 2
4240
## forbid weird whitespace characters
4341
no-irregular-whitespace: 2
4442
## avoid unexpected multiline expressions
4543
no-unexpected-multiline: 2
44+
## disallow unreachable code
45+
no-unreachable: 2
46+
## require valid typeof compared string like typeof foo === 'strnig'
47+
valid-typeof: 2
4648

4749
# Best Practices
4850
# list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices

0 commit comments

Comments
 (0)