@pobammer-ts/eslint-cease-nonsense-rules 0.0.0 → 0.2.0
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/README.md +2 -0
- package/dist/rules/enforce-ianitor-check-type.js +221 -130
- package/dist/rules/enforce-ianitor-check-type.js.map +1 -1
- package/dist/rules/no-color3-constructor.js +46 -15
- package/dist/rules/no-color3-constructor.js.map +1 -1
- package/dist/rules/no-print.d.ts +1 -1
- package/dist/rules/no-print.js +2 -4
- package/dist/rules/no-print.js.map +1 -1
- package/dist/rules/no-shorthand-names.js +106 -69
- package/dist/rules/no-shorthand-names.js.map +1 -1
- package/dist/rules/no-warn.d.ts +1 -1
- package/dist/rules/no-warn.js +2 -4
- package/dist/rules/no-warn.js.map +1 -1
- package/dist/rules/require-react-component-keys.js +106 -23
- package/dist/rules/require-react-component-keys.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,13 +15,10 @@ const DEFAULT_CONFIG = {
|
|
|
15
15
|
* @returns True if the node has a type annotation.
|
|
16
16
|
*/
|
|
17
17
|
function hasTypeAnnotation(node) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return !!
|
|
22
|
-
}
|
|
23
|
-
if (nodeObj.type === "FunctionDeclaration" || nodeObj.type === "FunctionExpression")
|
|
24
|
-
return !!nodeObj.returnType;
|
|
18
|
+
if (node.type === "VariableDeclarator" && node.id && typeof node.id === "object" && "typeAnnotation" in node.id)
|
|
19
|
+
return !!node.id.typeAnnotation;
|
|
20
|
+
if (node.type === "FunctionDeclaration" || node.type === "FunctionExpression")
|
|
21
|
+
return !!node.returnType;
|
|
25
22
|
return false;
|
|
26
23
|
}
|
|
27
24
|
/**
|
|
@@ -31,11 +28,7 @@ function hasTypeAnnotation(node) {
|
|
|
31
28
|
* @returns The type name or null if not applicable.
|
|
32
29
|
*/
|
|
33
30
|
function getTypeName(node) {
|
|
34
|
-
|
|
35
|
-
return node.id.name;
|
|
36
|
-
if (node.type === "TSTypeAliasDeclaration")
|
|
37
|
-
return node.id.name;
|
|
38
|
-
return null;
|
|
31
|
+
return node.type === "TSInterfaceDeclaration" || node.type === "TSTypeAliasDeclaration" ? node.id.name : null;
|
|
39
32
|
}
|
|
40
33
|
/**
|
|
41
34
|
* Checks if a node is an Ianitor validator call.
|
|
@@ -44,15 +37,37 @@ function getTypeName(node) {
|
|
|
44
37
|
* @returns True if the node is an Ianitor validator.
|
|
45
38
|
*/
|
|
46
39
|
function isIanitorValidator(node) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
return (node.type === "CallExpression" &&
|
|
41
|
+
node.callee?.type === "MemberExpression" &&
|
|
42
|
+
node.callee.object?.type === "Identifier" &&
|
|
43
|
+
node.callee.object.name === "Ianitor");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Checks if a type annotation uses the Ianitor.Static<typeof ...> pattern.
|
|
47
|
+
*
|
|
48
|
+
* @param typeAnnotation - The TypeScript type annotation to check.
|
|
49
|
+
* @returns True if the type uses Ianitor.Static pattern.
|
|
50
|
+
*/
|
|
51
|
+
function hasIanitorStaticType(typeAnnotation) {
|
|
52
|
+
let currentType = typeAnnotation;
|
|
53
|
+
// Handle Readonly<...> wrapper
|
|
54
|
+
if (currentType.type === "TSTypeReference" &&
|
|
55
|
+
currentType.typeName.type === "Identifier" &&
|
|
56
|
+
currentType.typeName.name === "Readonly" &&
|
|
57
|
+
currentType.typeArguments?.params[0]) {
|
|
58
|
+
currentType = currentType.typeArguments.params[0];
|
|
54
59
|
}
|
|
55
|
-
|
|
60
|
+
// Check for Ianitor.Static<typeof ...>
|
|
61
|
+
if (currentType.type !== "TSTypeReference")
|
|
62
|
+
return false;
|
|
63
|
+
const { typeName, typeArguments } = currentType;
|
|
64
|
+
const firstParam = typeArguments?.params[0];
|
|
65
|
+
return (typeName.type === "TSQualifiedName" &&
|
|
66
|
+
typeName.left.type === "Identifier" &&
|
|
67
|
+
typeName.left.name === "Ianitor" &&
|
|
68
|
+
typeName.right.type === "Identifier" &&
|
|
69
|
+
typeName.right.name === "Static" &&
|
|
70
|
+
firstParam?.type === "TSTypeQuery");
|
|
56
71
|
}
|
|
57
72
|
/**
|
|
58
73
|
* Calculates the complexity score of an Ianitor validator.
|
|
@@ -61,46 +76,34 @@ function isIanitorValidator(node) {
|
|
|
61
76
|
* @returns The complexity score.
|
|
62
77
|
*/
|
|
63
78
|
function calculateIanitorComplexity(node) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// Skip recursive property calculation for now to avoid type issues
|
|
74
|
-
if (props && props.type === "ObjectExpression")
|
|
75
|
-
score = 10 + (props.properties?.length || 0) * 3;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
case "optional":
|
|
79
|
-
case "array":
|
|
80
|
-
score = 2;
|
|
81
|
-
break;
|
|
82
|
-
case "record":
|
|
83
|
-
case "map":
|
|
84
|
-
score = 3;
|
|
85
|
-
break;
|
|
86
|
-
case "union":
|
|
87
|
-
case "intersection":
|
|
88
|
-
score = (callNode.arguments?.length || 0) * 2;
|
|
89
|
-
break;
|
|
90
|
-
case "string":
|
|
91
|
-
case "number":
|
|
92
|
-
case "boolean":
|
|
93
|
-
score = 1;
|
|
94
|
-
break;
|
|
95
|
-
case "instanceIsA":
|
|
96
|
-
case "instanceOf":
|
|
97
|
-
score = 2;
|
|
98
|
-
break;
|
|
99
|
-
default:
|
|
100
|
-
score = 1;
|
|
79
|
+
const callee = node.callee;
|
|
80
|
+
if (callee?.type !== "MemberExpression" || callee.property?.type !== "Identifier")
|
|
81
|
+
return 0;
|
|
82
|
+
const method = callee.property.name;
|
|
83
|
+
switch (method) {
|
|
84
|
+
case "interface":
|
|
85
|
+
case "strictInterface": {
|
|
86
|
+
const props = node.arguments?.[0];
|
|
87
|
+
return props?.type === "ObjectExpression" ? 10 + (props.properties?.length || 0) * 3 : 0;
|
|
101
88
|
}
|
|
89
|
+
case "optional":
|
|
90
|
+
case "array":
|
|
91
|
+
case "instanceIsA":
|
|
92
|
+
case "instanceOf":
|
|
93
|
+
return 2;
|
|
94
|
+
case "record":
|
|
95
|
+
case "map":
|
|
96
|
+
return 3;
|
|
97
|
+
case "union":
|
|
98
|
+
case "intersection":
|
|
99
|
+
return (node.arguments?.length || 0) * 2;
|
|
100
|
+
case "string":
|
|
101
|
+
case "number":
|
|
102
|
+
case "boolean":
|
|
103
|
+
return 1;
|
|
104
|
+
default:
|
|
105
|
+
return 1;
|
|
102
106
|
}
|
|
103
|
-
return score;
|
|
104
107
|
}
|
|
105
108
|
const enforceIanitorCheckType = {
|
|
106
109
|
/**
|
|
@@ -115,6 +118,69 @@ const enforceIanitorCheckType = {
|
|
|
115
118
|
nodeCache: new WeakMap(),
|
|
116
119
|
visitedNodes: new WeakSet(),
|
|
117
120
|
};
|
|
121
|
+
// Track variable names used in Ianitor.Static<typeof varName> patterns
|
|
122
|
+
const ianitorStaticVariables = new Set();
|
|
123
|
+
const depthMultiplierCache = new Map();
|
|
124
|
+
const complexityCeiling = config.errorThreshold * 2;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieves the cached logarithmic multiplier for a given depth.
|
|
127
|
+
*
|
|
128
|
+
* @param depth - The current recursion depth.
|
|
129
|
+
* @returns The multiplier applied to the accumulated score.
|
|
130
|
+
*/
|
|
131
|
+
function getDepthMultiplier(depth) {
|
|
132
|
+
const cached = depthMultiplierCache.get(depth);
|
|
133
|
+
if (cached !== undefined)
|
|
134
|
+
return cached;
|
|
135
|
+
const computed = Math.log2(depth + 1);
|
|
136
|
+
depthMultiplierCache.set(depth, computed);
|
|
137
|
+
return computed;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Adds a contribution to the running score, respecting performance ceilings.
|
|
141
|
+
*
|
|
142
|
+
* @param current - The current accumulated score.
|
|
143
|
+
* @param addition - The contribution that should be added.
|
|
144
|
+
* @returns The bounded score after applying the contribution.
|
|
145
|
+
*/
|
|
146
|
+
function addScore(current, addition) {
|
|
147
|
+
const nextScore = current + addition;
|
|
148
|
+
if (!config.performanceMode)
|
|
149
|
+
return nextScore;
|
|
150
|
+
return nextScore > complexityCeiling ? complexityCeiling : nextScore;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Extracts the variable name from Ianitor.Static<typeof varName> pattern.
|
|
154
|
+
*
|
|
155
|
+
* @param typeAnnotation - The TypeScript type annotation to check.
|
|
156
|
+
* @returns The variable name if found, null otherwise.
|
|
157
|
+
*/
|
|
158
|
+
// oxlint-disable-next-line consistent-function-scoping
|
|
159
|
+
function extractIanitorStaticVariable(typeAnnotation) {
|
|
160
|
+
let currentType = typeAnnotation;
|
|
161
|
+
// Handle Readonly<...> wrapper
|
|
162
|
+
if (currentType.type === "TSTypeReference" &&
|
|
163
|
+
currentType.typeName.type === "Identifier" &&
|
|
164
|
+
currentType.typeName.name === "Readonly" &&
|
|
165
|
+
currentType.typeArguments?.params[0]) {
|
|
166
|
+
currentType = currentType.typeArguments.params[0];
|
|
167
|
+
}
|
|
168
|
+
// Check for Ianitor.Static<typeof varName>
|
|
169
|
+
if (currentType.type !== "TSTypeReference")
|
|
170
|
+
return null;
|
|
171
|
+
const { typeName, typeArguments } = currentType;
|
|
172
|
+
const firstParam = typeArguments?.params[0];
|
|
173
|
+
if (typeName.type === "TSQualifiedName" &&
|
|
174
|
+
typeName.left.type === "Identifier" &&
|
|
175
|
+
typeName.left.name === "Ianitor" &&
|
|
176
|
+
typeName.right.type === "Identifier" &&
|
|
177
|
+
typeName.right.name === "Static" &&
|
|
178
|
+
firstParam?.type === "TSTypeQuery" &&
|
|
179
|
+
firstParam.exprName.type === "Identifier") {
|
|
180
|
+
return firstParam.exprName.name;
|
|
181
|
+
}
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
118
184
|
/**
|
|
119
185
|
* Calculates the structural complexity of a TypeScript type.
|
|
120
186
|
*
|
|
@@ -124,13 +190,15 @@ const enforceIanitorCheckType = {
|
|
|
124
190
|
*/
|
|
125
191
|
function calculateStructuralComplexity(node, depth = 0) {
|
|
126
192
|
// Performance: Cache everything
|
|
127
|
-
|
|
128
|
-
|
|
193
|
+
const cached = cache.nodeCache.get(node);
|
|
194
|
+
if (cached !== undefined)
|
|
195
|
+
return cached;
|
|
129
196
|
// Cycle detection without TypeChecker
|
|
130
197
|
if (cache.visitedNodes.has(node))
|
|
131
198
|
return 50;
|
|
132
199
|
cache.visitedNodes.add(node);
|
|
133
200
|
let score = 0;
|
|
201
|
+
const nextDepth = depth + 1;
|
|
134
202
|
switch (node.type) {
|
|
135
203
|
// Primitives
|
|
136
204
|
case "TSStringKeyword":
|
|
@@ -152,88 +220,88 @@ const enforceIanitorCheckType = {
|
|
|
152
220
|
// INTERFACES - ALWAYS COMPLEX
|
|
153
221
|
case "TSInterfaceDeclaration": {
|
|
154
222
|
const iface = node;
|
|
155
|
-
score = config.interfacePenalty;
|
|
156
|
-
|
|
157
|
-
if (
|
|
158
|
-
score
|
|
159
|
-
|
|
160
|
-
score
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (
|
|
164
|
-
score
|
|
223
|
+
score = config.interfacePenalty;
|
|
224
|
+
const extendsLength = iface.extends?.length;
|
|
225
|
+
if (extendsLength)
|
|
226
|
+
score = addScore(score, extendsLength * 5);
|
|
227
|
+
const { body } = iface.body;
|
|
228
|
+
score = addScore(score, body.length * 2);
|
|
229
|
+
for (const member of body) {
|
|
230
|
+
const typeAnnotation = "typeAnnotation" in member ? member.typeAnnotation : undefined;
|
|
231
|
+
if (typeAnnotation)
|
|
232
|
+
score = addScore(score, calculateStructuralComplexity(typeAnnotation.typeAnnotation, nextDepth));
|
|
233
|
+
}
|
|
165
234
|
break;
|
|
166
235
|
}
|
|
167
236
|
// Type literals (object types)
|
|
168
237
|
case "TSTypeLiteral": {
|
|
169
|
-
const
|
|
170
|
-
score = 2;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
score
|
|
238
|
+
const { members } = node;
|
|
239
|
+
score = 2 + members.length * 0.5;
|
|
240
|
+
for (const member of members) {
|
|
241
|
+
const typeAnnotation = "typeAnnotation" in member ? member.typeAnnotation : undefined;
|
|
242
|
+
if (typeAnnotation)
|
|
243
|
+
score = addScore(score, calculateStructuralComplexity(typeAnnotation.typeAnnotation, nextDepth));
|
|
244
|
+
}
|
|
175
245
|
break;
|
|
176
246
|
}
|
|
177
247
|
// Unions
|
|
178
248
|
case "TSUnionType": {
|
|
179
|
-
const
|
|
180
|
-
for (const type of
|
|
181
|
-
score
|
|
182
|
-
score
|
|
249
|
+
const { types } = node;
|
|
250
|
+
for (const type of types)
|
|
251
|
+
score = addScore(score, calculateStructuralComplexity(type, nextDepth));
|
|
252
|
+
score = addScore(score, 2 * (types.length - 1));
|
|
183
253
|
break;
|
|
184
254
|
}
|
|
185
255
|
// Intersections
|
|
186
256
|
case "TSIntersectionType": {
|
|
187
|
-
const
|
|
188
|
-
for (const type of
|
|
189
|
-
score
|
|
190
|
-
|
|
191
|
-
score += 3 * intersection.types.length; // Overlap resolution penalty
|
|
257
|
+
const { types } = node;
|
|
258
|
+
for (const type of types)
|
|
259
|
+
score = addScore(score, calculateStructuralComplexity(type, nextDepth));
|
|
260
|
+
score = addScore(score, 3 * types.length);
|
|
192
261
|
break;
|
|
193
262
|
}
|
|
194
263
|
// Arrays
|
|
195
|
-
case "TSArrayType":
|
|
196
|
-
|
|
197
|
-
score = calculateStructuralComplexity(array.elementType, depth + 1) + 1;
|
|
264
|
+
case "TSArrayType":
|
|
265
|
+
score = addScore(calculateStructuralComplexity(node.elementType, nextDepth), 1);
|
|
198
266
|
break;
|
|
199
|
-
}
|
|
200
267
|
// Tuples
|
|
201
268
|
case "TSTupleType": {
|
|
202
|
-
const
|
|
269
|
+
const { elementTypes } = node;
|
|
203
270
|
score = 1;
|
|
204
|
-
for (const element of
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
271
|
+
for (const element of elementTypes) {
|
|
272
|
+
const elementType = element.type;
|
|
273
|
+
if (elementType !== "TSRestType" && elementType !== "TSOptionalType")
|
|
274
|
+
score = addScore(score, calculateStructuralComplexity(element, nextDepth));
|
|
275
|
+
}
|
|
276
|
+
score = addScore(score, 1.5 * elementTypes.length);
|
|
208
277
|
break;
|
|
209
278
|
}
|
|
210
279
|
// Type references (including generics)
|
|
211
280
|
case "TSTypeReference": {
|
|
212
|
-
const ref = node;
|
|
213
281
|
score = 2;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
282
|
+
const { typeArguments } = node;
|
|
283
|
+
if (typeArguments) {
|
|
284
|
+
for (const param of typeArguments.params)
|
|
285
|
+
score = addScore(score, calculateStructuralComplexity(param, nextDepth) + 2);
|
|
286
|
+
}
|
|
217
287
|
break;
|
|
218
288
|
}
|
|
219
289
|
// Conditional types
|
|
220
290
|
case "TSConditionalType": {
|
|
221
|
-
const conditional = node;
|
|
222
291
|
score = 3;
|
|
223
|
-
score
|
|
224
|
-
score
|
|
225
|
-
score
|
|
226
|
-
score
|
|
292
|
+
score = addScore(score, calculateStructuralComplexity(node.checkType, nextDepth));
|
|
293
|
+
score = addScore(score, calculateStructuralComplexity(node.extendsType, nextDepth));
|
|
294
|
+
score = addScore(score, calculateStructuralComplexity(node.trueType, nextDepth));
|
|
295
|
+
score = addScore(score, calculateStructuralComplexity(node.falseType, nextDepth));
|
|
227
296
|
break;
|
|
228
297
|
}
|
|
229
298
|
// Mapped types
|
|
230
299
|
case "TSMappedType": {
|
|
231
|
-
const mapped = node;
|
|
232
300
|
score = 5;
|
|
233
|
-
if (
|
|
234
|
-
score
|
|
235
|
-
if (
|
|
236
|
-
score
|
|
301
|
+
if (node.constraint)
|
|
302
|
+
score = addScore(score, calculateStructuralComplexity(node.constraint, nextDepth));
|
|
303
|
+
if (node.typeAnnotation)
|
|
304
|
+
score = addScore(score, calculateStructuralComplexity(node.typeAnnotation, nextDepth));
|
|
237
305
|
break;
|
|
238
306
|
}
|
|
239
307
|
// Function types
|
|
@@ -241,24 +309,47 @@ const enforceIanitorCheckType = {
|
|
|
241
309
|
case "TSMethodSignature": {
|
|
242
310
|
const func = node;
|
|
243
311
|
score = 2;
|
|
244
|
-
for (const param of func.params)
|
|
245
|
-
|
|
246
|
-
|
|
312
|
+
for (const param of func.params) {
|
|
313
|
+
const typeAnnotation = "typeAnnotation" in param ? param.typeAnnotation : undefined;
|
|
314
|
+
if (typeAnnotation)
|
|
315
|
+
score = addScore(score, calculateStructuralComplexity(typeAnnotation.typeAnnotation, nextDepth));
|
|
316
|
+
}
|
|
247
317
|
if (func.returnType)
|
|
248
|
-
score
|
|
318
|
+
score = addScore(score, calculateStructuralComplexity(func.returnType.typeAnnotation, nextDepth));
|
|
249
319
|
break;
|
|
250
320
|
}
|
|
251
321
|
default:
|
|
252
322
|
score = 1;
|
|
253
323
|
}
|
|
254
324
|
// Apply depth multiplier (logarithmic to prevent explosion)
|
|
255
|
-
score *=
|
|
325
|
+
score *= getDepthMultiplier(depth);
|
|
256
326
|
// Cache and return
|
|
257
327
|
cache.nodeCache.set(node, score);
|
|
258
328
|
cache.visitedNodes.delete(node);
|
|
259
329
|
return score;
|
|
260
330
|
}
|
|
331
|
+
// Track which VariableDeclarator nodes need checking after type aliases are collected
|
|
332
|
+
const variableDeclaratorsToCheck = new Map();
|
|
261
333
|
return {
|
|
334
|
+
// Handle type alias declarations
|
|
335
|
+
TSTypeAliasDeclaration(node) {
|
|
336
|
+
// First, check if this uses Ianitor.Static pattern and collect the variable name
|
|
337
|
+
const varName = extractIanitorStaticVariable(node.typeAnnotation);
|
|
338
|
+
if (varName)
|
|
339
|
+
ianitorStaticVariables.add(varName);
|
|
340
|
+
// Skip complexity check if the type uses Ianitor.Static<typeof ...> pattern
|
|
341
|
+
if (hasIanitorStaticType(node.typeAnnotation))
|
|
342
|
+
return;
|
|
343
|
+
// Check complexity of the type alias
|
|
344
|
+
const complexity = calculateStructuralComplexity(node.typeAnnotation);
|
|
345
|
+
if (complexity < config.baseThreshold)
|
|
346
|
+
return;
|
|
347
|
+
context.report({
|
|
348
|
+
data: { score: complexity.toFixed(1) },
|
|
349
|
+
messageId: "missingIanitorCheckType",
|
|
350
|
+
node,
|
|
351
|
+
});
|
|
352
|
+
},
|
|
262
353
|
// Check interface declarations
|
|
263
354
|
TSInterfaceDeclaration(node) {
|
|
264
355
|
const complexity = calculateStructuralComplexity(node);
|
|
@@ -271,18 +362,7 @@ const enforceIanitorCheckType = {
|
|
|
271
362
|
});
|
|
272
363
|
}
|
|
273
364
|
},
|
|
274
|
-
//
|
|
275
|
-
TSTypeAliasDeclaration(node) {
|
|
276
|
-
const complexity = calculateStructuralComplexity(node.typeAnnotation);
|
|
277
|
-
if (complexity < config.baseThreshold)
|
|
278
|
-
return;
|
|
279
|
-
context.report({
|
|
280
|
-
data: { score: complexity.toFixed(1) },
|
|
281
|
-
messageId: "missingIanitorCheckType",
|
|
282
|
-
node,
|
|
283
|
-
});
|
|
284
|
-
},
|
|
285
|
-
// Check variable declarations with Ianitor validators
|
|
365
|
+
// Collect variable declarators that might need checking
|
|
286
366
|
VariableDeclarator(node) {
|
|
287
367
|
if (!node.init || node.init.type !== "CallExpression")
|
|
288
368
|
return;
|
|
@@ -293,11 +373,22 @@ const enforceIanitorCheckType = {
|
|
|
293
373
|
const complexity = calculateIanitorComplexity(node.init);
|
|
294
374
|
if (complexity < config.baseThreshold)
|
|
295
375
|
return;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
376
|
+
// Store for later checking in Program:exit
|
|
377
|
+
variableDeclaratorsToCheck.set(node, { complexity });
|
|
378
|
+
},
|
|
379
|
+
// After all nodes are visited, check the collected variable declarators
|
|
380
|
+
"Program:exit"() {
|
|
381
|
+
for (const [nodeKey, data] of variableDeclaratorsToCheck.entries()) {
|
|
382
|
+
const node = nodeKey;
|
|
383
|
+
// Skip if this variable is used in an Ianitor.Static<typeof ...> pattern
|
|
384
|
+
if (node.id.type === "Identifier" && ianitorStaticVariables.has(node.id.name))
|
|
385
|
+
continue;
|
|
386
|
+
context.report({
|
|
387
|
+
data: { score: data.complexity.toFixed(1) },
|
|
388
|
+
messageId: "missingIanitorCheckType",
|
|
389
|
+
node,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
301
392
|
},
|
|
302
393
|
};
|
|
303
394
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enforce-ianitor-check-type.js","sourceRoot":"","sources":["../../src/rules/enforce-ianitor-check-type.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,cAAc,GAAqB;IACxC,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE,EAAE;IAClB,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,EAAE;CACjB,CAAC;AAEF;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,IAAa;IACvC,MAAM,OAAO,GAAG,IAA4D,CAAC;IAC7E,IAAI,OAAO,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;QAC3C,MAAM,EAAE,GAAG,OAAO,CAAC,EAA8C,CAAC;QAClE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,gBAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,qBAAqB,IAAI,OAAO,CAAC,IAAI,KAAK,oBAAoB;QAAE,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACjH,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,IAAmB;IACvC,IAAI,IAAI,CAAC,IAAI,KAAK,wBAAwB;QAAE,OAAO,IAAI,CAAC,EAAE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CAAC,IAAI,CAAC,CAAC;gBAEzD,IAAI,UAAU,GAAG,MAAM,CAAC,aAAa;oBAAE,OAAO;gBAC9C,OAAO,CAAC,MAAM,CAAC;oBACd,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBACtC,SAAS,EAAE,yBAAyB;oBACpC,IAAI;iBACJ,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;IACD,IAAI,EAAE;QACL,IAAI,EAAE;YACL,WAAW,EAAE,uEAAuE;YACpF,WAAW,EAAE,KAAK;SAClB;QACD,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE;YACT,0BAA0B,EACzB,sGAAsG;YACvG,uBAAuB,EACtB,sFAAsF;SACvF;QACD,MAAM,EAAE;YACP;gBACC,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACX,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC7C,cAAc,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC9C,gBAAgB,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAChD,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBACpC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAC7C;gBACD,IAAI,EAAE,QAAQ;aACd;SACD;QACD,IAAI,EAAE,SAAS;KACf;CACD,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"enforce-ianitor-check-type.js","sourceRoot":"","sources":["../../src/rules/enforce-ianitor-check-type.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,cAAc,GAAqB;IACxC,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE,EAAE;IAClB,gBAAgB,EAAE,EAAE;IACpB,eA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EAAE;oBACpC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAC7C;gBACD,IAAI,EAAE,QAAQ;aACd;SACD;QACD,IAAI,EAAE,SAAS;KACf;CACD,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
function isUnknownRecord(value) {
|
|
2
|
+
return typeof value === "object" && value !== null;
|
|
3
|
+
}
|
|
4
|
+
function isNumericLiteralNode(value) {
|
|
5
|
+
return (isUnknownRecord(value) &&
|
|
6
|
+
value.type === "Literal" &&
|
|
7
|
+
"value" in value &&
|
|
8
|
+
typeof value.value === "number");
|
|
9
|
+
}
|
|
10
|
+
function mapComponentToRgbRange(value) {
|
|
11
|
+
return Math.round(value > 1 ? value : value * 255);
|
|
12
|
+
}
|
|
13
|
+
function collectNumericComponents(parameters) {
|
|
14
|
+
const components = [];
|
|
15
|
+
let allZero = true;
|
|
16
|
+
for (const parameter of parameters) {
|
|
17
|
+
if (!isNumericLiteralNode(parameter))
|
|
18
|
+
return undefined;
|
|
19
|
+
const mapped = mapComponentToRgbRange(parameter.value);
|
|
20
|
+
components.push(mapped);
|
|
21
|
+
if (mapped !== 0)
|
|
22
|
+
allZero = false;
|
|
23
|
+
}
|
|
24
|
+
return { allZero, components };
|
|
25
|
+
}
|
|
1
26
|
/**
|
|
2
27
|
* Bans use of `new Color3(...)` except for `new Color3()` or `new Color3(0, 0, 0)`.
|
|
3
28
|
*
|
|
@@ -27,27 +52,32 @@ const noColor3Constructor = {
|
|
|
27
52
|
NewExpression(node) {
|
|
28
53
|
if (node.callee.type !== "Identifier" || node.callee.name !== "Color3")
|
|
29
54
|
return;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
if (args.length === 0)
|
|
55
|
+
const parameters = node.arguments;
|
|
56
|
+
if (parameters.length === 0)
|
|
33
57
|
return;
|
|
34
|
-
|
|
35
|
-
if (
|
|
58
|
+
const collected = collectNumericComponents(parameters);
|
|
59
|
+
if (!collected) {
|
|
36
60
|
context.report({
|
|
61
|
+
messageId: parameters.length < 3 ? "useFromRGB" : "onlyZeroArgs",
|
|
62
|
+
node,
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (parameters.length < 3) {
|
|
67
|
+
const [red, green = 0] = collected.components;
|
|
68
|
+
context.report({
|
|
69
|
+
fix: (fixer) => fixer.replaceText(node, `Color3.fromRGB(${red}, ${green}, 0)`),
|
|
37
70
|
messageId: "useFromRGB",
|
|
38
71
|
node,
|
|
39
72
|
});
|
|
40
73
|
return;
|
|
41
74
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
node,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
75
|
+
if (!collected.allZero) {
|
|
76
|
+
context.report({
|
|
77
|
+
fix: (fixer) => fixer.replaceText(node, `Color3.fromRGB(${collected.components.join(", ")})`),
|
|
78
|
+
messageId: "onlyZeroArgs",
|
|
79
|
+
node,
|
|
80
|
+
});
|
|
51
81
|
}
|
|
52
82
|
},
|
|
53
83
|
};
|
|
@@ -55,8 +85,9 @@ const noColor3Constructor = {
|
|
|
55
85
|
meta: {
|
|
56
86
|
docs: {
|
|
57
87
|
description: "Ban new Color3(...) except new Color3() or new Color3(0, 0, 0). Use Color3.fromRGB() instead.",
|
|
58
|
-
recommended:
|
|
88
|
+
recommended: true,
|
|
59
89
|
},
|
|
90
|
+
fixable: "code",
|
|
60
91
|
messages: {
|
|
61
92
|
onlyZeroArgs: "Use Color3.fromRGB() instead of new Color3(). new Color3() uses floats [0-1] and performs worse than Color3.fromRGB() which uses [0-255]. Only 'new Color3()' or 'new Color3(0, 0, 0)' are allowed.",
|
|
62
93
|
useFromRGB: "Use Color3.fromRGB() instead of new Color3(). new Color3() uses floats [0-1] and performs worse than Color3.fromRGB() which uses [0-255].",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-color3-constructor.js","sourceRoot":"","sources":["../../src/rules/no-color3-constructor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-color3-constructor.js","sourceRoot":"","sources":["../../src/rules/no-color3-constructor.ts"],"names":[],"mappings":"AAOA,SAAS,eAAe,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACpD,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC3C,OAAO,CACN,eAAe,CAAC,KAAK,CAAC;QACtB,KAAK,CAAC,IAAI,KAAK,SAAS;QACxB,OAAO,IAAI,KAAK;QAChB,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAC/B,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;AACpD,CAAC;AAOD,SAAS,wBAAwB,CAAC,UAAkC;IACnE,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,OAAO,GAAG,IAAI,CAAC;IAEnB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;QAEvD,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACvD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,MAAM,KAAK,CAAC;YAAE,OAAO,GAAG,KAAK,CAAC;IACnC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,mBAAmB,GAAoB;IAC5C;;;;;OAKG;IACH,MAAM,CAAC,OAAO;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;SACD,CAAC;IACH,CAAC;IACD,IAAI,EAAE;QACL,IAAI,EAAE;YACL,WAAW,EACV,+FAA+F;YAChG,WAAW,EAAE,IAAI;SACjB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACT,YAAY,EACX,qMAAqM;YACtM,UAAU,EACT,2IAA2I;SAC5I;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KACf;CACD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/rules/no-print.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Rule } from "eslint";
|
|
|
2
2
|
/**
|
|
3
3
|
* Bans use of `print()` function calls. Use `Log` instead.
|
|
4
4
|
*
|
|
5
|
-
* The `print()` function is
|
|
5
|
+
* The `print()` function is not wanted in this codebase and discouraged in favor of a proper
|
|
6
6
|
* logging system like `Log`.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
package/dist/rules/no-print.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bans use of `print()` function calls. Use `Log` instead.
|
|
3
3
|
*
|
|
4
|
-
* The `print()` function is
|
|
4
|
+
* The `print()` function is not wanted in this codebase and discouraged in favor of a proper
|
|
5
5
|
* logging system like `Log`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
@@ -22,9 +22,7 @@ const noPrint = {
|
|
|
22
22
|
*/
|
|
23
23
|
create(context) {
|
|
24
24
|
return {
|
|
25
|
-
CallExpression(node) {
|
|
26
|
-
if (node.callee.type !== "Identifier" || node.callee.name !== "print")
|
|
27
|
-
return;
|
|
25
|
+
'CallExpression[callee.type="Identifier"][callee.name="print"]'(node) {
|
|
28
26
|
context.report({
|
|
29
27
|
messageId: "useLog",
|
|
30
28
|
node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-print.js","sourceRoot":"","sources":["../../src/rules/no-print.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,GAAoB;IAChC;;;;;OAKG;IACH,MAAM,CAAC,OAAO;QACb,OAAO;YACN,
|
|
1
|
+
{"version":3,"file":"no-print.js","sourceRoot":"","sources":["../../src/rules/no-print.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,GAAoB;IAChC;;;;;OAKG;IACH,MAAM,CAAC,OAAO;QACb,OAAO;YACN,+DAA+D,CAAC,IAAe;gBAC9E,OAAO,CAAC,MAAM,CAAC;oBACd,SAAS,EAAE,QAAQ;oBACnB,IAAI;iBACJ,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;IACD,IAAI,EAAE;QACL,IAAI,EAAE;YACL,WAAW,EAAE,8CAA8C;YAC3D,WAAW,EAAE,KAAK;SAClB;QACD,QAAQ,EAAE;YACT,MAAM,EAAE,4BAA4B;SACpC;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KACf;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,43 +1,60 @@
|
|
|
1
|
-
const SHORTHANDS = [
|
|
2
|
-
{ messageId: "useParameters", replacement: "parameters", shorthand: "args" },
|
|
3
|
-
{ messageId: "useDeltaTime", replacement: "deltaTime", shorthand: "dt" },
|
|
4
|
-
{ messageId: "useCharacter", replacement: "character", shorthand: "char" },
|
|
5
|
-
];
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
2
|
+
* Default configuration values for the rule.
|
|
3
|
+
*/
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
allowPropertyAccess: ["char"],
|
|
6
|
+
shorthands: {
|
|
7
|
+
args: "parameters",
|
|
8
|
+
char: "character",
|
|
9
|
+
dt: "deltaTime",
|
|
10
|
+
plr: "player",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
function isUnknownRecord(value) {
|
|
14
|
+
return typeof value === "object" && value !== null;
|
|
15
|
+
}
|
|
16
|
+
function isStringRecord(value) {
|
|
17
|
+
return isUnknownRecord(value) && Object.values(value).every((v) => typeof v === "string");
|
|
18
|
+
}
|
|
19
|
+
function isStringArray(value) {
|
|
20
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Escapes special regex characters in a string.
|
|
8
24
|
*
|
|
9
|
-
* @param
|
|
10
|
-
* @returns
|
|
25
|
+
* @param str - The string to escape.
|
|
26
|
+
* @returns The escaped string safe for use in regex.
|
|
11
27
|
*/
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
return false;
|
|
15
|
-
const n = node;
|
|
16
|
-
if (n.type !== "MemberExpression")
|
|
17
|
-
return false;
|
|
18
|
-
const obj = n.object;
|
|
19
|
-
const prop = n.property;
|
|
20
|
-
if (!obj || typeof obj !== "object" || !prop || typeof prop !== "object")
|
|
21
|
-
return false;
|
|
22
|
-
const objNode = obj;
|
|
23
|
-
const propNode = prop;
|
|
24
|
-
return (objNode.type === "Identifier" &&
|
|
25
|
-
objNode.name === "Players" &&
|
|
26
|
-
propNode.type === "Identifier" &&
|
|
27
|
-
propNode.name === "LocalPlayer");
|
|
28
|
+
function escapeRegex(str) {
|
|
29
|
+
return str.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
|
-
*
|
|
32
|
+
* Type guard to check if an unknown value is valid RuleOptions.
|
|
31
33
|
*
|
|
32
|
-
* @param
|
|
33
|
-
* @returns True if the
|
|
34
|
+
* @param value - The value to check.
|
|
35
|
+
* @returns True if the value is valid RuleOptions.
|
|
34
36
|
*/
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
if (!parent || typeof parent !== "object")
|
|
37
|
+
function isRuleOptions(value) {
|
|
38
|
+
if (!isUnknownRecord(value))
|
|
38
39
|
return false;
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
return ((!("shorthands" in value) || isStringRecord(value.shorthands)) &&
|
|
41
|
+
(!("allowPropertyAccess" in value) || isStringArray(value.allowPropertyAccess)));
|
|
42
|
+
}
|
|
43
|
+
function normalizeOptions(rawOptions) {
|
|
44
|
+
const mergedShorthands = { ...DEFAULT_OPTIONS.shorthands };
|
|
45
|
+
if (rawOptions?.shorthands)
|
|
46
|
+
for (const [key, value] of Object.entries(rawOptions.shorthands))
|
|
47
|
+
mergedShorthands[key] = value;
|
|
48
|
+
const shorthandsMap = new Map(Object.entries(mergedShorthands));
|
|
49
|
+
const allowPropertyAccessSource = rawOptions?.allowPropertyAccess ?? DEFAULT_OPTIONS.allowPropertyAccess;
|
|
50
|
+
// Build regex selector to only visit identifiers matching shorthand names
|
|
51
|
+
const escapedKeys = Array.from(shorthandsMap.keys()).map((key) => escapeRegex(key));
|
|
52
|
+
const selector = `Identifier[name=/^(${escapedKeys.join("|")})$/]`;
|
|
53
|
+
return {
|
|
54
|
+
allowPropertyAccess: new Set(allowPropertyAccessSource),
|
|
55
|
+
selector,
|
|
56
|
+
shorthands: shorthandsMap,
|
|
57
|
+
};
|
|
41
58
|
}
|
|
42
59
|
/**
|
|
43
60
|
* Bans shorthand variable names in favor of descriptive full names.
|
|
@@ -71,61 +88,81 @@ const noShorthandNames = {
|
|
|
71
88
|
* @returns The visitor object with AST node handlers.
|
|
72
89
|
*/
|
|
73
90
|
create(context) {
|
|
91
|
+
const validatedOptions = isRuleOptions(context.options[0]) ? context.options[0] : undefined;
|
|
92
|
+
const normalized = normalizeOptions(validatedOptions);
|
|
93
|
+
const { shorthands, allowPropertyAccess, selector } = normalized;
|
|
74
94
|
return {
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
messageId: "useLocalPlayer",
|
|
89
|
-
node,
|
|
90
|
-
});
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
// Default case: use player
|
|
94
|
-
context.report({
|
|
95
|
-
messageId: "usePlayer",
|
|
96
|
-
node,
|
|
97
|
-
});
|
|
95
|
+
[selector](node) {
|
|
96
|
+
const shorthandName = node.name;
|
|
97
|
+
const replacement = shorthands.get(shorthandName);
|
|
98
|
+
if (!replacement)
|
|
99
|
+
return;
|
|
100
|
+
// Cache parent lookup
|
|
101
|
+
const parent = node.parent;
|
|
102
|
+
// Inline property access check
|
|
103
|
+
if (allowPropertyAccess.has(shorthandName) &&
|
|
104
|
+
parent &&
|
|
105
|
+
isUnknownRecord(parent) &&
|
|
106
|
+
parent.type === "MemberExpression" &&
|
|
107
|
+
parent.property === node) {
|
|
98
108
|
return;
|
|
99
109
|
}
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
// Special case: plr → localPlayer for Players.LocalPlayer
|
|
111
|
+
if (shorthandName === "plr" && parent?.type === "VariableDeclarator" && parent.id === node) {
|
|
112
|
+
const init = parent.init;
|
|
113
|
+
if (init &&
|
|
114
|
+
isUnknownRecord(init) &&
|
|
115
|
+
init.type === "MemberExpression" &&
|
|
116
|
+
init.object &&
|
|
117
|
+
isUnknownRecord(init.object) &&
|
|
118
|
+
init.object.type === "Identifier" &&
|
|
119
|
+
init.object.name === "Players" &&
|
|
120
|
+
init.property &&
|
|
121
|
+
isUnknownRecord(init.property) &&
|
|
122
|
+
init.property.type === "Identifier" &&
|
|
123
|
+
init.property.name === "LocalPlayer") {
|
|
106
124
|
context.report({
|
|
107
|
-
|
|
125
|
+
data: { replacement: "localPlayer", shorthand: shorthandName },
|
|
126
|
+
messageId: "useReplacement",
|
|
108
127
|
node,
|
|
109
128
|
});
|
|
110
129
|
return;
|
|
111
130
|
}
|
|
112
131
|
}
|
|
132
|
+
context.report({
|
|
133
|
+
data: { replacement, shorthand: shorthandName },
|
|
134
|
+
messageId: "useReplacement",
|
|
135
|
+
node,
|
|
136
|
+
});
|
|
113
137
|
},
|
|
114
138
|
};
|
|
115
139
|
},
|
|
116
140
|
meta: {
|
|
117
141
|
docs: {
|
|
118
142
|
description: "Ban shorthand variable names. Use descriptive full names instead.",
|
|
119
|
-
recommended:
|
|
143
|
+
recommended: true,
|
|
120
144
|
},
|
|
121
145
|
messages: {
|
|
122
|
-
|
|
123
|
-
useDeltaTime: "Use 'deltaTime' instead of 'dt' shorthand",
|
|
124
|
-
useLocalPlayer: "Use 'localPlayer' instead of 'plr' when assigning Players.LocalPlayer",
|
|
125
|
-
useParameters: "Use 'parameters' instead of 'args' shorthand",
|
|
126
|
-
usePlayer: "Use 'player' instead of 'plr' shorthand",
|
|
146
|
+
useReplacement: "Use '{{replacement}}' instead of '{{shorthand}}' shorthand",
|
|
127
147
|
},
|
|
128
|
-
schema: [
|
|
148
|
+
schema: [
|
|
149
|
+
{
|
|
150
|
+
additionalProperties: false,
|
|
151
|
+
properties: {
|
|
152
|
+
allowPropertyAccess: {
|
|
153
|
+
description: "Shorthand names that are allowed as property access",
|
|
154
|
+
items: { type: "string" },
|
|
155
|
+
type: "array",
|
|
156
|
+
},
|
|
157
|
+
shorthands: {
|
|
158
|
+
description: "Map of shorthand names to their full replacements",
|
|
159
|
+
type: "object",
|
|
160
|
+
additionalProperties: { type: "string" },
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
type: "object",
|
|
164
|
+
},
|
|
165
|
+
],
|
|
129
166
|
type: "suggestion",
|
|
130
167
|
},
|
|
131
168
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-shorthand-names.js","sourceRoot":"","sources":["../../src/rules/no-shorthand-names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-shorthand-names.js","sourceRoot":"","sources":["../../src/rules/no-shorthand-names.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,MAAM,eAAe,GAA0B;IAC9C,mBAAmB,EAAE,CAAC,MAAM,CAAC;IAC7B,UAAU,EAAE;QAC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I,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE;oBAC/C,SAAS,EAAE,gBAAgB;oBAC3B,IAAI;iBACJ,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;IACD,IAAI,EAAE;QACL,IAAI,EAAE;YACL,WAAW,EAAE,mEAAmE;YAChF,WAAW,EAAE,IAAI;SACjB;QACD,QAAQ,EAAE;YACT,cAAc,EAAE,4DAA4D;SAC5E;QACD,MAAM,EAAE;YACP;gBACC,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACX,mBAAmB,EAAE;wBACpB,WAAW,EAAE,qDAAqD;wBAClE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACzB,IAAI,EAAE,OAAO;qBACb;oBACD,UAAU,EAAE;wBACX,WAAW,EAAE,mDAAmD;wBAChE,IAAI,EAAE,QAAQ;wBACd,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBACxC;iBACD;gBACD,IAAI,EAAE,QAAQ;aACd;SACD;QACD,IAAI,EAAE,YAAY;KAClB;CACD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/dist/rules/no-warn.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Rule } from "eslint";
|
|
|
2
2
|
/**
|
|
3
3
|
* Bans use of `warn()` function calls. Use `Log` instead.
|
|
4
4
|
*
|
|
5
|
-
* The `warn()` function is
|
|
5
|
+
* The `warn()` function is not wanted in this codebase and discouraged in favor of a proper
|
|
6
6
|
* logging system like `Log`.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
package/dist/rules/no-warn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bans use of `warn()` function calls. Use `Log` instead.
|
|
3
3
|
*
|
|
4
|
-
* The `warn()` function is
|
|
4
|
+
* The `warn()` function is not wanted in this codebase and discouraged in favor of a proper
|
|
5
5
|
* logging system like `Log`.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
@@ -22,9 +22,7 @@ const noWarn = {
|
|
|
22
22
|
*/
|
|
23
23
|
create(context) {
|
|
24
24
|
return {
|
|
25
|
-
CallExpression(node) {
|
|
26
|
-
if (node.callee.type !== "Identifier" || node.callee.name !== "warn")
|
|
27
|
-
return;
|
|
25
|
+
'CallExpression[callee.type="Identifier"][callee.name="warn"]'(node) {
|
|
28
26
|
context.report({
|
|
29
27
|
messageId: "useLog",
|
|
30
28
|
node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-warn.js","sourceRoot":"","sources":["../../src/rules/no-warn.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,GAAoB;IAC/B;;;;;OAKG;IACH,MAAM,CAAC,OAAO;QACb,OAAO;YACN,
|
|
1
|
+
{"version":3,"file":"no-warn.js","sourceRoot":"","sources":["../../src/rules/no-warn.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,GAAoB;IAC/B;;;;;OAKG;IACH,MAAM,CAAC,OAAO;QACb,OAAO;YACN,8DAA8D,CAAC,IAAe;gBAC7E,OAAO,CAAC,MAAM,CAAC;oBACd,SAAS,EAAE,QAAQ;oBACnB,IAAI;iBACJ,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;IACD,IAAI,EAAE;QACL,IAAI,EAAE;YACL,WAAW,EAAE,6CAA6C;YAC1D,WAAW,EAAE,KAAK;SAClB;QACD,QAAQ,EAAE;YACT,MAAM,EAAE,2BAA2B;SACnC;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KACf;CACD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default configuration values for the rule.
|
|
3
|
+
*/
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
allowRootKeys: false,
|
|
6
|
+
ignoreCallExpressions: ["ReactTree.mount"],
|
|
7
|
+
};
|
|
1
8
|
/**
|
|
2
9
|
* Checks if a JSX element has a key attribute.
|
|
3
10
|
*
|
|
@@ -5,7 +12,11 @@
|
|
|
5
12
|
* @returns True if the element has a key attribute.
|
|
6
13
|
*/
|
|
7
14
|
function hasKeyAttribute(node) {
|
|
8
|
-
|
|
15
|
+
for (const attr of node.openingElement.attributes) {
|
|
16
|
+
if (attr.type === "JSXAttribute" && attr.name.name === "key")
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
9
20
|
}
|
|
10
21
|
/**
|
|
11
22
|
* Checks if a JSX element is a top-level return from a component.
|
|
@@ -14,19 +25,65 @@ function hasKeyAttribute(node) {
|
|
|
14
25
|
* @returns True if the element is directly returned from a component.
|
|
15
26
|
*/
|
|
16
27
|
function isTopLevelReturn(node) {
|
|
17
|
-
// Check if this element is a direct child of a return statement
|
|
18
28
|
let parent = node.parent;
|
|
19
29
|
if (!parent)
|
|
20
30
|
return false;
|
|
21
31
|
// Handle return with parentheses: return (<div>...)
|
|
22
32
|
if (parent.type === "JSXExpressionContainer")
|
|
23
33
|
parent = parent.parent;
|
|
34
|
+
if (!parent)
|
|
35
|
+
return false;
|
|
24
36
|
// Handle direct return
|
|
25
|
-
if (parent
|
|
37
|
+
if (parent.type === "ReturnStatement")
|
|
26
38
|
return true;
|
|
27
39
|
// Handle arrow function direct return: () => <div>
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
return parent.type === "ArrowFunctionExpression" && parent.parent?.type !== "CallExpression";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a JSX element is an argument to an ignored call expression.
|
|
44
|
+
*
|
|
45
|
+
* @param node - The JSX element or fragment to check.
|
|
46
|
+
* @param ignoreList - List of function names to ignore.
|
|
47
|
+
* @returns True if the element is passed to an ignored function.
|
|
48
|
+
*/
|
|
49
|
+
function isIgnoredCallExpression(node, ignoreList) {
|
|
50
|
+
let parent = node.parent;
|
|
51
|
+
if (!parent)
|
|
52
|
+
return false;
|
|
53
|
+
// Handle JSXExpressionContainer wrapper
|
|
54
|
+
if (parent.type === "JSXExpressionContainer") {
|
|
55
|
+
parent = parent.parent;
|
|
56
|
+
if (!parent)
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
// Traverse up to find CallExpression
|
|
60
|
+
const maxDepth = 10;
|
|
61
|
+
for (let depth = 0; depth < maxDepth && parent; depth++) {
|
|
62
|
+
const { type } = parent;
|
|
63
|
+
// Found CallExpression - check if it's in the ignore list
|
|
64
|
+
if (type === "CallExpression") {
|
|
65
|
+
const { callee } = parent;
|
|
66
|
+
// Simple identifier: mount(...)
|
|
67
|
+
if (callee.type === "Identifier")
|
|
68
|
+
return ignoreList.includes(callee.name);
|
|
69
|
+
// Member expression: ReactTree.mount(...)
|
|
70
|
+
if (callee.type === "MemberExpression" &&
|
|
71
|
+
callee.object.type === "Identifier" &&
|
|
72
|
+
callee.property.type === "Identifier") {
|
|
73
|
+
return ignoreList.includes(`${callee.object.name}.${callee.property.name}`);
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
// Stop at JSX or function boundaries
|
|
78
|
+
if (type === "JSXElement" ||
|
|
79
|
+
type === "JSXFragment" ||
|
|
80
|
+
type === "FunctionDeclaration" ||
|
|
81
|
+
type === "FunctionExpression" ||
|
|
82
|
+
type === "ArrowFunctionExpression") {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
parent = parent.parent;
|
|
86
|
+
}
|
|
30
87
|
return false;
|
|
31
88
|
}
|
|
32
89
|
const requireReactComponentKeys = {
|
|
@@ -37,15 +94,29 @@ const requireReactComponentKeys = {
|
|
|
37
94
|
* @returns The visitor object with AST node handlers.
|
|
38
95
|
*/
|
|
39
96
|
create(context) {
|
|
40
|
-
const
|
|
97
|
+
const options = {
|
|
98
|
+
...DEFAULT_OPTIONS,
|
|
99
|
+
...context.options[0],
|
|
100
|
+
};
|
|
41
101
|
/**
|
|
42
102
|
* Checks a JSX element or fragment for required key prop.
|
|
43
103
|
*
|
|
44
104
|
* @param node - The JSX element or fragment to check.
|
|
45
105
|
*/
|
|
46
106
|
function checkElement(node) {
|
|
47
|
-
|
|
48
|
-
if (
|
|
107
|
+
const isRoot = isTopLevelReturn(node);
|
|
108
|
+
// Check if root component has a key (and it's not allowed)
|
|
109
|
+
if (isRoot) {
|
|
110
|
+
if (!options.allowRootKeys && node.type === "JSXElement" && hasKeyAttribute(node)) {
|
|
111
|
+
context.report({
|
|
112
|
+
messageId: "rootComponentWithKey",
|
|
113
|
+
node,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// Skip key requirement for ignored call expressions
|
|
119
|
+
if (isIgnoredCallExpression(node, options.ignoreCallExpressions))
|
|
49
120
|
return;
|
|
50
121
|
// Fragments always need keys when not top-level
|
|
51
122
|
if (node.type === "JSXFragment") {
|
|
@@ -56,21 +127,14 @@ const requireReactComponentKeys = {
|
|
|
56
127
|
return;
|
|
57
128
|
}
|
|
58
129
|
// Check if element has key
|
|
59
|
-
if (hasKeyAttribute(node))
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
130
|
+
if (!hasKeyAttribute(node)) {
|
|
131
|
+
context.report({
|
|
132
|
+
messageId: "missingKey",
|
|
133
|
+
node,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
65
136
|
}
|
|
66
137
|
return {
|
|
67
|
-
// Track function/component boundaries for top-level detection
|
|
68
|
-
"FunctionDeclaration, FunctionExpression, ArrowFunctionExpression"(node) {
|
|
69
|
-
returnStack.push({ depth: returnStack.length, node });
|
|
70
|
-
},
|
|
71
|
-
"FunctionDeclaration, FunctionExpression, ArrowFunctionExpression:exit"() {
|
|
72
|
-
returnStack.pop();
|
|
73
|
-
},
|
|
74
138
|
// Check JSX elements
|
|
75
139
|
JSXElement(node) {
|
|
76
140
|
checkElement(node);
|
|
@@ -84,13 +148,32 @@ const requireReactComponentKeys = {
|
|
|
84
148
|
meta: {
|
|
85
149
|
docs: {
|
|
86
150
|
description: "Enforce key props on all React elements except top-level returns",
|
|
87
|
-
recommended:
|
|
151
|
+
recommended: true,
|
|
88
152
|
},
|
|
89
153
|
fixable: undefined,
|
|
90
154
|
messages: {
|
|
91
155
|
missingKey: "All React elements except top-level returns require a key prop",
|
|
156
|
+
rootComponentWithKey: "Root component returns should not have key props",
|
|
92
157
|
},
|
|
93
|
-
schema: [
|
|
158
|
+
schema: [
|
|
159
|
+
{
|
|
160
|
+
additionalProperties: false,
|
|
161
|
+
properties: {
|
|
162
|
+
allowRootKeys: {
|
|
163
|
+
default: false,
|
|
164
|
+
description: "Allow key props on root component returns",
|
|
165
|
+
type: "boolean",
|
|
166
|
+
},
|
|
167
|
+
ignoreCallExpressions: {
|
|
168
|
+
default: ["ReactTree.mount"],
|
|
169
|
+
description: "Function calls where JSX arguments don't need keys",
|
|
170
|
+
items: { type: "string" },
|
|
171
|
+
type: "array",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
type: "object",
|
|
175
|
+
},
|
|
176
|
+
],
|
|
94
177
|
type: "problem",
|
|
95
178
|
},
|
|
96
179
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-react-component-keys.js","sourceRoot":"","sources":["../../src/rules/require-react-component-keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"require-react-component-keys.js","sourceRoot":"","sources":["../../src/rules/require-react-component-keys.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,eAAe,GAA0B;IAC9C,aAAa,EAAE,KAAK;IACpB,qBAAqB,EAAE,CAAC,iBAAiB,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,SAAS,eAAe,CAAC,IAAyB;IACjD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QACnD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