@tcy/eslint-rules 1.10.0-beta.1 → 1.10.0-beta.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.
Files changed (40) hide show
  1. package/README.md +540 -6
  2. package/coverage/clover.xml +90 -75
  3. package/coverage/coverage-final.json +1 -1
  4. package/coverage/lcov-report/index.html +19 -19
  5. package/coverage/lcov-report/src/array-elements-per-line.js.html +1 -1
  6. package/coverage/lcov-report/src/back/back.js.html +1 -1
  7. package/coverage/lcov-report/src/back/http.js.html +1 -1
  8. package/coverage/lcov-report/src/back/index.html +1 -1
  9. package/coverage/lcov-report/src/back/recommended.js.html +1 -1
  10. package/coverage/lcov-report/src/bin/eslint-cache-guard.js.html +1 -1
  11. package/coverage/lcov-report/src/bin/index.html +1 -1
  12. package/coverage/lcov-report/src/client/client.js.html +1 -1
  13. package/coverage/lcov-report/src/client/index.html +1 -1
  14. package/coverage/lcov-report/src/client/recommended.js.html +1 -1
  15. package/coverage/lcov-report/src/consistent-const-scoping.js.html +237 -12
  16. package/coverage/lcov-report/src/decorator-type-enforcement.js.html +1 -1
  17. package/coverage/lcov-report/src/enforce-tailwind-important.js.html +1 -1
  18. package/coverage/lcov-report/src/export-specifiers-per-line.js.html +1 -1
  19. package/coverage/lcov-report/src/import-specifiers-per-line.js.html +1 -1
  20. package/coverage/lcov-report/src/index.html +20 -20
  21. package/coverage/lcov-report/src/index.js.html +1 -1
  22. package/coverage/lcov-report/src/jsx-boolean-shorthand.js.html +1 -1
  23. package/coverage/lcov-report/src/jsx-expression-string-literals.js.html +1 -1
  24. package/coverage/lcov-report/src/jsx-ref-string-exists.js.html +1 -1
  25. package/coverage/lcov-report/src/no-static-key-in-map.js.html +1 -1
  26. package/coverage/lcov-report/src/plugin.js.html +1 -1
  27. package/coverage/lcov-report/src/recommended.js.html +1 -1
  28. package/coverage/lcov-report/src/require-fragment-key.js.html +1 -1
  29. package/coverage/lcov-report/src/route-dto-required.js.html +1 -1
  30. package/coverage/lcov-report/src/v-model-name-match.js.html +1 -1
  31. package/coverage/lcov-report/src/vuejs-define-component.js.html +1 -1
  32. package/coverage/lcov-report/src/vuejs-define-workspace.js.html +1 -1
  33. package/coverage/lcov.info +248 -203
  34. package/decl/back/back.d.ts +14 -1
  35. package/decl/client/client.d.ts +14 -1
  36. package/decl/consistent-const-scoping.d.ts +37 -1
  37. package/decl/plugin.d.ts +14 -1
  38. package/package.json +1 -1
  39. package/src/consistent-const-scoping.js +76 -1
  40. package/tests/consistent-const-scoping.spec.js +50 -1
@@ -59,32 +59,35 @@ BRH:0
59
59
  end_of_record
60
60
  TN:
61
61
  SF:src/consistent-const-scoping.js
