@futdevpro/dynamo-eslint 1.14.24 → 1.14.26
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/.github/workflows/main.yml +6 -1
- package/build/configs/base.js +1 -0
- package/build/configs/base.js.map +1 -1
- package/build/plugin/index.d.ts +2 -0
- package/build/plugin/index.d.ts.map +1 -1
- package/build/plugin/index.js +3 -0
- package/build/plugin/index.js.map +1 -1
- package/build/plugin/rules/no-getter-logic.d.ts +4 -0
- package/build/plugin/rules/no-getter-logic.d.ts.map +1 -0
- package/build/plugin/rules/no-getter-logic.js +176 -0
- package/build/plugin/rules/no-getter-logic.js.map +1 -0
- package/build/plugin/rules/no-getter-logic.spec.d.ts +2 -0
- package/build/plugin/rules/no-getter-logic.spec.d.ts.map +1 -0
- package/build/plugin/rules/no-getter-logic.spec.js +461 -0
- package/build/plugin/rules/no-getter-logic.spec.js.map +1 -0
- package/build/plugin/rules/require-jsdoc-description.d.ts.map +1 -1
- package/build/plugin/rules/require-jsdoc-description.js +34 -3
- package/build/plugin/rules/require-jsdoc-description.js.map +1 -1
- package/futdevpro-dynamo-eslint-1.14.26.tgz +0 -0
- package/package.json +2 -2
- package/src/configs/base.ts +1 -0
- package/src/plugin/index.ts +3 -0
- package/src/plugin/rules/no-getter-logic.spec.ts +520 -0
- package/src/plugin/rules/no-getter-logic.ts +201 -0
- package/src/plugin/rules/require-jsdoc-description.ts +40 -3
- package/futdevpro-dynamo-eslint-1.14.24.tgz +0 -0
|
@@ -228,6 +228,39 @@ const rule: Rule.RuleModule = {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Get node name location for error reporting
|
|
233
|
+
*/
|
|
234
|
+
function getNodeNameLoc(node: any): { start: { line: number; column: number }; end: { line: number; column: number } } | null {
|
|
235
|
+
try {
|
|
236
|
+
// For MethodDefinition, use key.loc
|
|
237
|
+
if (node.key && node.key.loc) {
|
|
238
|
+
return node.key.loc;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// For declarations with id (FunctionDeclaration, ClassDeclaration, etc.)
|
|
242
|
+
if (node.id && node.id.loc) {
|
|
243
|
+
return node.id.loc;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// For VariableDeclarator
|
|
247
|
+
if (node.id && node.id.loc) {
|
|
248
|
+
return node.id.loc;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Fallback to node location if name location not found
|
|
252
|
+
if (node.loc) {
|
|
253
|
+
return node.loc;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return null;
|
|
257
|
+
} catch (error) {
|
|
258
|
+
console.error('[require-jsdoc-description] Error in getNodeNameLoc:', error);
|
|
259
|
+
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
231
264
|
/**
|
|
232
265
|
* Get node type for error messages
|
|
233
266
|
*/
|
|
@@ -299,22 +332,26 @@ const rule: Rule.RuleModule = {
|
|
|
299
332
|
try {
|
|
300
333
|
const name = getNodeName(node);
|
|
301
334
|
const type = getNodeType(node);
|
|
335
|
+
const nameLoc = getNodeNameLoc(node);
|
|
336
|
+
|
|
337
|
+
// Fallback to node location if name location not found
|
|
338
|
+
const reportLoc = nameLoc || node.loc;
|
|
302
339
|
|
|
303
340
|
if (!jsdocResult.hasJSDoc) {
|
|
304
341
|
context.report({
|
|
305
|
-
|
|
342
|
+
loc: reportLoc,
|
|
306
343
|
messageId: 'missingJSDoc',
|
|
307
344
|
data: { type, name },
|
|
308
345
|
});
|
|
309
346
|
} else if (!jsdocResult.isOnPreviousLine) {
|
|
310
347
|
context.report({
|
|
311
|
-
|
|
348
|
+
loc: reportLoc,
|
|
312
349
|
messageId: 'invalidJSDocPosition',
|
|
313
350
|
data: { type, name },
|
|
314
351
|
});
|
|
315
352
|
} else if (!jsdocResult.isValid) {
|
|
316
353
|
context.report({
|
|
317
|
-
|
|
354
|
+
loc: reportLoc,
|
|
318
355
|
messageId: 'emptyJSDoc',
|
|
319
356
|
data: { type, name },
|
|
320
357
|
});
|
|
Binary file
|