@alexlit/config-eslint 41.0.1 → 41.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -1
- package/CHANGELOG.md +8 -0
- package/dictionaries/default.js +38 -2
- package/package.json +2 -2
- package/plugins/typescript/allow-boolean-property-list.const.js +38 -0
- package/plugins/typescript/boolean-prefixes.const.js +11 -0
- package/plugins/typescript/english-verbs.const.js +3357 -0
- package/plugins/{typescript.js → typescript/index.js} +36 -100
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
const ALLOW_BOOLEAN_PROPERTY_LIST = require('./allow-boolean-property-list.const');
|
|
2
|
+
const BOOLEAN_PREFIXES = require('./boolean-prefixes.const');
|
|
3
|
+
const ENGLISH_VERBS = require('./english-verbs.const');
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
|
|
3
7
|
*/
|
|
@@ -36,92 +40,13 @@ module.exports = {
|
|
|
36
40
|
|
|
37
41
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
38
42
|
|
|
39
|
-
// delegate to sort-class-members plugin
|
|
40
|
-
'@typescript-eslint/member-ordering': [
|
|
41
|
-
'off',
|
|
42
|
-
{
|
|
43
|
-
default: {
|
|
44
|
-
memberTypes: [
|
|
45
|
-
// Index signature
|
|
46
|
-
'signature',
|
|
47
|
-
|
|
48
|
-
// Fields
|
|
49
|
-
'public-static-field',
|
|
50
|
-
'protected-static-field',
|
|
51
|
-
'private-static-field',
|
|
52
|
-
|
|
53
|
-
'public-decorated-field',
|
|
54
|
-
'protected-decorated-field',
|
|
55
|
-
'private-decorated-field',
|
|
56
|
-
|
|
57
|
-
'public-instance-field',
|
|
58
|
-
'protected-instance-field',
|
|
59
|
-
'private-instance-field',
|
|
60
|
-
|
|
61
|
-
'public-abstract-field',
|
|
62
|
-
'protected-abstract-field',
|
|
63
|
-
'private-abstract-field',
|
|
64
|
-
|
|
65
|
-
'public-field',
|
|
66
|
-
'protected-field',
|
|
67
|
-
'private-field',
|
|
68
|
-
|
|
69
|
-
'static-field',
|
|
70
|
-
'instance-field',
|
|
71
|
-
'abstract-field',
|
|
72
|
-
|
|
73
|
-
'decorated-field',
|
|
74
|
-
|
|
75
|
-
'field',
|
|
76
|
-
|
|
77
|
-
// Constructors
|
|
78
|
-
'public-constructor',
|
|
79
|
-
'protected-constructor',
|
|
80
|
-
'private-constructor',
|
|
81
|
-
|
|
82
|
-
'constructor',
|
|
83
|
-
|
|
84
|
-
// Methods
|
|
85
|
-
'public-static-method',
|
|
86
|
-
'protected-static-method',
|
|
87
|
-
'private-static-method',
|
|
88
|
-
|
|
89
|
-
'public-decorated-method',
|
|
90
|
-
'protected-decorated-method',
|
|
91
|
-
'private-decorated-method',
|
|
92
|
-
|
|
93
|
-
'public-instance-method',
|
|
94
|
-
'protected-instance-method',
|
|
95
|
-
'private-instance-method',
|
|
96
|
-
|
|
97
|
-
'public-abstract-method',
|
|
98
|
-
'protected-abstract-method',
|
|
99
|
-
'private-abstract-method',
|
|
100
|
-
|
|
101
|
-
'public-method',
|
|
102
|
-
'protected-method',
|
|
103
|
-
'private-method',
|
|
104
|
-
|
|
105
|
-
'static-method',
|
|
106
|
-
'instance-method',
|
|
107
|
-
'abstract-method',
|
|
108
|
-
|
|
109
|
-
'decorated-method',
|
|
110
|
-
|
|
111
|
-
'method',
|
|
112
|
-
],
|
|
113
|
-
|
|
114
|
-
order: 'alphabetically',
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
],
|
|
43
|
+
'@typescript-eslint/member-ordering': 'off', // delegate to sort-class-members plugin
|
|
118
44
|
|
|
119
45
|
'@typescript-eslint/method-signature-style': ['error', 'method'],
|
|
120
46
|
|
|
121
47
|
'@typescript-eslint/naming-convention': [
|
|
122
48
|
'error',
|
|
123
49
|
|
|
124
|
-
// ESLint's camelCase conventions
|
|
125
50
|
{
|
|
126
51
|
format: ['camelCase'],
|
|
127
52
|
selector: 'default',
|
|
@@ -143,10 +68,9 @@ module.exports = {
|
|
|
143
68
|
},
|
|
144
69
|
{
|
|
145
70
|
format: ['PascalCase'],
|
|
146
|
-
selector: 'typeLike',
|
|
71
|
+
selector: ['typeLike', 'enumMember'],
|
|
147
72
|
},
|
|
148
73
|
|
|
149
|
-
// interface
|
|
150
74
|
{
|
|
151
75
|
custom: {
|
|
152
76
|
match: false,
|
|
@@ -157,27 +81,23 @@ module.exports = {
|
|
|
157
81
|
selector: 'interface',
|
|
158
82
|
},
|
|
159
83
|
|
|
160
|
-
// objectLiteralProperty
|
|
161
84
|
{
|
|
162
|
-
format: ['camelCase', 'UPPER_CASE', 'PascalCase'
|
|
85
|
+
format: ['camelCase', 'UPPER_CASE', 'PascalCase' /* 'snake_case' */],
|
|
163
86
|
leadingUnderscore: 'allow',
|
|
164
87
|
selector: 'objectLiteralProperty',
|
|
165
88
|
},
|
|
166
89
|
|
|
167
|
-
// objectLiteralMethod
|
|
168
90
|
{
|
|
169
91
|
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
170
92
|
selector: 'objectLiteralMethod',
|
|
171
93
|
},
|
|
172
94
|
|
|
173
|
-
// parameter
|
|
174
95
|
{
|
|
175
96
|
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
176
97
|
modifiers: ['destructured'],
|
|
177
98
|
selector: 'parameter',
|
|
178
99
|
},
|
|
179
100
|
|
|
180
|
-
// variable
|
|
181
101
|
{
|
|
182
102
|
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
183
103
|
modifiers: ['const'],
|
|
@@ -191,24 +111,40 @@ module.exports = {
|
|
|
191
111
|
},
|
|
192
112
|
|
|
193
113
|
{
|
|
114
|
+
filter: {
|
|
115
|
+
match: false,
|
|
116
|
+
regex: `(${ALLOW_BOOLEAN_PROPERTY_LIST.join('|')})`,
|
|
117
|
+
},
|
|
118
|
+
|
|
194
119
|
format: ['PascalCase'],
|
|
195
120
|
|
|
121
|
+
leadingUnderscore: 'allow',
|
|
122
|
+
|
|
123
|
+
prefix: BOOLEAN_PREFIXES,
|
|
124
|
+
|
|
125
|
+
selector: ['variable', 'parameter', 'property', 'accessor'],
|
|
126
|
+
|
|
127
|
+
types: ['boolean'],
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
{
|
|
131
|
+
format: ['PascalCase'],
|
|
132
|
+
|
|
133
|
+
leadingUnderscore: 'allow',
|
|
134
|
+
|
|
196
135
|
prefix: [
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
'
|
|
201
|
-
'has',
|
|
202
|
-
'is',
|
|
203
|
-
'may',
|
|
204
|
-
'must',
|
|
205
|
-
'need',
|
|
206
|
-
'should',
|
|
207
|
-
'will',
|
|
136
|
+
...ENGLISH_VERBS,
|
|
137
|
+
...ENGLISH_VERBS.map((verb) => `re${verb}`),
|
|
138
|
+
|
|
139
|
+
'on',
|
|
208
140
|
],
|
|
209
141
|
|
|
210
|
-
selector: [
|
|
211
|
-
|
|
142
|
+
selector: [
|
|
143
|
+
'function',
|
|
144
|
+
'classMethod',
|
|
145
|
+
// 'objectLiteralMethod',
|
|
146
|
+
// 'typeMethod',
|
|
147
|
+
],
|
|
212
148
|
},
|
|
213
149
|
],
|
|
214
150
|
|