62
- FN:64,(anonymous_0)
63
- FN:88,(anonymous_1)
64
- FN:95,(anonymous_2)
65
- FN:114,(anonymous_3)
66
- FN:119,(anonymous_4)
67
- FN:123,(anonymous_5)
68
- FN:129,(anonymous_6)
69
- FN:155,(anonymous_7)
70
- FN:159,(anonymous_8)
71
- FN:173,(anonymous_9)
72
- FN:173,(anonymous_10)
73
- FN:174,(anonymous_11)
74
- FN:175,(anonymous_12)
75
- FN:179,(anonymous_13)
76
- FN:179,(anonymous_14)
77
- FN:182,(anonymous_15)
78
- FNF:16
79
- FNH:5
80
- FNDA:37,(anonymous_0)
81
- FNDA:7,(anonymous_1)
62
+ FN:95,(anonymous_0)
63
+ FN:103,(anonymous_1)
64
+ FN:121,(anonymous_2)
65
+ FN:124,(anonymous_3)
66
+ FN:148,(anonymous_4)
67
+ FN:155,(anonymous_5)
68
+ FN:174,(anonymous_6)
69
+ FN:179,(anonymous_7)
70
+ FN:183,(anonymous_8)
71
+ FN:189,(anonymous_9)
72
+ FN:228,(anonymous_10)
73
+ FN:233,(anonymous_11)
74
+ FN:247,(anonymous_12)
75
+ FN:247,(anonymous_13)
76
+ FN:248,(anonymous_14)
77
+ FN:249,(anonymous_15)
78
+ FN:253,(anonymous_16)
79
+ FN:253,(anonymous_17)
80
+ FN:256,(anonymous_18)
81
+ FNF:19
82
+ FNH:8
83
+ FNDA:18,(anonymous_0)
84
+ FNDA:15,(anonymous_1)
82
85
  FNDA:3,(anonymous_2)
83
- FNDA:8,(anonymous_3)
84
- FNDA:35,(anonymous_4)
85
- FNDA:0,(anonymous_5)
86
- FNDA:0,(anonymous_6)
87
- FNDA:0,(anonymous_7)
86
+ FNDA:37,(anonymous_3)
87
+ FNDA:7,(anonymous_4)
88
+ FNDA:3,(anonymous_5)
89
+ FNDA:8,(anonymous_6)
90
+ FNDA:35,(anonymous_7)
88
91
  FNDA:0,(anonymous_8)
89
92
  FNDA:0,(anonymous_9)
90
93
  FNDA:0,(anonymous_10)
@@ -93,188 +96,230 @@ FNDA:0,(anonymous_12)
93
96
  FNDA:0,(anonymous_13)
94
97
  FNDA:0,(anonymous_14)
95
98
  FNDA:0,(anonymous_15)
96
- DA:44,1
97
- DA:54,1
98
- DA:61,1
99
- DA:64,1
100
- DA:65,37
101
- DA:66,37
102
- DA:67,36
103
- DA:68,22
104
- DA:69,22
105
- DA:70,20
106
- DA:71,18
107
- DA:73,16
108
- DA:74,0
109
- DA:76,16
110
- DA:77,1
111
- DA:79,15
112
- DA:80,1
113
- DA:84,14
114
- DA:85,3
115
- DA:87,11
116
- DA:88,3
117
- DA:89,7
118
- DA:90,7
119
- DA:91,7
120
- DA:94,8
121
- DA:95,2
122
- DA:96,3
123
- DA:97,3
124
- DA:98,3
125
- DA:102,6
126
- DA:106,1
127
- DA:114,1
128
- DA:115,8
129
- DA:116,8
130
- DA:117,6
131
- DA:119,5
132
- DA:120,35
133
- DA:121,35
134
- DA:122,35
135
- DA:123,2
136
- DA:125,33
137
- DA:129,1
138
- DA:130,0
139
- DA:131,0
140
- DA:132,0
141
- DA:133,0
99
+ FNDA:0,(anonymous_16)
100
+ FNDA:0,(anonymous_17)
101
+ FNDA:0,(anonymous_18)
102
+ DA:55,1
103
+ DA:65,1
104
+ DA:72,1
105
+ DA:75,1
106
+ DA:85,1
107
+ DA:87,1
108
+ DA:95,18
109
+ DA:103,1
110
+ DA:104,15
111
+ DA:105,15
112
+ DA:106,15
113
+ DA:107,11
114
+ DA:108,4
115
+ DA:116,4
116
+ DA:117,0
117
+ DA:121,3
118
+ DA:124,1
119
+ DA:125,37
120
+ DA:126,37
121
+ DA:127,36
122
+ DA:128,22
123
+ DA:129,22
124
+ DA:130,20
125
+ DA:131,18
126
+ DA:133,16
142
127
  DA:134,0
