@futdevpro/dynamo-eslint 1.20.3 → 1.20.5

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 (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +304 -304
  3. package/build/plugin/rules/ts/no-as-cast.d.ts.map +1 -1
  4. package/build/plugin/rules/ts/no-as-cast.js +43 -0
  5. package/build/plugin/rules/ts/no-as-cast.js.map +1 -1
  6. package/package.json +14 -7
  7. package/.c8rc.json +0 -26
  8. package/.cursor/rules/__assistant_guide.mdc +0 -30
  9. package/.cursor/rules/__main.mdc +0 -64
  10. package/.cursor/rules/_ag_backend-structure.mdc +0 -86
  11. package/.cursor/rules/_ag_backend.mdc +0 -16
  12. package/.cursor/rules/_ag_debug.mdc +0 -8
  13. package/.cursor/rules/_ag_documentation_writing_rules.mdc +0 -372
  14. package/.cursor/rules/_ag_file-refactoring.mdc +0 -113
  15. package/.cursor/rules/_ag_fixes_rules.mdc +0 -6
  16. package/.cursor/rules/_ag_frontend-structure.mdc +0 -87
  17. package/.cursor/rules/_ag_frontend.mdc +0 -40
  18. package/.cursor/rules/_ag_import-rules.mdc +0 -45
  19. package/.cursor/rules/_ag_naming.mdc +0 -116
  20. package/.cursor/rules/_ag_running_commands.mdc +0 -5
  21. package/.cursor/rules/_ag_server-controller.mdc +0 -6
  22. package/.cursor/rules/_ag_should-be.mdc +0 -7
  23. package/.cursor/rules/_ag_swearing.mdc +0 -47
  24. package/.cursor/rules/ai_development_guide.md +0 -61
  25. package/.cursor/rules/ai_directives.md +0 -114
  26. package/.cursor/rules/cursor-rules.md +0 -160
  27. package/.cursor/rules/default-command.mdc +0 -465
  28. package/.cursor/rules/error_code_pattern.md +0 -40
  29. package/.cursor/rules/saved rule mcp server use.md +0 -16
  30. package/.dynamo/pipeline.cicd.config.json +0 -184
  31. package/.dynamo/version-bump.config.json +0 -5
  32. package/.eslintrc.json +0 -4
  33. package/.github/workflows/main.yml +0 -436
  34. package/.husky/pre-commit +0 -2
  35. package/.vscode/settings.json +0 -11
  36. package/__documentations/2026-04-18-ccap-review-integration.md +0 -173
  37. package/__documentations/2026-08-18-bfr-ctm-005-eslint9-validator-report.md +0 -45
  38. package/__documentations/2026-08-22-angular-20-phase2-release.md +0 -83
  39. package/eslint.config.js +0 -15
  40. package/pnpm-workspace.yaml +0 -2
  41. package/samples/.vscode/settings.json +0 -13
  42. package/samples/base/.eslintrc.json +0 -6
  43. package/samples/base/eslint.config.js +0 -3
  44. package/samples/fsm/.eslintrc.json +0 -4
  45. package/samples/fsm/eslint.config.js +0 -3
  46. package/samples/ngx/.eslintrc.json +0 -6
  47. package/samples/ngx/eslint.config.js +0 -3
  48. package/samples/ngx-package/.eslintrc.json +0 -4
  49. package/samples/ngx-package/eslint.config.js +0 -3
  50. package/samples/nts/.eslintrc.json +0 -6
  51. package/samples/nts/eslint.config.js +0 -3
  52. package/samples/nts-package/.eslintrc.json +0 -4
  53. package/samples/nts-package/eslint.config.js +0 -3
  54. package/samples/package.json.example +0 -22
  55. package/samples/poc-sample.ts +0 -38
  56. package/samples/poc-violations.ts +0 -54
  57. package/scripts/run-coverage-tests.js +0 -24
  58. package/spec/support/helpers/ts-node-helper.js +0 -9
  59. package/spec/support/jasmine.coverage.json +0 -23
  60. package/spec/support/jasmine.json +0 -24
  61. package/src/configs/angular20-compatibility.spec.ts +0 -73
  62. package/src/configs/base.ts +0 -156
  63. package/src/configs/fsm.ts +0 -10
  64. package/src/configs/ngx-package.ts +0 -10
  65. package/src/configs/ngx.ts +0 -93
  66. package/src/configs/nts-package.ts +0 -20
  67. package/src/configs/nts.ts +0 -34
  68. package/src/index.ts +0 -4
  69. package/src/plugin/index.ts +0 -86
  70. package/src/plugin/rules/angular/angular-for-track-logic.spec.ts +0 -44
  71. package/src/plugin/rules/angular/angular-for-track-logic.ts +0 -88
  72. package/src/plugin/rules/angular/effect-signal-loop.spec.ts +0 -89
  73. package/src/plugin/rules/angular/effect-signal-loop.ts +0 -125
  74. package/src/plugin/rules/angular/no-async-ngoninit.spec.ts +0 -50
  75. package/src/plugin/rules/angular/no-async-ngoninit.ts +0 -43
  76. package/src/plugin/rules/angular/no-component-direct-api.spec.ts +0 -78
  77. package/src/plugin/rules/angular/no-component-direct-api.ts +0 -82
  78. package/src/plugin/rules/angular/no-method-call-in-template.spec.ts +0 -63
  79. package/src/plugin/rules/angular/no-method-call-in-template.ts +0 -89
  80. package/src/plugin/rules/angular/no-ngfor-directive.spec.ts +0 -44
  81. package/src/plugin/rules/angular/no-ngfor-directive.ts +0 -62
  82. package/src/plugin/rules/angular/no-ngif-directive.spec.ts +0 -44
  83. package/src/plugin/rules/angular/no-ngif-directive.ts +0 -62
  84. package/src/plugin/rules/explicit-types.spec.ts +0 -190
  85. package/src/plugin/rules/explicit-types.ts +0 -186
  86. package/src/plugin/rules/import/import-order.spec.ts +0 -219
  87. package/src/plugin/rules/import/import-order.ts +0 -197
  88. package/src/plugin/rules/import/no-import-type.spec.ts +0 -69
  89. package/src/plugin/rules/import/no-import-type.ts +0 -46
  90. package/src/plugin/rules/import/no-js-import.spec.ts +0 -82
  91. package/src/plugin/rules/import/no-js-import.ts +0 -45
  92. package/src/plugin/rules/naming-patterns.spec.ts +0 -189
  93. package/src/plugin/rules/naming-patterns.ts +0 -426
  94. package/src/plugin/rules/no-getter-logic.spec.ts +0 -591
  95. package/src/plugin/rules/no-getter-logic.ts +0 -220
  96. package/src/plugin/rules/prefer-enum-over-string-union.spec.ts +0 -583
  97. package/src/plugin/rules/prefer-enum-over-string-union.ts +0 -333
  98. package/src/plugin/rules/prefer-interface-over-duplicate-types.spec.ts +0 -404
  99. package/src/plugin/rules/prefer-interface-over-duplicate-types.ts +0 -314
  100. package/src/plugin/rules/require-jsdoc-description.spec.ts +0 -779
  101. package/src/plugin/rules/require-jsdoc-description.ts +0 -572
  102. package/src/plugin/rules/require-test-description-prefix.spec.ts +0 -459
  103. package/src/plugin/rules/require-test-description-prefix.ts +0 -154
  104. package/src/plugin/rules/ts/data-model-extends.spec.ts +0 -84
  105. package/src/plugin/rules/ts/data-model-extends.ts +0 -100
  106. package/src/plugin/rules/ts/no-any-type.spec.ts +0 -28
  107. package/src/plugin/rules/ts/no-any-type.ts +0 -36
  108. package/src/plugin/rules/ts/no-as-cast.spec.ts +0 -51
  109. package/src/plugin/rules/ts/no-as-cast.ts +0 -51
  110. package/src/plugin/rules/ts/no-dynamic-imports.spec.ts +0 -54
  111. package/src/plugin/rules/ts/no-dynamic-imports.ts +0 -49
  112. package/src/plugin/rules/ts/no-native-browser-dialogs.spec.ts +0 -54
  113. package/src/plugin/rules/ts/no-native-browser-dialogs.ts +0 -84
  114. package/src/plugin/rules/ts/no-plain-function-export.spec.ts +0 -72
  115. package/src/plugin/rules/ts/no-plain-function-export.ts +0 -73
  116. package/src/plugin/rules/ts/one-export-per-file.spec.ts +0 -64
  117. package/src/plugin/rules/ts/one-export-per-file.ts +0 -77
  118. package/src/scripts/dynamo-fix.ts +0 -172
  119. package/src/scripts/eslintrc-audit.ts +0 -116
  120. package/src/scripts/fix-return-types.spec.ts +0 -65
  121. package/src/scripts/fix-return-types.ts +0 -289
  122. package/src/scripts/validate-imports.ts +0 -292
  123. package/src/scripts/validate-naming.ts +0 -213
  124. package/src/scripts/validator-cli.integration.spec.ts +0 -99
  125. package/tsconfig.json +0 -32
@@ -1,572 +0,0 @@
1
- import { Rule } from 'eslint';
2
-
3
- interface RuleOptions {
4
- scope?: 'public' | 'all';
5
- }
6
-
7
- const rule: Rule.RuleModule = {
8
- meta: {
9
- type: 'suggestion',
10
- docs: {
11
- description: 'Require JSDoc comment blocks with description for functions, classes, interfaces, and enums',
12
- recommended: true,
13
- },
14
- schema: [
15
- {
16
- type: 'object',
17
- properties: {
18
- scope: {
19
- type: 'string',
20
- enum: [ 'public', 'all' ],
21
- default: 'public',
22
- },
23
- },
24
- additionalProperties: false,
25
- },
26
- ],
27
- messages: {
28
- missingJSDoc: '{{type}} "{{name}}" must have a JSDoc comment with description.',
29
- emptyJSDoc: '{{type}} "{{name}}" JSDoc comment must contain description text.',
30
- invalidJSDocPosition: '{{type}} "{{name}}" JSDoc comment must be on the line immediately before.',
31
- },
32
- },
33
- create(context) {
34
- const options: RuleOptions = context.options[0] || {};
35
- const scope: string = options.scope || 'public';
36
- const sourceCode: any = context.sourceCode;
37
-
38
- /**
39
- * Check if a node is public/exported (should be documented)
40
- */
41
- function isPublic(node: any): boolean {
42
- try {
43
- // Check if node itself is exported
44
- if (node.parent && node.parent.type === 'ExportNamedDeclaration') {
45
- return true;
46
- }
47
-
48
- if (node.parent && node.parent.type === 'ExportDefaultDeclaration') {
49
- return true;
50
- }
51
-
52
- // Check for export keyword in declaration
53
- if (node.type === 'FunctionDeclaration' && node.parent &&
54
- node.parent.type === 'Program' && node.id) {
55
- // Top-level function - check if exported
56
- const program: any = node.parent;
57
-
58
- if (program.body && Array.isArray(program.body)) {
59
- for (const statement of program.body) {
60
- if (statement.type === 'ExportNamedDeclaration' &&
61
- statement.declaration === node) {
62
- return true;
63
- }
64
- }
65
- }
66
- }
67
-
68
- // For class members, check accessibility modifiers
69
- if (node.type === 'MethodDefinition' || node.type === 'PropertyDefinition') {
70
- // If has private modifier, it's not public
71
- if (node.accessibility === 'private') {
72
- return false;
73
- }
74
-
75
- // If has protected modifier, it's not public
76
- if (node.accessibility === 'protected') {
77
- return false;
78
- }
79
-
80
- // Default to public if no modifiers
81
- return true;
82
- }
83
-
84
- // For top-level declarations, check if they're exported
85
- if (node.parent && node.parent.type === 'Program') {
86
- // Check if this declaration is exported
87
- const program: any = node.parent;
88
-
89
- if (program.body && Array.isArray(program.body)) {
90
- for (const statement of program.body) {
91
- if (statement.type === 'ExportNamedDeclaration' &&
92
- statement.declaration === node) {
93
- return true;
94
- }
95
-
96
- if (statement.type === 'ExportDefaultDeclaration' &&
97
- statement.declaration === node) {
98
- return true;
99
- }
100
- }
101
- }
102
-
103
- return false; // Not exported
104
- }
105
-
106
- // Default to public for other cases
107
- return true;
108
- } catch (error) {
109
- console.error('[require-jsdoc-description] Error in isPublic:', error);
110
-
111
- return true; // Default to requiring documentation
112
- }
113
- }
114
-
115
- /**
116
- * Check if JSDoc comment is on the line immediately before the node
117
- */
118
- function isJSDocOnPreviousLine(node: any, jsdocComment: any): boolean {
119
- try {
120
- const nodeStart: number | undefined = node.loc?.start?.line;
121
- const commentEnd: number | undefined = jsdocComment.loc?.end?.line;
122
-
123
- if (!nodeStart || !commentEnd) {
124
- return false;
125
- }
126
-
127
- // JSDoc should be on the line immediately before (no blank lines)
128
- // For multi-line comments, check if the last line of the comment is immediately before the node
129
- return commentEnd === nodeStart - 1;
130
- } catch (error) {
131
- console.error('[require-jsdoc-description] Error in isJSDocOnPreviousLine:', error);
132
-
133
- return false;
134
- }
135
- }
136
-
137
- /**
138
- * Extract description text from JSDoc comment
139
- */
140
- function extractDescription(jsdocComment: any): string {
141
- try {
142
- if (!jsdocComment.value) {
143
- return '';
144
- }
145
-
146
- // The comment.value contains the text between /** and */
147
- // It may start with * and include newlines with * at the beginning of each line
148
- const lines = jsdocComment.value.split('\n');
149
- let description = '';
150
-
151
- for (const line of lines) {
152
- // Remove leading whitespace and * character (JSDoc format: " * text" or "* text")
153
- // Handle both formats: " * text" and "* text" and " *text"
154
- const cleanLine = line.replace(/^\s*\*+\s?/, '').trim();
155
-
156
- // Skip empty lines (after removing * and whitespace)
157
- if (!cleanLine) {
158
- continue;
159
- }
160
-
161
- // Stop at @tags (JSDoc tags like @param, @returns, etc.)
162
- if (cleanLine.startsWith('@')) {
163
- break;
164
- }
165
-
166
- // Add to description with space separator
167
- if (description) {
168
- description += ' ';
169
- }
170
- description += cleanLine;
171
- }
172
-
173
- return description.trim();
174
- } catch (error) {
175
- console.error('[require-jsdoc-description] Error in extractDescription:', error);
176
-
177
- return '';
178
- }
179
- }
180
-
181
- /**
182
- * Egy node "tartalmi" leading-comment-jenek megtalalasahoz fel kell masznunk a
183
- * szintaktikai burkokon, mert a JSDoc nem mindig a belso deklaracio ele kerul:
184
- * - `export class X` / `export interface Y` / `export type Z` / `export enum E`:
185
- * a JSDoc az ExportNamedDeclaration / ExportDefaultDeclaration ELE kerul, NEM
186
- * a belso deklaracio-node ele.
187
- * - arrow-const (`export const fn = () => {}`): a JSDoc a VariableDeclaration
188
- * (ill. annak export-wrapper-e) ele kerul, nem a VariableDeclarator ele.
189
- * - dekorator (pl. `@Component()`-tel annotalt class): a JSDoc a dekorator-stack
190
- * fole kerul, igy a belso class-node kozvetlen elott nincs comment.
191
- * Ez a helper visszaadja azokat a "horgony" node-okat, amik ele a
192
- * getCommentsBefore-t erdemes hivni — sorrendben a legkulso burkolotol befele.
193
- */
194
- function getCommentAnchors(node: any): any[] {
195
- const anchors: any[] = [ node ];
196
-
197
- try {
198
- let climbed: any = node;
199
-
200
- // arrow-const: VariableDeclarator → VariableDeclaration
201
- if (climbed.parent && climbed.parent.type === 'VariableDeclaration') {
202
- climbed = climbed.parent;
203
- }
204
-
205
- // export-wrapper: <decl> → ExportNamedDeclaration / ExportDefaultDeclaration
206
- // (csak akkor maszunk fel, ha a wrapper tenyleg EZT a node-ot exportalja)
207
- if (climbed.parent
208
- && (climbed.parent.type === 'ExportNamedDeclaration' || climbed.parent.type === 'ExportDefaultDeclaration')
209
- && climbed.parent.declaration === climbed) {
210
- climbed = climbed.parent;
211
- }
212
-
213
- // a legkulso burkolo elore kerul (ott van a tartalmi JSDoc tipikusan)
214
- if (climbed !== node) {
215
- anchors.unshift(climbed);
216
- }
217
-
218
- // dekorator: a JSDoc a dekorator-stack fole is kerulhet
219
- if (Array.isArray(node.decorators) && node.decorators.length > 0) {
220
- anchors.push(node.decorators[0]);
221
- }
222
- } catch (error) {
223
- console.error('[require-jsdoc-description] Error in getCommentAnchors:', error);
224
- }
225
-
226
- return anchors;
227
- }
228
-
229
- /**
230
- * Az osszes szoba johheto "horgony" elott levo comment osszegyujtese. A
231
- * getLeadingComments a getCommentsBefore-t MINDEN anchor-ra meghivja es
232
- * osszefuzi az eredmenyt — a hasValidJSDoc utana az elso JSDoc-blokkot
233
- * keresi ki belole, igy mindegy hogy melyik burok elott talalja meg.
234
- */
235
- function getLeadingComments(node: any): any[] {
236
- const all: any[] = [];
237
-
238
- for (const anchor of getCommentAnchors(node)) {
239
- const before: any[] = sourceCode.getCommentsBefore(anchor) || [];
240
-
241
- for (const comment of before) {
242
- all.push(comment);
243
- }
244
- }
245
-
246
- return all;
247
- }
248
-
249
- /**
250
- * Check if node has valid JSDoc comment
251
- */
252
- function hasValidJSDoc(node: any): { hasJSDoc: boolean; isValid: boolean; isOnPreviousLine: boolean } {
253
- try {
254
- const comments = getLeadingComments(node);
255
-
256
- // Find JSDoc comment (/** ... */)
257
- // JSDoc comments are Block comments where the value (content between /** and */) starts with *
258
- const jsdocComment = comments.find((comment: any) => {
259
- if (comment.type !== 'Block') {
260
- return false;
261
- }
262
-
263
- const value = comment.value || '';
264
-
265
- // JSDoc comment value should start with * (the first character after /**)
266
- // Handle cases where there might be whitespace before the *
267
- return value.trim().startsWith('*');
268
- });
269
-
270
- if (!jsdocComment) {
271
- return { hasJSDoc: false, isValid: false, isOnPreviousLine: false };
272
- }
273
-
274
- const isOnPreviousLine: boolean = isJSDocOnPreviousLine(node, jsdocComment);
275
- const description: string = extractDescription(jsdocComment);
276
- const isValid: boolean = description.length > 0;
277
-
278
- return { hasJSDoc: true, isValid, isOnPreviousLine };
279
- } catch (error) {
280
- console.error('[require-jsdoc-description] Error in hasValidJSDoc:', error);
281
-
282
- return { hasJSDoc: false, isValid: false, isOnPreviousLine: false };
283
- }
284
- }
285
-
286
- /**
287
- * Get node name for error messages
288
- */
289
- function getNodeName(node: any): string {
290
- try {
291
- if (node.id && node.id.name) {
292
- return node.id.name;
293
- }
294
-
295
- if (node.key && node.key.name) {
296
- return node.key.name;
297
- }
298
-
299
- if (node.name && node.name.name) {
300
- return node.name.name;
301
- }
302
-
303
- return 'anonymous';
304
- } catch (error) {
305
- console.error('[require-jsdoc-description] Error in getNodeName:', error);
306
-
307
- return 'unknown';
308
- }
309
- }
310
-
311
- /**
312
- * Get node name location for error reporting
313
- */
314
- function getNodeNameLoc(node: any): { start: { line: number; column: number }; end: { line: number; column: number } } | null {
315
- try {
316
- // For MethodDefinition, use key.loc
317
- if (node.key && node.key.loc) {
318
- return node.key.loc;
319
- }
320
-
321
- // For declarations with id (FunctionDeclaration, ClassDeclaration, etc.)
322
- if (node.id && node.id.loc) {
323
- return node.id.loc;
324
- }
325
-
326
- // For VariableDeclarator
327
- if (node.id && node.id.loc) {
328
- return node.id.loc;
329
- }
330
-
331
- // Fallback to node location if name location not found
332
- if (node.loc) {
333
- return node.loc;
334
- }
335
-
336
- return null;
337
- } catch (error) {
338
- console.error('[require-jsdoc-description] Error in getNodeNameLoc:', error);
339
-
340
- return null;
341
- }
342
- }
343
-
344
- /**
345
- * Get node type for error messages
346
- */
347
- function getNodeType(node: any): string {
348
- try {
349
- // Check if it's a VariableDeclarator with function expression
350
- if (node.type === 'VariableDeclarator' && node.init) {
351
- if (node.init.type === 'FunctionExpression' || node.init.type === 'ArrowFunctionExpression') {
352
- return 'Function';
353
- }
354
- }
355
-
356
- switch (node.type) {
357
- case 'FunctionDeclaration':
358
- return 'Function';
359
- case 'FunctionExpression':
360
- return 'Function';
361
- case 'ArrowFunctionExpression':
362
- return 'Function';
363
- case 'ClassDeclaration':
364
- return 'Class';
365
- case 'TSInterfaceDeclaration':
366
- return 'Interface';
367
- case 'TSEnumDeclaration':
368
- return 'Enum';
369
- case 'TSTypeAliasDeclaration':
370
- return 'Type';
371
- case 'MethodDefinition':
372
- return 'Method';
373
- case 'PropertyDefinition':
374
- return 'Property';
375
-
376
- default:
377
- return 'Declaration';
378
- }
379
- } catch (error) {
380
- console.error('[require-jsdoc-description] Error in getNodeType:', error);
381
-
382
- return 'Declaration';
383
- }
384
- }
385
-
386
- /**
387
- * Check if node should be documented based on scope
388
- */
389
- function shouldBeDocumented(node: any): boolean {
390
- try {
391
- if (scope === 'all') {
392
- return true;
393
- }
394
-
395
- if (scope === 'public') {
396
- return isPublic(node);
397
- }
398
-
399
- return true; // Default to requiring documentation
400
- } catch (error) {
401
- console.error('[require-jsdoc-description] Error in shouldBeDocumented:', error);
402
-
403
- return true;
404
- }
405
- }
406
-
407
- /**
408
- * Report missing or invalid JSDoc
409
- */
410
- function reportJSDocIssue(
411
- node: any,
412
- jsdocResult: { hasJSDoc: boolean; isValid: boolean; isOnPreviousLine: boolean }
413
- ): void {
414
- try {
415
- const name = getNodeName(node);
416
- const type = getNodeType(node);
417
- const nameLoc = getNodeNameLoc(node);
418
-
419
- // Fallback to node location if name location not found
420
- const reportLoc = nameLoc || node.loc;
421
-
422
- if (!jsdocResult.hasJSDoc) {
423
- context.report({
424
- loc: reportLoc,
425
- messageId: 'missingJSDoc',
426
- data: { type, name },
427
- });
428
- } else if (!jsdocResult.isOnPreviousLine) {
429
- context.report({
430
- loc: reportLoc,
431
- messageId: 'invalidJSDocPosition',
432
- data: { type, name },
433
- });
434
- } else if (!jsdocResult.isValid) {
435
- context.report({
436
- loc: reportLoc,
437
- messageId: 'emptyJSDoc',
438
- data: { type, name },
439
- });
440
- }
441
- } catch (error) {
442
- console.error('[require-jsdoc-description] Error in reportJSDocIssue:', error);
443
- }
444
- }
445
-
446
- return {
447
- // Function declarations
448
- FunctionDeclaration(node: any): void {
449
- try {
450
- if (!shouldBeDocumented(node)) {
451
- return;
452
- }
453
-
454
- const jsdocResult = hasValidJSDoc(node);
455
-
456
- if (!jsdocResult.hasJSDoc || !jsdocResult.isValid || !jsdocResult.isOnPreviousLine) {
457
- reportJSDocIssue(node, jsdocResult);
458
- }
459
- } catch (error) {
460
- console.error('[require-jsdoc-description] Error in FunctionDeclaration visitor:', error);
461
- }
462
- },
463
-
464
- // Function expressions (when assigned to variables)
465
- VariableDeclarator(node: any): void {
466
- try {
467
- if (node.init &&
468
- (node.init.type === 'FunctionExpression' || node.init.type === 'ArrowFunctionExpression')) {
469
- if (!shouldBeDocumented(node)) {
470
- return;
471
- }
472
-
473
- const jsdocResult = hasValidJSDoc(node);
474
-
475
- if (!jsdocResult.hasJSDoc || !jsdocResult.isValid || !jsdocResult.isOnPreviousLine) {
476
- reportJSDocIssue(node, jsdocResult);
477
- }
478
- }
479
- } catch (error) {
480
- console.error('[require-jsdoc-description] Error in VariableDeclarator visitor:', error);
481
- }
482
- },
483
-
484
- // Class declarations
485
- ClassDeclaration(node: any): void {
486
- try {
487
- if (!shouldBeDocumented(node)) {
488
- return;
489
- }
490
-
491
- const jsdocResult = hasValidJSDoc(node);
492
-
493
- if (!jsdocResult.hasJSDoc || !jsdocResult.isValid || !jsdocResult.isOnPreviousLine) {
494
- reportJSDocIssue(node, jsdocResult);
495
- }
496
- } catch (error) {
497
- console.error('[require-jsdoc-description] Error in ClassDeclaration visitor:', error);
498
- }
499
- },
500
-
501
- // Interface declarations
502
- TSInterfaceDeclaration(node: any): void {
503
- try {
504
- if (!shouldBeDocumented(node)) {
505
- return;
506
- }
507
-
508
- const jsdocResult = hasValidJSDoc(node);
509
-
510
- if (!jsdocResult.hasJSDoc || !jsdocResult.isValid || !jsdocResult.isOnPreviousLine) {
511
- reportJSDocIssue(node, jsdocResult);
512
- }
513
- } catch (error) {
514
- console.error('[require-jsdoc-description] Error in TSInterfaceDeclaration visitor:', error);
515
- }
516
- },
517
-
518
- // Enum declarations
519
- TSEnumDeclaration(node: any): void {
520
- try {
521
- if (!shouldBeDocumented(node)) {
522
- return;
523
- }
524
-
525
- const jsdocResult = hasValidJSDoc(node);
526
-
527
- if (!jsdocResult.hasJSDoc || !jsdocResult.isValid || !jsdocResult.isOnPreviousLine) {
528
- reportJSDocIssue(node, jsdocResult);
529
- }
530
- } catch (error) {
531
- console.error('[require-jsdoc-description] Error in TSEnumDeclaration visitor:', error);
532
- }
533
- },
534
-
535
- // Type alias declarations (CCAP-megerősítés: exportált `type X = …` kötelező JSDoc).
536
- TSTypeAliasDeclaration(node: any): void {
537
- try {
538
- if (!shouldBeDocumented(node)) {
539
- return;
540
- }
541
-
542
- const jsdocResult = hasValidJSDoc(node);
543
-
544
- if (!jsdocResult.hasJSDoc || !jsdocResult.isValid || !jsdocResult.isOnPreviousLine) {
545
- reportJSDocIssue(node, jsdocResult);
546
- }
547
- } catch (error) {
548
- console.error('[require-jsdoc-description] Error in TSTypeAliasDeclaration visitor:', error);
549
- }
550
- },
551
-
552
- // Class methods
553
- MethodDefinition(node: any): void {
554
- try {
555
- if (!shouldBeDocumented(node)) {
556
- return;
557
- }
558
-
559
- const jsdocResult = hasValidJSDoc(node);
560
-
561
- if (!jsdocResult.hasJSDoc || !jsdocResult.isValid || !jsdocResult.isOnPreviousLine) {
562
- reportJSDocIssue(node, jsdocResult);
563
- }
564
- } catch (error) {
565
- console.error('[require-jsdoc-description] Error in MethodDefinition visitor:', error);
566
- }
567
- },
568
- };
569
- },
570
- };
571
-
572
- export default rule;