-
Notifications
You must be signed in to change notification settings - Fork 10
/
recommended.ts
75 lines (73 loc) · 3.15 KB
/
recommended.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type { SeverityString } from "../../types"
export const rules: Record<string, SeverityString> = {
// ESLint core rules
"no-control-regex": "error",
"no-misleading-character-class": "error",
"no-regex-spaces": "error",
"prefer-regex-literals": "error",
// The ESLint rule will report fewer cases than our rule
"no-invalid-regexp": "off",
"no-useless-backreference": "off",
"no-empty-character-class": "off",
// eslint-plugin-regexp rules
"regexp/confusing-quantifier": "warn",
"regexp/control-character-escape": "error",
"regexp/match-any": "error",
"regexp/negation": "error",
"regexp/no-contradiction-with-assertion": "error",
"regexp/no-dupe-characters-character-class": "error",
"regexp/no-dupe-disjunctions": "error",
"regexp/no-empty-alternative": "warn",
"regexp/no-empty-capturing-group": "error",
"regexp/no-empty-character-class": "error",
"regexp/no-empty-group": "error",
"regexp/no-empty-lookarounds-assertion": "error",
"regexp/no-empty-string-literal": "error",
"regexp/no-escape-backspace": "error",
"regexp/no-extra-lookaround-assertions": "error",
"regexp/no-invalid-regexp": "error",
"regexp/no-invisible-character": "error",
"regexp/no-lazy-ends": "warn",
"regexp/no-legacy-features": "error",
"regexp/no-misleading-capturing-group": "error",
"regexp/no-misleading-unicode-character": "error",
"regexp/no-missing-g-flag": "error",
"regexp/no-non-standard-flag": "error",
"regexp/no-obscure-range": "error",
"regexp/no-optional-assertion": "error",
"regexp/no-potentially-useless-backreference": "warn",
"regexp/no-super-linear-backtracking": "error",
"regexp/no-trivially-nested-assertion": "error",
"regexp/no-trivially-nested-quantifier": "error",
"regexp/no-unused-capturing-group": "error",
"regexp/no-useless-assertions": "error",
"regexp/no-useless-backreference": "error",
"regexp/no-useless-character-class": "error",
"regexp/no-useless-dollar-replacements": "error",
"regexp/no-useless-escape": "error",
"regexp/no-useless-flag": "warn",
"regexp/no-useless-lazy": "error",
"regexp/no-useless-non-capturing-group": "error",
"regexp/no-useless-quantifier": "error",
"regexp/no-useless-range": "error",
"regexp/no-useless-set-operand": "error",
"regexp/no-useless-string-literal": "error",
"regexp/no-useless-two-nums-quantifier": "error",
"regexp/no-zero-quantifier": "error",
"regexp/optimal-lookaround-quantifier": "warn",
"regexp/optimal-quantifier-concatenation": "error",
"regexp/prefer-character-class": "error",
"regexp/prefer-d": "error",
"regexp/prefer-plus-quantifier": "error",
"regexp/prefer-predefined-assertion": "error",
"regexp/prefer-question-quantifier": "error",
"regexp/prefer-range": "error",
"regexp/prefer-set-operation": "error",
"regexp/prefer-star-quantifier": "error",
"regexp/prefer-unicode-codepoint-escapes": "error",
"regexp/prefer-w": "error",
"regexp/simplify-set-operations": "error",
"regexp/sort-flags": "error",
"regexp/strict": "error",
"regexp/use-ignore-case": "error",
}