143
- DA:156,0
144
- DA:159,0
145
- DA:160,0
146
- DA:161,0
147
- DA:162,0
148
- DA:164,0
149
- DA:165,0
150
- DA:166,0
151
- DA:167,0
152
- DA:170,0
153
- DA:173,0
154
- DA:174,0
155
- DA:175,0
156
- DA:179,0
157
- DA:181,0
158
- DA:183,0
159
- DA:184,0
160
- DA:186,0
161
- DA:187,0
162
- DA:189,0
128
+ DA:136,16
129
+ DA:137,1
130
+ DA:139,15
131
+ DA:140,1
132
+ DA:144,14
133
+ DA:145,3
134
+ DA:147,11
135
+ DA:148,3
136
+ DA:149,7
137
+ DA:150,7
138
+ DA:151,7
139
+ DA:154,8
140
+ DA:155,2
141
+ DA:156,3
142
+ DA:157,3
143
+ DA:158,3
144
+ DA:162,6
145
+ DA:166,1
146
+ DA:174,1
147
+ DA:175,8
148
+ DA:176,8
149
+ DA:177,6
150
+ DA:179,5
151
+ DA:180,35
152
+ DA:181,35
153
+ DA:182,35
154
+ DA:183,2
155
+ DA:185,33
156
+ DA:189,1
163
157
  DA:190,0
164
158
  DA:191,0
159
+ DA:192,0
165
160
  DA:193,0
