forked from gajus/eslint-config-canonical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regexp.js
66 lines (66 loc) · 2.34 KB
/
regexp.js
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
/**
* https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/recommended.ts
*/
module.exports.recommended = {
files: ['**/*.{js,jsx,cjs,mjs,ts,tsx}'],
plugins: {
regexp: require('eslint-plugin-regexp'),
},
rules: {
'no-control-regex': 2,
'no-empty-character-class': 0,
'no-invalid-regexp': 'off',
'no-misleading-character-class': 2,
'no-regex-spaces': 2,
'no-useless-backreference': 'off',
'prefer-regex-literals': 2,
'regexp/confusing-quantifier': 'warn',
'regexp/control-character-escape': 2,
'regexp/match-any': 2,
'regexp/negation': 2,
'regexp/no-dupe-characters-character-class': 2,
'regexp/no-dupe-disjunctions': 2,
'regexp/no-empty-alternative': 'warn',
'regexp/no-empty-capturing-group': 2,
'regexp/no-empty-group': 2,
'regexp/no-empty-lookarounds-assertion': 2,
'regexp/no-escape-backspace': 2,
'regexp/no-invalid-regexp': 2,
'regexp/no-invisible-character': 2,
'regexp/no-lazy-ends': 'warn',
'regexp/no-legacy-features': 2,
'regexp/no-non-standard-flag': 2,
'regexp/no-obscure-range': 2,
'regexp/no-optional-assertion': 2,
'regexp/no-potentially-useless-backreference': 'warn',
'regexp/no-super-linear-backtracking': 2,
'regexp/no-trivially-nested-assertion': 2,
'regexp/no-trivially-nested-quantifier': 2,
'regexp/no-unused-capturing-group': 2,
'regexp/no-useless-assertions': 2,
'regexp/no-useless-backreference': 2,
'regexp/no-useless-character-class': 2,
'regexp/no-useless-dollar-replacements': 2,
'regexp/no-useless-escape': 2,
'regexp/no-useless-flag': 'warn',
'regexp/no-useless-lazy': 2,
'regexp/no-useless-non-capturing-group': 2,
'regexp/no-useless-quantifier': 2,
'regexp/no-useless-range': 2,
'regexp/no-useless-two-nums-quantifier': 2,
'regexp/no-zero-quantifier': 2,
'regexp/optimal-lookaround-quantifier': 'warn',
'regexp/optimal-quantifier-concatenation': 2,
'regexp/prefer-character-class': 2,
'regexp/prefer-d': 2,
'regexp/prefer-plus-quantifier': 2,
'regexp/prefer-predefined-assertion': 2,
'regexp/prefer-question-quantifier': 2,
'regexp/prefer-range': 2,
'regexp/prefer-star-quantifier': 2,
'regexp/prefer-unicode-codepoint-escapes': 2,
'regexp/prefer-w': 2,
'regexp/sort-flags': 2,
'regexp/strict': 2,
},
};