@futdevpro/dynamo-eslint 1.15.28 → 1.20.3

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 (108) hide show
  1. package/README.md +13 -16
  2. package/__documentations/2026-08-22-angular-20-phase2-release.md +83 -0
  3. package/build/configs/base.d.ts +8 -9
  4. package/build/configs/base.d.ts.map +1 -1
  5. package/build/configs/base.js +149 -150
  6. package/build/configs/base.js.map +1 -1
  7. package/build/configs/fsm.d.ts +1 -1
  8. package/build/configs/fsm.js +7 -7
  9. package/build/configs/ngx-package.d.ts +1 -1
  10. package/build/configs/ngx-package.js +7 -7
  11. package/build/configs/ngx.d.ts +2 -4
  12. package/build/configs/ngx.d.ts.map +1 -1
  13. package/build/configs/ngx.js +88 -91
  14. package/build/configs/ngx.js.map +1 -1
  15. package/build/configs/nts-package.d.ts +1 -1
  16. package/build/configs/nts-package.js +17 -17
  17. package/build/configs/nts.d.ts +1 -1
  18. package/build/configs/nts.js +31 -31
  19. package/build/index.d.ts +1 -1
  20. package/build/index.js +2 -2
  21. package/build/plugin/index.d.ts +52 -52
  22. package/build/plugin/index.js +80 -80
  23. package/build/plugin/rules/angular/angular-for-track-logic.d.ts +7 -7
  24. package/build/plugin/rules/angular/angular-for-track-logic.js +81 -81
  25. package/build/plugin/rules/angular/effect-signal-loop.d.ts +9 -9
  26. package/build/plugin/rules/angular/effect-signal-loop.js +112 -112
  27. package/build/plugin/rules/angular/no-async-ngoninit.d.ts +8 -8
  28. package/build/plugin/rules/angular/no-async-ngoninit.js +42 -42
  29. package/build/plugin/rules/angular/no-component-direct-api.d.ts +9 -9
  30. package/build/plugin/rules/angular/no-component-direct-api.js +75 -75
  31. package/build/plugin/rules/angular/no-method-call-in-template.d.ts +8 -8
  32. package/build/plugin/rules/angular/no-method-call-in-template.js +79 -79
  33. package/build/plugin/rules/angular/no-ngfor-directive.d.ts +7 -7
  34. package/build/plugin/rules/angular/no-ngfor-directive.js +59 -59
  35. package/build/plugin/rules/angular/no-ngif-directive.d.ts +7 -7
  36. package/build/plugin/rules/angular/no-ngif-directive.js +59 -59
  37. package/build/plugin/rules/explicit-types.d.ts +3 -3
  38. package/build/plugin/rules/explicit-types.js +178 -178
  39. package/build/plugin/rules/import/import-order.d.ts +3 -3
  40. package/build/plugin/rules/import/import-order.js +154 -154
  41. package/build/plugin/rules/import/no-import-type.d.ts +3 -3
  42. package/build/plugin/rules/import/no-import-type.js +45 -45
  43. package/build/plugin/rules/import/no-js-import.d.ts +3 -3
  44. package/build/plugin/rules/import/no-js-import.js +40 -40
  45. package/build/plugin/rules/naming-patterns.d.ts +7 -7
  46. package/build/plugin/rules/naming-patterns.js +366 -366
  47. package/build/plugin/rules/no-getter-logic.d.ts +3 -3
  48. package/build/plugin/rules/no-getter-logic.js +194 -194
  49. package/build/plugin/rules/no-getter-logic.js.map +1 -1
  50. package/build/plugin/rules/prefer-enum-over-string-union.d.ts +3 -3
  51. package/build/plugin/rules/prefer-enum-over-string-union.js +289 -289
  52. package/build/plugin/rules/prefer-enum-over-string-union.js.map +1 -1
  53. package/build/plugin/rules/prefer-interface-over-duplicate-types.d.ts +3 -3
  54. package/build/plugin/rules/prefer-interface-over-duplicate-types.js +264 -264
  55. package/build/plugin/rules/prefer-interface-over-duplicate-types.js.map +1 -1
  56. package/build/plugin/rules/require-jsdoc-description.d.ts +3 -3
  57. package/build/plugin/rules/require-jsdoc-description.js +496 -496
  58. package/build/plugin/rules/require-jsdoc-description.js.map +1 -1
  59. package/build/plugin/rules/require-test-description-prefix.d.ts +3 -3
  60. package/build/plugin/rules/require-test-description-prefix.js +135 -135
  61. package/build/plugin/rules/ts/data-model-extends.d.ts +8 -8
  62. package/build/plugin/rules/ts/data-model-extends.js +94 -94
  63. package/build/plugin/rules/ts/no-any-type.d.ts +8 -8
  64. package/build/plugin/rules/ts/no-any-type.js +36 -36
  65. package/build/plugin/rules/ts/no-as-cast.d.ts +8 -8
  66. package/build/plugin/rules/ts/no-as-cast.js +49 -49
  67. package/build/plugin/rules/ts/no-dynamic-imports.d.ts +8 -8
  68. package/build/plugin/rules/ts/no-dynamic-imports.js +50 -50
  69. package/build/plugin/rules/ts/no-native-browser-dialogs.d.ts +8 -8
  70. package/build/plugin/rules/ts/no-native-browser-dialogs.js +78 -78
  71. package/build/plugin/rules/ts/no-plain-function-export.d.ts +9 -9
  72. package/build/plugin/rules/ts/no-plain-function-export.js +69 -69
  73. package/build/plugin/rules/ts/one-export-per-file.d.ts +8 -8
  74. package/build/plugin/rules/ts/one-export-per-file.js +73 -73
  75. package/build/scripts/dynamo-fix.d.ts +26 -26
  76. package/build/scripts/dynamo-fix.js +146 -146
  77. package/build/scripts/dynamo-fix.js.map +1 -1
  78. package/build/scripts/eslintrc-audit.d.ts +26 -26
  79. package/build/scripts/eslintrc-audit.js +100 -100
  80. package/build/scripts/fix-return-types.d.ts +74 -74
  81. package/build/scripts/fix-return-types.d.ts.map +1 -1
  82. package/build/scripts/fix-return-types.js +226 -226
  83. package/build/scripts/fix-return-types.js.map +1 -1
  84. package/build/scripts/validate-imports.d.ts +26 -26
  85. package/build/scripts/validate-imports.js +170 -157
  86. package/build/scripts/validate-imports.js.map +1 -1
  87. package/build/scripts/validate-naming.d.ts +26 -26
  88. package/build/scripts/validate-naming.js +170 -157
  89. package/build/scripts/validate-naming.js.map +1 -1
  90. package/eslint.config.js +1 -1
  91. package/package.json +104 -105
  92. package/pnpm-workspace.yaml +2 -0
  93. package/samples/package.json.example +5 -9
  94. package/src/configs/angular20-compatibility.spec.ts +73 -0
  95. package/src/configs/base.ts +3 -4
  96. package/src/configs/ngx.ts +7 -10
  97. package/src/plugin/rules/no-getter-logic.ts +1 -1
  98. package/src/plugin/rules/prefer-enum-over-string-union.spec.ts +9 -9
  99. package/src/plugin/rules/prefer-enum-over-string-union.ts +7 -8
  100. package/src/plugin/rules/prefer-interface-over-duplicate-types.spec.ts +22 -22
  101. package/src/plugin/rules/prefer-interface-over-duplicate-types.ts +2 -2
  102. package/src/plugin/rules/require-jsdoc-description.spec.ts +2 -2
  103. package/src/plugin/rules/require-jsdoc-description.ts +7 -7
  104. package/src/scripts/dynamo-fix.ts +1 -1
  105. package/src/scripts/fix-return-types.ts +4 -3
  106. package/src/scripts/validate-imports.ts +29 -15
  107. package/src/scripts/validate-naming.ts +29 -20
  108. package/src/scripts/validator-cli.integration.spec.ts +11 -8