166
- DA:195,0
167
- LF:71
168
- LH:41
169
- BRDA:65,0,0,0
170
- BRDA:65,0,1,37
171
- BRDA:66,1,0,1
172
- BRDA:66,1,1,36
173
- BRDA:66,2,0,37
174
- BRDA:66,2,1,36
175
- BRDA:67,3,0,14
176
- BRDA:67,3,1,22
177
- BRDA:68,4,0,0
178
- BRDA:68,4,1,22
179
- BRDA:69,5,0,2
180
- BRDA:69,5,1,20
181
- BRDA:70,6,0,2
182
- BRDA:70,6,1,18
183
- BRDA:71,7,0,2
184
- BRDA:71,7,1,16
185
- BRDA:73,8,0,0
186
- BRDA:73,8,1,16
187
- BRDA:74,9,0,0
188
- BRDA:74,9,1,0
189
- BRDA:76,10,0,1
190
- BRDA:76,10,1,15
191
- BRDA:76,11,0,16
192
- BRDA:76,11,1,15
193
- BRDA:77,12,0,1
194
- BRDA:77,12,1,1
195
- BRDA:79,13,0,1
196
- BRDA:79,13,1,14
197
- BRDA:80,14,0,1
198
- BRDA:80,14,1,1
199
- BRDA:80,14,2,1
200
- BRDA:84,15,0,3
201
- BRDA:84,15,1,11
202
- BRDA:84,16,0,14
203
- BRDA:84,16,1,11
204
- BRDA:85,17,0,3
205
- BRDA:85,17,1,2
206
- BRDA:85,17,2,0
207
- BRDA:87,18,0,3
208
- BRDA:87,18,1,8
209
- BRDA:89,19,0,0
210
- BRDA:89,19,1,7
211
- BRDA:90,20,0,0
212
- BRDA:90,20,1,7
213
- BRDA:94,21,0,2
214
- BRDA:94,21,1,6
215
- BRDA:96,22,0,0
216
- BRDA:96,22,1,3
217
- BRDA:97,23,0,0
218
- BRDA:97,23,1,3
219
- BRDA:97,24,0,3
220
- BRDA:97,24,1,0
221
- BRDA:115,25,0,0
222
- BRDA:115,25,1,8
223
- BRDA:115,26,0,8
224
- BRDA:115,26,1,8
225
- BRDA:116,27,0,2
226
- BRDA:116,27,1,6
227
- BRDA:116,28,0,8
228
- BRDA:116,28,1,6
229
- BRDA:117,29,0,1
230
- BRDA:117,29,1,5
231
- BRDA:120,30,0,0
232
- BRDA:120,30,1,35
233
- BRDA:122,31,0,2
234
- BRDA:122,31,1,33
235
- BRDA:123,32,0,0
236
- BRDA:123,32,1,0
237
- BRDA:123,32,2,0
238
- BRDA:125,33,0,33
239
- BRDA:125,33,1,27
240
- BRDA:125,33,2,4
241
- BRDA:130,34,0,0
242
- BRDA:130,34,1,0
243
- BRDA:132,35,0,0
244
- BRDA:132,35,1,0
245
- BRDA:132,36,0,0
246
- BRDA:132,36,1,0
247
- BRDA:133,37,0,0
248
- BRDA:133,37,1,0
249
- BRDA:133,38,0,0
250
- BRDA:133,38,1,0
251
- BRDA:164,39,0,0
252
- BRDA:164,39,1,0
253
- BRDA:164,39,2,0
254
- BRDA:166,40,0,0
255
- BRDA:166,40,1,0
256
- BRDA:170,41,0,0
257
- BRDA:170,41,1,0
258
- BRDA:175,42,0,0
259
- BRDA:175,42,1,0
260
- BRDA:183,43,0,0
261
- BRDA:183,43,1,0
262
- BRDA:183,44,0,0
263
- BRDA:183,44,1,0
264
- BRDA:184,45,0,0
265
- BRDA:184,45,1,0
266
- BRDA:184,46,0,0
267
- BRDA:184,46,1,0
268
- BRDA:187,47,0,0
269
- BRDA:187,47,1,0
270
- BRDA:189,48,0,0
271
- BRDA:189,48,1,0
272
- BRDA:190,49,0,0
273
- BRDA:190,49,1,0
274
- BRDA:191,50,0,0
275
- BRDA:191,50,1,0
276
- BRF:107
277
- BRH:56
161
+ DA:194,0
162
+ DA:229,0
163
+ DA:230,0
164
+ DA:233,0
165
+ DA:234,0
166
+ DA:235,0
167
+ DA:236,0
168
+ DA:238,0
169
+ DA:239,0
170
+ DA:240,0
171
+ DA:241,0
172
+ DA:244,0
173
+ DA:247,0
174
+ DA:248,0
175
+ DA:249,0
176
+ DA:253,0
177
+ DA:255,0
178
+ DA:257,0
179
+ DA:258,0
180
+ DA:260,0
181
+ DA:261,0
182
+ DA:263,0
183
+ DA:264,0
184
+ DA:265,0
185
+ DA:266,0
186
+ DA:268,0
187
+ DA:270,0
188
+ LF:86
189
+ LH:53
190
+ BRDA:95,0,0,3
191
+ BRDA:95,0,1,15
192
+ BRDA:95,1,0,18
193
+ BRDA:95,1,1,18
194
+ BRDA:105,2,0,0
195
+ BRDA:105,2,1,15
196
+ BRDA:106,3,0,4
197
+ BRDA:106,3,1,11
198
+ BRDA:107,4,0,7
199
+ BRDA:107,4,1,4
200
+ BRDA:108,5,0,4
201
+ BRDA:108,5,1,0
202
+ BRDA:109,6,0,4
203
+ BRDA:109,6,1,3
204
+ BRDA:109,6,2,3
205
+ BRDA:109,6,3,2
206
+ BRDA:109,6,4,2
207
+ BRDA:109,6,5,1
208
+ BRDA:109,6,6,0
209
+ BRDA:121,7,0,3
210
+ BRDA:121,7,1,1
211
+ BRDA:121,7,2,2
212
+ BRDA:125,8,0,0
213
+ BRDA:125,8,1,37
214
+ BRDA:126,9,0,1
215
+ BRDA:126,9,1,36
216
+ BRDA:126,10,0,37
217
+ BRDA:126,10,1,36
218
+ BRDA:127,11,0,14
219
+ BRDA:127,11,1,22
220
+ BRDA:128,12,0,0
221
+ BRDA:128,12,1,22
222
+ BRDA:129,13,0,2
223
+ BRDA:129,13,1,20
224
+ BRDA:130,14,0,2
225
+ BRDA:130,14,1,18
226
+ BRDA:131,15,0,2
227
+ BRDA:131,15,1,16
228
+ BRDA:133,16,0,0
229
+ BRDA:133,16,1,16
230
+ BRDA:134,17,0,0
231
+ BRDA:134,17,1,0
232
+ BRDA:136,18,0,1
233
+ BRDA:136,18,1,15
234
+ BRDA:136,19,0,16
235
+ BRDA:136,19,1,15
236
+ BRDA:137,20,0,1
237
+ BRDA:137,20,1,1
238
+ BRDA:139,21,0,1
239
+ BRDA:139,21,1,14
240
+ BRDA:140,22,0,1
241
+ BRDA:140,22,1,1
242
+ BRDA:140,22,2,1
243
+ BRDA:144,23,0,3
244
+ BRDA:144,23,1,11
245
+ BRDA:144,24,0,14
246
+ BRDA:144,24,1,11
247
+ BRDA:145,25,0,3
248
+ BRDA:145,25,1,2
249
+ BRDA:145,25,2,0
250
+ BRDA:147,26,0,3
251
+ BRDA:147,26,1,8
252
+ BRDA:149,27,0,0
253
+ BRDA:149,27,1,7
254
+ BRDA:150,28,0,0
255
+ BRDA:150,28,1,7
256
+ BRDA:154,29,0,2
257
+ BRDA:154,29,1,6
258
+ BRDA:156,30,0,0
259
+ BRDA:156,30,1,3
260
+ BRDA:157,31,0,0
261
+ BRDA:157,31,1,3
262
+ BRDA:157,32,0,3
263
+ BRDA:157,32,1,0
264
+ BRDA:175,33,0,0
265
+ BRDA:175,33,1,8
266
+ BRDA:175,34,0,8
267
+ BRDA:175,34,1,8
268
+ BRDA:176,35,0,2
269
+ BRDA:176,35,1,6
270
+ BRDA:176,36,0,8
271
+ BRDA:176,36,1,6
272
+ BRDA:177,37,0,1
273
+ BRDA:177,37,1,5
274
+ BRDA:180,38,0,0
275
+ BRDA:180,38,1,35
276
+ BRDA:182,39,0,2
277
+ BRDA:182,39,1,33
278
+ BRDA:183,40,0,0
279
+ BRDA:183,40,1,0
280
+ BRDA:183,40,2,0
281
+ BRDA:185,41,0,33
282
+ BRDA:185,41,1,27
283
+ BRDA:185,41,2,4
284
+ BRDA:190,42,0,0
285
+ BRDA:190,42,1,0
286
+ BRDA:192,43,0,0
287
+ BRDA:192,43,1,0
288
+ BRDA:192,44,0,0
289
+ BRDA:192,44,1,0
290
+ BRDA:193,45,0,0
291
+ BRDA:193,45,1,0
292
+ BRDA:193,46,0,0
293
+ BRDA:193,46,1,0
294
+ BRDA:238,47,0,0
295
+ BRDA:238,47,1,0
296
+ BRDA:238,47,2,0
297
+ BRDA:240,48,0,0
298
+ BRDA:240,48,1,0
299
+ BRDA:244,49,0,0
300
+ BRDA:244,49,1,0
301
+ BRDA:249,50,0,0
302
+ BRDA:249,50,1,0
303
+ BRDA:257,51,0,0
304
+ BRDA:257,51,1,0
305
+ BRDA:257,52,0,0
306
+ BRDA:257,52,1,0
307
+ BRDA:258,53,0,0
308
+ BRDA:258,53,1,0
309
+ BRDA:258,54,0,0
310
+ BRDA:258,54,1,0
311
+ BRDA:261,55,0,0
312
+ BRDA:261,55,1,0
313
+ BRDA:263,56,0,0
314
+ BRDA:263,56,1,0
315
+ BRDA:264,57,0,0
316
+ BRDA:264,57,1,0
317
+ BRDA:265,58,0,0
318
+ BRDA:265,58,1,0
319
+ BRDA:266,59,0,0
320
+ BRDA:266,59,1,0
321
+ BRF:131
322
+ BRH:75
278
323
  end_of_record
