@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,73 +0,0 @@
1
- /*
2
- * The published config is intentionally CommonJS and ESLint's config surface is dynamically typed.
3
- * These narrow test-only exceptions keep the compatibility assertions faithful to the consumer API.
4
- */
5
- /* eslint-disable @futdevpro/dynamo/no-dynamic-imports, @typescript-eslint/no-require-imports */
6
- /* eslint-disable @futdevpro/dynamo/no-any-type */
7
- const angularEslint = require('angular-eslint');
8
- const ngxConfig = require('./ngx');
9
-
10
- export {};
11
-
12
- describe('| Angular 20 flat-config compatibility', (): void => {
13
- it('| resolves every configured Angular TypeScript rule from the unified plugin', (): void => {
14
- const typeScriptConfig: any = ngxConfig.find(
15
- (config: any): boolean => !!config.plugins?.['@angular-eslint'],
16
- );
17
-
18
- expect(typeScriptConfig).toBeDefined();
19
- expect(typeScriptConfig.rules['@angular-eslint/no-host-metadata-property']).toBeUndefined();
20
-
21
- Object.keys(typeScriptConfig.rules)
22
- .filter((ruleName: string): boolean => ruleName.startsWith('@angular-eslint/'))
23
- .forEach((ruleName: string): void => {
24
- const pluginRuleName: string = ruleName.replace('@angular-eslint/', '');
25
-
26
- expect(angularEslint.tsPlugin.rules[pluginRuleName])
27
- .withContext(`Missing Angular 20 TypeScript rule: ${ruleName}`)
28
- .toBeDefined();
29
- });
30
- });
31
-
32
- it('| resolves every configured Angular template rule from the unified plugin', (): void => {
33
- const templateConfig: any = ngxConfig.find(
34
- (config: any): boolean => !!config.plugins?.['@angular-eslint/template'],
35
- );
36
-
37
- expect(templateConfig).toBeDefined();
38
-
39
- Object.keys(templateConfig.rules)
40
- .filter((ruleName: string): boolean => ruleName.startsWith('@angular-eslint/template/'))
41
- .forEach((ruleName: string): void => {
42
- const pluginRuleName: string = ruleName.replace('@angular-eslint/template/', '');
43
-
44
- expect(angularEslint.templatePlugin.rules[pluginRuleName])
45
- .withContext(`Missing Angular 20 template rule: ${ruleName}`)
46
- .toBeDefined();
47
- });
48
- });
49
-
50
- it('| exposes the unified Angular parser and plugin objects in the preset', (): void => {
51
- const typeScriptConfig: any = ngxConfig.find(
52
- (config: any): boolean => !!config.plugins?.['@angular-eslint'],
53
- );
54
- const templateConfig: any = ngxConfig.find(
55
- (config: any): boolean => !!config.plugins?.['@angular-eslint/template'],
56
- );
57
-
58
- expect(typeScriptConfig.plugins['@angular-eslint']).toBe(angularEslint.tsPlugin);
59
- expect(templateConfig.plugins['@angular-eslint/template']).toBe(angularEslint.templatePlugin);
60
- expect(templateConfig.languageOptions.parser).toBe(angularEslint.templateParser);
61
- });
62
-
63
- it('| pins the Angular 20 template-complexity policy instead of inheriting its default', (): void => {
64
- const templateConfig: any = ngxConfig.find(
65
- (config: any): boolean => !!config.plugins?.['@angular-eslint/template'],
66
- );
67
-
68
- expect(templateConfig.rules['@angular-eslint/template/cyclomatic-complexity'])
69
- .toEqual([ 'warn', { maxComplexity: 20 }]);
70
- expect(templateConfig.rules['@angular-eslint/template/use-track-by-function']).toBe('warn');
71
- expect(templateConfig.rules['@angular-eslint/template/no-duplicate-attributes']).toBe('error');
72
- });
73
- });
@@ -1,156 +0,0 @@
1
-
2
- /**
3
- * Base Rulesets For Dynamo Based Systems
4
- * ESLint v9 Flat Config Format
5
- */
6
- const tsEslint = require('typescript-eslint');
7
- const unusedImportsPlugin = require('eslint-plugin-unused-imports');
8
- const maxParamsNoConstructorPlugin = require('eslint-plugin-max-params-no-constructor');
9
- const dynamoPlugin = require('../plugin');
10
-
11
- module.exports = [
12
- {
13
- ignores: [
14
- 'node_modules/**',
15
- 'dist/**',
16
- 'build/**',
17
- '*.d.ts',
18
- ],
19
- },
20
- {
21
- files: [ '**/*.ts', '**/*.tsx' ],
22
- languageOptions: {
23
- parser: tsEslint.parser,
24
- parserOptions: {
25
- ecmaVersion: 'latest',
26
- sourceType: 'module',
27
- projectService: true,
28
- tsconfigRootDir: process.cwd(),
29
- },
30
- globals: {
31
- // Browser globals
32
- window: 'readonly',
33
- document: 'readonly',
34
- console: 'readonly',
35
- process: 'readonly',
36
- Buffer: 'readonly',
37
- global: 'readonly',
38
- __dirname: 'readonly',
39
- __filename: 'readonly',
40
- module: 'readonly',
41
- require: 'readonly',
42
- exports: 'readonly',
43
- },
44
- },
45
- plugins: {
46
- '@typescript-eslint': tsEslint.plugin,
47
- 'unused-imports': unusedImportsPlugin,
48
- 'max-params-no-constructor': maxParamsNoConstructorPlugin,
49
- '@futdevpro/dynamo': dynamoPlugin,
50
- },
51
- rules: {
52
- // ESLint recommended rules
53
- 'no-warning-comments': [ 'warn', { terms: [ 'todo', 'fixme', 'removable', '??' ], location: 'anywhere' }],
54
- 'indent': [ 'warn', 2, { SwitchCase: 1 }],
55
- 'max-len': [ 'warn', { code: 120, comments: 120 }],
56
- 'max-lines': [ 'warn', 1000 ],
57
- 'linebreak-style': 'off',
58
- 'semi': [ 'warn', 'always' ],
59
- 'no-unused-vars': 'off',
60
- 'no-prototype-builtins': 'off',
61
- 'no-empty': 'warn',
62
- 'comma-dangle': [
63
- 'warn',
64
- {
65
- arrays: 'always-multiline',
66
- objects: 'always-multiline',
67
- functions: 'only-multiline',
68
- imports: 'never',
69
- exports: 'never',
70
- },
71
- ],
72
- 'brace-style': [ 'warn', '1tbs', { allowSingleLine: false }],
73
- 'curly': [ 'warn', 'all' ],
74
- 'object-curly-spacing': [ 'warn', 'always' ],
75
- 'array-bracket-spacing': [ 'warn', 'always', { objectsInArrays: false, arraysInArrays: false }],
76
- 'padding-line-between-statements': [
77
- 'warn',
78
- { blankLine: 'always', prev: '*', next: [ 'return','throw','if','for','while','switch','default' ] },
79
- { blankLine: 'always', prev: [ 'const','let','var','break' ], next: '*' },
80
- { blankLine: 'any', prev: [ 'const','let','var' ], next: [ 'const','let','var' ] },
81
- { blankLine: 'any', prev: '*', next: 'import' },
82
- { blankLine: 'any', prev: 'import', next: '*' },
83
- ],
84
- 'prefer-const': 'warn',
85
- 'no-case-declarations': 'off',
86
- 'no-fallthrough': 'off',
87
- 'keyword-spacing': 'warn',
88
- 'no-else-return': 'warn',
89
- 'no-duplicate-imports': 'warn',
90
- // CCAP method-input-count: 3+ paraméter helyett egyetlen object input kötelező
91
- 'max-params': [ 'warn', 3 ],
92
- 'max-params-no-constructor/max-params-no-constructor': [ 'warn', 5 ],
93
- 'quotes': [ 'warn', 'single', { allowTemplateLiterals: true }],
94
- // CCAP no-object-shorthand: tilos a `{ foo }` shorthand, mindig `{ foo: foo }`
95
- 'object-shorthand': [ 'warn', 'never' ],
96
- // CCAP no-bracket-property-access: dot-notation előnyben (ahol lehetséges).
97
- // A STOCK `dot-notation`-t KIKAPCSOLJUK és a type-aware
98
- // `@typescript-eslint/dot-notation`-t hasznaljuk helyette: a stock variant
99
- // a `service['protectedMember']` bracket-access-t is `service.protectedMember`-re
100
- // javitana (--fix), ami a class-hierarchian KIVULROL (pl. spec fajlbol) elert
101
- // protected/private tagnal TS2445 fordito-hibat okoz. A bracket-forma ott a
102
- // kanonikus TS escape-hatch. A type-aware variant a checker-bol latja a
103
- // modositokat, ezert NEM nyul a protected/private/index-signature elerese-hez.
104
- 'dot-notation': 'off',
105
- '@typescript-eslint/dot-notation': [
106
- 'warn',
107
- {
108
- allowProtectedClassPropertyAccess: true,
109
- allowPrivateClassPropertyAccess: true,
110
- allowIndexSignaturePropertyAccess: true,
111
- },
112
- ],
113
-
114
- // TypeScript rules
115
- '@typescript-eslint/no-unused-vars': 'warn',
116
- '@typescript-eslint/explicit-function-return-type': [ 'warn', { allowTypedFunctionExpressions: false }],
117
- '@typescript-eslint/no-explicit-any': 'warn',
118
- '@typescript-eslint/typedef': [
119
- 'warn',
120
- {
121
- parameter: true, // Enforce parameter type annotations
122
- },
123
- ],
124
- '@typescript-eslint/no-unnecessary-type-assertion': 'warn',
125
- // CCAP no-array-generic: `Array<T>` helyett `T[]`
126
- '@typescript-eslint/array-type': [ 'warn', { default: 'array' }],
127
- // CCAP prefer-optional-chaining: `a && a.b` helyett `a?.b`
128
- '@typescript-eslint/prefer-optional-chain': 'warn',
129
- // CCAP no-dynamic-imports (CommonJS variant): `require()` helyett ES import
130
- '@typescript-eslint/no-require-imports': 'warn',
131
-
132
- // Dynamo custom rules
133
- '@futdevpro/dynamo/explicit-types': 'warn',
134
- '@futdevpro/dynamo/import-order': 'warn',
135
- '@futdevpro/dynamo/naming-patterns': 'warn',
136
- '@futdevpro/dynamo/no-import-type': 'warn',
137
- '@futdevpro/dynamo/no-js-import': 'warn',
138
- '@futdevpro/dynamo/prefer-interface-over-duplicate-types': [ 'warn', { threshold: 3 }],
139
- '@futdevpro/dynamo/require-jsdoc-description': [ 'warn', { scope: 'public' }],
140
- '@futdevpro/dynamo/prefer-enum-over-string-union': [ 'warn', { minValues: 3 }],
141
- '@futdevpro/dynamo/require-test-description-prefix': [ 'warn', { prefix: '| ' }],
142
- '@futdevpro/dynamo/no-getter-logic': 'warn',
143
-
144
- // CCAP-portolt TypeScript review-k (AST-alapú).
145
- '@futdevpro/dynamo/no-as-cast': 'warn',
146
- '@futdevpro/dynamo/no-any-type': 'warn',
147
- '@futdevpro/dynamo/no-dynamic-imports': 'warn',
148
- '@futdevpro/dynamo/one-export-per-file': 'warn',
149
- '@futdevpro/dynamo/no-plain-function-export': 'warn',
150
- '@futdevpro/dynamo/data-model-extends': 'warn',
151
- '@futdevpro/dynamo/no-native-browser-dialogs': 'warn',
152
- },
153
- },
154
- ];
155
-
156
-
@@ -1,10 +0,0 @@
1
- const fsmBaseConfig = require('./base');
2
-
3
- /**
4
- * Rulesets For Dynamo Based Systems
5
- * FSM: Full Stack Module
6
- * ESLint v9 Flat Config Format
7
- */
8
- module.exports = fsmBaseConfig;
9
-
10
-
@@ -1,10 +0,0 @@
1
- const ngxConfig = require('./ngx');
2
-
3
- /**
4
- * Rulesets For Dynamo Based Systems
5
- * NGX-PACKAGE: Angular Package
6
- * ESLint v9 Flat Config Format
7
- */
8
- module.exports = ngxConfig;
9
-
10
-
@@ -1,93 +0,0 @@
1
- const ngxBaseConfig = require('./base');
2
- const angularEslint = require('angular-eslint');
3
-
4
- /**
5
- * Rulesets For Dynamo Based Systems
6
- * NGX: Angular Projects
7
- * ESLint v9 Flat Config Format
8
- */
9
- module.exports = [
10
- ...ngxBaseConfig,
11
- {
12
- files: ['**/*.ts', '**/*.tsx'],
13
- languageOptions: {
14
- ...ngxBaseConfig[1].languageOptions,
15
- globals: {
16
- // Angular globals
17
- window: 'readonly',
18
- document: 'readonly',
19
- console: 'readonly',
20
- process: 'readonly',
21
- Buffer: 'readonly',
22
- global: 'readonly',
23
- __dirname: 'readonly',
24
- __filename: 'readonly',
25
- module: 'readonly',
26
- require: 'readonly',
27
- exports: 'readonly'
28
- }
29
- },
30
- plugins: {
31
- ...ngxBaseConfig[1].plugins,
32
- '@angular-eslint': angularEslint.tsPlugin,
33
- },
34
- rules: {
35
- ...ngxBaseConfig[1].rules,
36
- // Angular-specific rules
37
- '@angular-eslint/directive-selector': 'error',
38
- '@angular-eslint/component-selector': 'error',
39
- '@angular-eslint/no-conflicting-lifecycle': 'error',
40
- '@angular-eslint/no-input-rename': 'error',
41
- '@angular-eslint/no-output-rename': 'error',
42
- '@angular-eslint/no-outputs-metadata-property': 'error',
43
- '@angular-eslint/use-lifecycle-interface': 'error',
44
- '@angular-eslint/use-pipe-transform-interface': 'error',
45
-
46
- // CCAP-portolt Angular TypeScript review-k.
47
- '@futdevpro/dynamo/no-async-ngoninit': 'warn',
48
- '@futdevpro/dynamo/no-component-direct-api': 'warn',
49
- '@futdevpro/dynamo/effect-signal-loop': 'warn',
50
- },
51
- },
52
- {
53
- files: ['**/*.html'],
54
- languageOptions: {
55
- parser: angularEslint.templateParser,
56
- parserOptions: {
57
- ecmaVersion: 'latest',
58
- sourceType: 'module',
59
- },
60
- },
61
- plugins: {
62
- ...ngxBaseConfig[1].plugins,
63
- '@angular-eslint/template': angularEslint.templatePlugin,
64
- },
65
- rules: {
66
- '@angular-eslint/template/banana-in-box': 'error',
67
- '@angular-eslint/template/cyclomatic-complexity': [ 'warn', { maxComplexity: 20 }],
68
- '@angular-eslint/template/eqeqeq': 'error',
69
- // Signal-first kódban (Angular 17+) a `params.data_$()`, `model_$()` stb.
70
- // szignal-getter hivasok DESIGN-ALTAL kerulnek a templatebe — olcso, ket
71
- // resugarzo, change-detection-friendly. Az eredeti `'error'` szint még a
72
- // zone.js-CD korszakra szabva volt; a deprecation altalanos.
73
- // 2026-06-05: warn-ra allitva, hogy a Signal-first komponensek (button-new,
74
- // form-new, field-new, ...) build-jet ne tortje, viszont legacy
75
- // zone.js-alapú expensive-call patternek meg felgyulladjanak.
76
- // 2026-06-23: a signal-getterek (`_$`-suffix) NARROW exemptet kapnak (allowSuffix),
77
- // mert a `()` invocation Angular 18 signal-ben a KANONIKUS read-pattern, nem anti-pattern;
78
- // a valodi (nem-signal) metodus-hivasok templateben tovabbra is warn-olnak.
79
- '@angular-eslint/template/no-call-expression': [ 'warn', { allowSuffix: '_$' }],
80
- '@angular-eslint/template/no-duplicate-attributes': 'error',
81
- '@angular-eslint/template/no-negated-async': 'error',
82
- '@angular-eslint/template/use-track-by-function': 'warn',
83
-
84
- // CCAP-portolt Angular template review-k (regex-alapú text scan).
85
- '@futdevpro/dynamo/no-method-call-in-template': 'warn',
86
- '@futdevpro/dynamo/angular-for-track-logic': 'warn',
87
- '@futdevpro/dynamo/no-ngif-directive': 'warn',
88
- '@futdevpro/dynamo/no-ngfor-directive': 'warn',
89
- },
90
- },
91
- ];
92
-
93
-
@@ -1,20 +0,0 @@
1
- const ntsConfig = require('./nts');
2
-
3
- /**
4
- * Rulesets For Dynamo Based Systems
5
- * NTS-PACKAGE: Node TypeScript Package
6
- * ESLint v9 Flat Config Format
7
- */
8
- module.exports = [
9
- ...ntsConfig,
10
- {
11
- files: ['**/*.ts', '**/*.tsx'],
12
- rules: {
13
- ...ntsConfig[1].rules,
14
- '@typescript-eslint/ban-types': 'off',
15
- '@typescript-eslint/no-explicit-any': 'off',
16
- },
17
- },
18
- ];
19
-
20
-
@@ -1,34 +0,0 @@
1
- const ntsBaseConfig = require('./base');
2
-
3
- /**
4
- * Rulesets For Dynamo Based Systems
5
- * NTS: Node TypeScript
6
- * ESLint v9 Flat Config Format
7
- */
8
- module.exports = [
9
- ...ntsBaseConfig,
10
- {
11
- files: ['**/*.ts', '**/*.tsx'],
12
- languageOptions: {
13
- ...ntsBaseConfig[1].languageOptions,
14
- globals: {
15
- // Node.js globals
16
- process: 'readonly',
17
- Buffer: 'readonly',
18
- global: 'readonly',
19
- __dirname: 'readonly',
20
- __filename: 'readonly',
21
- module: 'readonly',
22
- require: 'readonly',
23
- exports: 'readonly',
24
- console: 'readonly'
25
- }
26
- },
27
- rules: {
28
- ...ntsBaseConfig[1].rules,
29
- 'max-lines': ['warn', 1500],
30
- },
31
- },
32
- ];
33
-
34
-
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- // Entry point kept minimal; configs are exported via subpath exports in package.json
2
- export {};
3
-
4
-
@@ -1,86 +0,0 @@
1
- import explicitTypesRule from './rules/explicit-types';
2
- import importOrderRule from './rules/import/import-order';
3
- import namingPatternsRule from './rules/naming-patterns';
4
- import noImportTypeRule from './rules/import/no-import-type';
5
- import noJsExtensionRule from './rules/import/no-js-import';
6
- import preferInterfaceRule from './rules/prefer-interface-over-duplicate-types';
7
- import requireJSDocRule from './rules/require-jsdoc-description';
8
- import preferEnumRule from './rules/prefer-enum-over-string-union';
9
- import requireTestPrefixRule from './rules/require-test-description-prefix';
10
- import noGetterLogicRule from './rules/no-getter-logic';
11
-
12
- import noAsCastRule from './rules/ts/no-as-cast';
13
- import noAnyTypeRule from './rules/ts/no-any-type';
14
- import noDynamicImportsRule from './rules/ts/no-dynamic-imports';
15
- import oneExportPerFileRule from './rules/ts/one-export-per-file';
16
- import noPlainFunctionExportRule from './rules/ts/no-plain-function-export';
17
- import dataModelExtendsRule from './rules/ts/data-model-extends';
18
- import noNativeBrowserDialogsRule from './rules/ts/no-native-browser-dialogs';
19
-
20
- import noAsyncNgOnInitRule from './rules/angular/no-async-ngoninit';
21
- import noComponentDirectApiRule from './rules/angular/no-component-direct-api';
22
- import effectSignalLoopRule from './rules/angular/effect-signal-loop';
23
- import noMethodCallInTemplateRule from './rules/angular/no-method-call-in-template';
24
- import angularForTrackLogicRule from './rules/angular/angular-for-track-logic';
25
- import noNgIfDirectiveRule from './rules/angular/no-ngif-directive';
26
- import noNgForDirectiveRule from './rules/angular/no-ngfor-directive';
27
-
28
- export = {
29
- rules: {
30
- 'explicit-types': explicitTypesRule,
31
- 'import-order': importOrderRule,
32
- 'no-import-type': noImportTypeRule,
33
- 'no-js-import': noJsExtensionRule,
34
- 'prefer-interface-over-duplicate-types': preferInterfaceRule,
35
- 'require-jsdoc-description': requireJSDocRule,
36
- 'prefer-enum-over-string-union': preferEnumRule,
37
- 'require-test-description-prefix': requireTestPrefixRule,
38
- 'no-getter-logic': noGetterLogicRule,
39
-
40
- 'naming-patterns': namingPatternsRule,
41
-
42
- // CCAP-portolt TypeScript review-k (AST-alapú).
43
- 'no-as-cast': noAsCastRule,
44
- 'no-any-type': noAnyTypeRule,
45
- 'no-dynamic-imports': noDynamicImportsRule,
46
- 'one-export-per-file': oneExportPerFileRule,
47
- 'no-plain-function-export': noPlainFunctionExportRule,
48
- 'data-model-extends': dataModelExtendsRule,
49
- 'no-native-browser-dialogs': noNativeBrowserDialogsRule,
50
-
51
- // CCAP-portolt Angular review-k (TS + template-szöveg AST-alapú).
52
- 'no-async-ngoninit': noAsyncNgOnInitRule,
53
- 'no-component-direct-api': noComponentDirectApiRule,
54
- 'effect-signal-loop': effectSignalLoopRule,
55
- 'no-method-call-in-template': noMethodCallInTemplateRule,
56
- 'angular-for-track-logic': angularForTrackLogicRule,
57
- 'no-ngif-directive': noNgIfDirectiveRule,
58
- 'no-ngfor-directive': noNgForDirectiveRule,
59
- },
60
- configs: {
61
- recommended: {
62
- rules: {
63
- '@futdevpro/dynamo/explicit-types': 'warn',
64
- '@futdevpro/dynamo/import-order': 'warn',
65
- '@futdevpro/dynamo/no-import-type': 'warn',
66
- '@futdevpro/dynamo/no-js-import': 'warn',
67
- '@futdevpro/dynamo/prefer-interface-over-duplicate-types': 'warn',
68
- '@futdevpro/dynamo/require-jsdoc-description': 'warn',
69
- '@futdevpro/dynamo/prefer-enum-over-string-union': 'warn',
70
- '@futdevpro/dynamo/require-test-description-prefix': 'warn',
71
- '@futdevpro/dynamo/no-getter-logic': 'warn',
72
-
73
- '@futdevpro/dynamo/naming-patterns': 'warn',
74
-
75
- // CCAP-portolt TypeScript review-k (AST-alapú).
76
- '@futdevpro/dynamo/no-as-cast': 'warn',
77
- '@futdevpro/dynamo/no-any-type': 'warn',
78
- '@futdevpro/dynamo/no-dynamic-imports': 'warn',
79
- '@futdevpro/dynamo/one-export-per-file': 'warn',
80
- '@futdevpro/dynamo/no-plain-function-export': 'warn',
81
- '@futdevpro/dynamo/data-model-extends': 'warn',
82
- '@futdevpro/dynamo/no-native-browser-dialogs': 'warn',
83
- },
84
- },
85
- },
86
- };
@@ -1,44 +0,0 @@
1
- import angularForTrackLogicRule from './angular-for-track-logic';
2
-
3
- describe('| angular-for-track-logic', () => {
4
- it('| should be a valid ESLint rule', () => {
5
- expect(angularForTrackLogicRule.meta?.type).toBe('problem');
6
- expect(angularForTrackLogicRule.meta?.messages?.trackLogic).toBeDefined();
7
- });
8
-
9
- it('| should skip non-html files', () => {
10
- const mockContext: any = { filename: '/x/foo.ts', report: () => {}, options: [], sourceCode: { text: '' } };
11
- const result: any = angularForTrackLogicRule.create(mockContext);
12
- expect(result.Program).toBeUndefined();
13
- });
14
-
15
- it('| should NOT report `track item.id` (simple property access)', () => {
16
- let reportCount: number = 0;
17
- const mockContext: any = {
18
- filename: '/x/list.component.html',
19
- report: (): void => { reportCount += 1; },
20
- options: [],
21
- sourceCode: { text: '@for (item of items; track item.id) { <div>X</div> }' },
22
- };
23
- const rule: any = angularForTrackLogicRule.create(mockContext);
24
- rule.Program();
25
- expect(reportCount).toBe(0);
26
- });
27
-
28
- it('| should report `track method(item)` (logic in track)', () => {
29
- let reportCount: number = 0;
30
- const mockContext: any = {
31
- filename: '/x/list.component.html',
32
- report: (options: any): void => {
33
- if (options.messageId === 'trackLogic') {
34
- reportCount += 1;
35
- }
36
- },
37
- options: [],
38
- sourceCode: { text: '@for (item of items; track trackFn(item)) { <div>X</div> }' },
39
- };
40
- const rule: any = angularForTrackLogicRule.create(mockContext);
41
- rule.Program();
42
- expect(reportCount).toBeGreaterThan(0);
43
- });
44
- });
@@ -1,88 +0,0 @@
1
- import { Rule } from 'eslint';
2
-
3
- /**
4
- * `@for (...; track <expr>)` kifejezés keresése — capture group 1: a track expression.
5
- */
6
- const FOR_TRACK_REGEX: RegExp = /@for\s*\([^)]*;\s*track\s+([^;)]+)/g;
7
-
8
- /**
9
- * Logika detektáló minták a track kifejezésben.
10
- * Tiltott: `??`, `||`, `&&`, `()`, `+-*\/`, ternary `?`.
11
- * Megengedett: egyszerű property access (`item.id`).
12
- */
13
- const TRACK_LOGIC_PATTERNS: RegExp[] = [
14
- /\?\?/,
15
- /\|\|/,
16
- /&&/,
17
- /\(/,
18
- /\)/,
19
- /[+\-*/%]/,
20
- /\?\s*[^:]/,
21
- ];
22
-
23
- /**
24
- * Adott offset alapján a sor és oszlop kiszámítása az alap szövegből.
25
- */
26
- function computeLoc(text: string, index: number): { line: number; column: number } {
27
- const before: string = text.substring(0, index);
28
- const newlineMatches: RegExpMatchArray | null = before.match(/\n/g);
29
- const line: number = (newlineMatches ? newlineMatches.length : 0) + 1;
30
- const lastNewline: number = before.lastIndexOf('\n');
31
- const column: number = lastNewline === -1 ? index : index - lastNewline - 1;
32
- return { line: line, column: column };
33
- }
34
-
35
- /**
36
- * Angular-for-track-logic szabály: tilos logika `@for (...; track <expr>)` kifejezésben.
37
- * CCAP "angular-for-track-logic" review ESLint template-text-scan portja.
38
- */
39
- const rule: Rule.RuleModule = {
40
- meta: {
41
- type: 'problem',
42
- docs: {
43
- description:
44
- 'Forbid logic in Angular `@for (...; track <expr>)`; '
45
- + 'only direct property access (`item.id`) allowed.',
46
- recommended: true,
47
- },
48
- schema: [],
49
- messages: {
50
- trackLogic: 'Logika a `@for track` kifejezésben: `track {{expr}}`.',
51
- },
52
- },
53
- create(context: Rule.RuleContext): Rule.RuleListener {
54
- const filename: string = context.filename ?? '';
55
- if (!filename.endsWith('.html')) {
56
- return {};
57
- }
58
- const text: string = context.sourceCode.text ?? '';
59
-
60
- return {
61
- Program(): void {
62
- try {
63
- const localRegex: RegExp = new RegExp(FOR_TRACK_REGEX.source, 'g');
64
- let match: RegExpExecArray | null = localRegex.exec(text);
65
- while (match !== null) {
66
- const expr: string = match[1].trim();
67
- const hasLogic: boolean = TRACK_LOGIC_PATTERNS.some(
68
- (p: RegExp): boolean => p.test(expr),
69
- );
70
- if (hasLogic) {
71
- const loc: { line: number; column: number } = computeLoc(text, match.index);
72
- context.report({
73
- loc: { start: loc, end: { line: loc.line, column: loc.column + match[0].length } },
74
- messageId: 'trackLogic',
75
- data: { expr: expr },
76
- });
77
- }
78
- match = localRegex.exec(text);
79
- }
80
- } catch (error) {
81
- console.error('[angular-for-track-logic] Error in Program visitor:', error);
82
- }
83
- },
84
- };
85
- },
86
- };
87
-
88
- export default rule;