@@ -1,179 +1,179 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const rule = {
4
- meta: {
5
- type: 'suggestion',
6
- docs: {
7
- description: 'Enforce explicit type annotations on all TypeScript declarations',
8
- recommended: true,
9
- },
10
- schema: [],
11
- messages: {
12
- missingReturnType: 'Function "{{name}}" must have an explicit return type annotation.',
13
- missingArrowReturnType: 'Arrow function must have an explicit return type annotation.',
14
- missingVariableType: 'Variable "{{name}}" must have an explicit type annotation.',
15
- missingParameterType: 'Parameter "{{name}}" must have an explicit type annotation.',
16
- missingPropertyType: 'Class property "{{name}}" must have an explicit type annotation.',
17
- missingDestructuringType: 'Destructuring assignment must have explicit type annotations.',
18
- },
19
- },
20
- create(context) {
21
- return {
22
- // Function declarations
23
- FunctionDeclaration(node) {
24
- try {
25
- // Check return type
26
- if (!node.returnType) {
27
- context.report({
28
- node: node.id || node, // Report on function name if available
29
- messageId: 'missingReturnType',
30
- data: { name: node.id?.name || 'anonymous' },
31
- });
32
- }
33
- // Check function parameters with defensive checks
34
- if (node.params && Array.isArray(node.params)) {
35
- node.params.forEach((param) => {
36
- try {
37
- if (param && param.type === 'Identifier' && !param.typeAnnotation) {
38
- context.report({
39
- node: param,
40
- messageId: 'missingParameterType',
41
- data: { name: param.name || 'unknown' },
42
- });
43
- }
44
- }
45
- catch (paramError) {
46
- console.error('[explicit-types] Error processing function parameter:', paramError);
47
- }
48
- });
49
- }
50
- }
51
- catch (error) {
52
- console.error('[explicit-types] Error in FunctionDeclaration visitor:', error);
53
- }
54
- },
55
- // Arrow functions
56
- ArrowFunctionExpression(node) {
57
- try {
58
- // Check return type
59
- if (!node.returnType) {
60
- context.report({
61
- node: node.params.length > 0 ? node.params[0] : node, // Report on first param or node
62
- messageId: 'missingArrowReturnType',
63
- });
64
- }
65
- // Check arrow function parameters with defensive checks
66
- if (node.params && Array.isArray(node.params)) {
67
- node.params.forEach((param) => {
68
- try {
69
- if (param && param.type === 'Identifier' && !param.typeAnnotation) {
70
- context.report({
71
- node: param,
72
- messageId: 'missingParameterType',
73
- data: { name: param.name || 'unknown' },
74
- });
75
- }
76
- }
77
- catch (paramError) {
78
- console.error('[explicit-types] Error processing arrow function parameter:', paramError);
79
- }
80
- });
81
- }
82
- }
83
- catch (error) {
84
- console.error('[explicit-types] Error in ArrowFunctionExpression visitor:', error);
85
- }
86
- },
87
- // Variable declarations
88
- VariableDeclarator(node) {
89
- try {
90
- // Defensive check for node.id
91
- if (!node.id) {
92
- return;
93
- }
94
- if (!node.id.typeAnnotation) {
95
- // Check if this variable is declared in a for loop
96
- let isInForLoop = false;
97
- let parent = node.parent;
98
- while (parent) {
99
- if (parent.type === 'ForStatement' || parent.type === 'ForInStatement' || parent.type === 'ForOfStatement') {
100
- isInForLoop = true;
101
- break;
102
- }
103
- parent = parent.parent;
104
- }
105
- // Skip if variable is in a for loop
106
- if (isInForLoop) {
107
- return;
108
- }
109
- // Skip if variable is initialized with a typed value that can be inferred
110
- const hasTypedInitializer = node.init && (node.init.type === 'CallExpression' ||
111
- node.init.type === 'NewExpression' ||
112
- node.init.type === 'ArrayExpression' ||
113
- node.init.type === 'ObjectExpression' ||
114
- node.init.type === 'Literal');
115
- if (!hasTypedInitializer) {
116
- context.report({
117
- node: node.id,
118
- messageId: 'missingVariableType',
119
- data: { name: node.id?.name || 'destructured' },
120
- });
121
- }
122
- }
123
- }
124
- catch (error) {
125
- console.error('[explicit-types] Error in VariableDeclarator visitor:', error);
126
- }
127
- },
128
- // Class properties
129
- PropertyDefinition(node) {
130
- try {
131
- // Defensive check for node.key
132
- if (!node.key) {
133
- return;
134
- }
135
- if (!node.typeAnnotation && !node.value) {
136
- context.report({
137
- node: node.key,
138
- messageId: 'missingPropertyType',
139
- data: { name: node.key?.name || 'computed' },
140
- });
141
- }
142
- }
143
- catch (error) {
144
- console.error('[explicit-types] Error in PropertyDefinition visitor:', error);
145
- }
146
- },
147
- // Object destructuring
148
- ObjectPattern(node) {
149
- try {
150
- if (!node.typeAnnotation) {
151
- context.report({
152
- node,
153
- messageId: 'missingDestructuringType',
154
- });
155
- }
156
- }
157
- catch (error) {
158
- console.error('[explicit-types] Error in ObjectPattern visitor:', error);
159
- }
160
- },
161
- // Array destructuring
162
- ArrayPattern(node) {
163
- try {
164
- if (!node.typeAnnotation) {
165
- context.report({
166
- node,
167
- messageId: 'missingDestructuringType',
168
- });
169
- }
170
- }
171
- catch (error) {
172
- console.error('[explicit-types] Error in ArrayPattern visitor:', error);
173
- }
174
- },
175
- };
176
- },
177
- };
178
- exports.default = rule;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rule = {
4
+ meta: {
5
+ type: 'suggestion',
6
+ docs: {
7
+ description: 'Enforce explicit type annotations on all TypeScript declarations',
8
+ recommended: true,
9
+ },
10
+ schema: [],
11
+ messages: {
12
+ missingReturnType: 'Function "{{name}}" must have an explicit return type annotation.',
13
+ missingArrowReturnType: 'Arrow function must have an explicit return type annotation.',
14
+ missingVariableType: 'Variable "{{name}}" must have an explicit type annotation.',
15
+ missingParameterType: 'Parameter "{{name}}" must have an explicit type annotation.',
16
+ missingPropertyType: 'Class property "{{name}}" must have an explicit type annotation.',
17
+ missingDestructuringType: 'Destructuring assignment must have explicit type annotations.',
18
+ },
19
+ },
20
+ create(context) {
21
+ return {
22
+ // Function declarations
23
+ FunctionDeclaration(node) {
24
+ try {
25
+ // Check return type
26
+ if (!node.returnType) {
27
+ context.report({
28
+ node: node.id || node, // Report on function name if available
29
+ messageId: 'missingReturnType',
30
+ data: { name: node.id?.name || 'anonymous' },
31
+ });
32
+ }
33
+ // Check function parameters with defensive checks
34
+ if (node.params && Array.isArray(node.params)) {
35
+ node.params.forEach((param) => {
36
+ try {
37
+ if (param && param.type === 'Identifier' && !param.typeAnnotation) {
38
+ context.report({
39
+ node: param,
40
+ messageId: 'missingParameterType',
41
+ data: { name: param.name || 'unknown' },
42
+ });
43
+ }
44
+ }
45
+ catch (paramError) {
46
+ console.error('[explicit-types] Error processing function parameter:', paramError);
47
+ }
48
+ });
49
+ }
50
+ }
51
+ catch (error) {
52
+ console.error('[explicit-types] Error in FunctionDeclaration visitor:', error);
53
+ }
54
+ },
55
+ // Arrow functions
56
+ ArrowFunctionExpression(node) {
57
+ try {
58
+ // Check return type
59
+ if (!node.returnType) {
60
+ context.report({
61
+ node: node.params.length > 0 ? node.params[0] : node, // Report on first param or node
62
+ messageId: 'missingArrowReturnType',
63
+ });
64
+ }
65
+ // Check arrow function parameters with defensive checks
66
+ if (node.params && Array.isArray(node.params)) {
67
+ node.params.forEach((param) => {
68
+ try {
69
+ if (param && param.type === 'Identifier' && !param.typeAnnotation) {
70
+ context.report({
71
+ node: param,
72
+ messageId: 'missingParameterType',
73
+ data: { name: param.name || 'unknown' },
74
+ });
75
+ }
76
+ }
77
+ catch (paramError) {
78
+ console.error('[explicit-types] Error processing arrow function parameter:', paramError);
79
+ }
80
+ });
81
+ }
82
+ }
83
+ catch (error) {
84
+ console.error('[explicit-types] Error in ArrowFunctionExpression visitor:', error);
85
+ }
86
+ },
87
+ // Variable declarations
88
+ VariableDeclarator(node) {
89
+ try {
90
+ // Defensive check for node.id
91
+ if (!node.id) {
92
+ return;
93
+ }
94
+ if (!node.id.typeAnnotation) {
95
+ // Check if this variable is declared in a for loop
96
+ let isInForLoop = false;
97
+ let parent = node.parent;
98
+ while (parent) {
99
+ if (parent.type === 'ForStatement' || parent.type === 'ForInStatement' || parent.type === 'ForOfStatement') {
100
+ isInForLoop = true;
101
+ break;
102
+ }
103
+ parent = parent.parent;
104
+ }
105
+ // Skip if variable is in a for loop
106
+ if (isInForLoop) {
107
+ return;
108
+ }
109
+ // Skip if variable is initialized with a typed value that can be inferred
110
+ const hasTypedInitializer = node.init && (node.init.type === 'CallExpression' ||
111
+ node.init.type === 'NewExpression' ||
112
+ node.init.type === 'ArrayExpression' ||
113
+ node.init.type === 'ObjectExpression' ||
114
+ node.init.type === 'Literal');
115
+ if (!hasTypedInitializer) {
116
+ context.report({
117
+ node: node.id,
118
+ messageId: 'missingVariableType',
119
+ data: { name: node.id?.name || 'destructured' },
120
+ });
121
+ }
122
+ }
123
+ }
124
+ catch (error) {
125
+ console.error('[explicit-types] Error in VariableDeclarator visitor:', error);
126
+ }
127
+ },
128
+ // Class properties
129
+ PropertyDefinition(node) {
130
+ try {
131
+ // Defensive check for node.key
132
+ if (!node.key) {
133
+ return;
134
+ }
135
+ if (!node.typeAnnotation && !node.value) {
136
+ context.report({
137
+ node: node.key,
138
+ messageId: 'missingPropertyType',
139
+ data: { name: node.key?.name || 'computed' },
140
+ });
141
+ }
142
+ }
143
+ catch (error) {
144
+ console.error('[explicit-types] Error in PropertyDefinition visitor:', error);
145
+ }
146
+ },
147
+ // Object destructuring
148
+ ObjectPattern(node) {
149
+ try {
150
+ if (!node.typeAnnotation) {
151
+ context.report({
152
+ node,
153
+ messageId: 'missingDestructuringType',
154
+ });
155
+ }
156
+ }
157
+ catch (error) {
158
+ console.error('[explicit-types] Error in ObjectPattern visitor:', error);
159
+ }
160
+ },
161
+ // Array destructuring
162
+ ArrayPattern(node) {
163
+ try {
164
+ if (!node.typeAnnotation) {
165
+ context.report({
166
+ node,
167
+ messageId: 'missingDestructuringType',
168
+ });
169
+ }
170
+ }
171
+ catch (error) {
172
+ console.error('[explicit-types] Error in ArrayPattern visitor:', error);
173
+ }
174
+ },
175
+ };
176
+ },
177
+ };
178
+ exports.default = rule;
179
179
  //# sourceMappingURL=explicit-types.js.map
@@ -1,4 +1,4 @@
1
- import { Rule } from 'eslint';
2
- declare const rule: Rule.RuleModule;
3
- export default rule;
1
+ import { Rule } from 'eslint';
2
+ declare const rule: Rule.RuleModule;
3
+ export default rule;
4
4
  //# sourceMappingURL=import-order.d.ts.map