279
324
  TN:
280
325
  SF:src/decorator-type-enforcement.js
@@ -253,7 +253,20 @@ declare const _default: {
253
253
  description: string;
254
254
  recommended: boolean;
255
255
  };
256
- schema: never[];
256
+ schema: {
257
+ type: string;
258
+ properties: {
259
+ types: {
260
+ type: string;
261
+ items: {
262
+ enum: string[];
263
+ };
264
+ uniqueItems: boolean;
265
+ default: string[];
266
+ };
267
+ };
268
+ additionalProperties: boolean;
269
+ }[];
257
270
  messages: {
258
271
  hoistable: string;
259
272
  };
@@ -253,7 +253,20 @@ declare const _default: {
253
253
  description: string;
254
254
  recommended: boolean;
255
255
  };
256
- schema: never[];
256
+ schema: {
257
+ type: string;
258
+ properties: {
259
+ types: {
260
+ type: string;
261
+ items: {
262
+ enum: string[];
263
+ };
264
+ uniqueItems: boolean;
265
+ default: string[];
266
+ };
267
+ };
268
+ additionalProperties: boolean;
269
+ }[];
257
270
  messages: {
258
271
  hoistable: string;
259
272
  };
@@ -39,7 +39,30 @@
39
39
  * - the initializer reads a parameter, an outer local, `this`, `super`,
40
40
  * or `arguments` — moving it would change what it reads
41
41
  * - the initializer is not provably side-effect-free (see above)
42
+ *
43
+ * Which *shape* of initializer gets flagged is configurable via the `types`
44
+ * option, so different parts of a codebase can opt into different strictness
45
+ * levels (e.g. only arrow functions in most folders, arrow functions +
46
+ * primitives in a folder that wants to be stricter):
47
+ *
48
+ * 'consistent-const-scoping': ['error', { types: ['arrow-function', 'primitive'] }]
49
+ *
50
+ * Recognized values: 'primitive', 'template-literal', 'expression' (identifier /
51
+ * unary / binary / logical / conditional / member access), 'array', 'object',
52
+ * 'arrow-function', 'function-expression'. Defaults to `['arrow-function']`.
53
+ */
54
+ /** All initializer categories the `types` option can select. */
55
+ export declare const ALL_INIT_TYPES: string[];
56
+ export declare const DEFAULT_INIT_TYPES: string[];
57
+ /**
58
+ * Which `types` category a (already known-pure) initializer belongs to, after
59
+ * unwrapping the same `as` / `!` / `satisfies` / parens wrappers the purity
60
+ * check sees through. `null` for a node that isn't a recognized initializer
61
+ * shape at all.
42
62
  */
63
+ export declare const classifyInit: (node: any) => any;
64
+ /** Build the set of enabled initializer categories from the rule options. */
65
+ export declare const resolveInitTypes: (options: any) => Set<any>;
43
66
  /** A value that evaluates the same way, with no side effects, wherever it runs. */
44
67
  export declare const isPureExpression: (node: any) => any;
45
68
  /** Does `node` contain a `this` / `super` that would resolve outside of it (through arrow boundaries only)? */
@@ -51,7 +74,20 @@ declare const _default: {
51
74
  description: string;
52
75
  recommended: boolean;
53
76
  };
54
- schema: never[];
77
+ schema: {
78
+ type: string;
79
+ properties: {
80
+ types: {
81
+ type: string;
82
+ items: {
83
+ enum: string[];
84
+ };
85
+ uniqueItems: boolean;
86
+ default: string[];
87
+ };
88
+ };
89
+ additionalProperties: boolean;
90
+ }[];
55
91
  messages: {
56
92
  hoistable: string;
57
93
  };
package/decl/plugin.d.ts CHANGED
@@ -250,7 +250,20 @@ declare const _default: {
250
250
  description: string;
251
251
  recommended: boolean;
252
252
  };
253
- schema: never[];
253
+ schema: {
254
+ type: string;
255
+ properties: {
256
+ types: {
257
+ type: string;
258
+ items: {
259
+ enum: string[];
260
+ };
261
+ uniqueItems: boolean;
262
+ default: string[];
263
+ };
264
+ };
265
+ additionalProperties: boolean;
266
+ }[];
254
267
  messages: {
255
268
  hoistable: string;
256
269
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tcy/eslint-rules",
3
- "version": "1.10.0-beta.1",
3
+ "version": "1.10.0-beta.2",
4
4
  "description": "```typescript import { plugin as customRules } from 'tcy@eslint-rules/src/index.mjs';",
5
5
  "homepage": "https://github.com/tcastelly/eslint-rules#readme",
6
6
  "bugs": {