@futdevpro/dynamo-eslint 1.15.28 → 1.20.2

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 +79 -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 +62 -0
  95. package/src/configs/base.ts +3 -4
  96. package/src/configs/ngx.ts +5 -8
  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,76 +1,76 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /** ApiService class név regex – `_ApiService` vagy `ApiService` végződésű class. */
4
- const API_SERVICE_NAME_REGEX = /\w+(?:_)?ApiService$/;
5
- /**
6
- * No-component-direct-api szabály: `*.component.ts` fájlok nem importálhatnak közvetlenül
7
- * `*ApiService` class-okat vagy `HttpClient`-et. Single Source of Truth elv – data-service
8
- * vagy control-service réteg kötelező.
9
- * CCAP "no-component-direct-api" review ESLint AST-portja.
10
- */
11
- const rule = {
12
- meta: {
13
- type: 'suggestion',
14
- docs: {
15
- description: 'Components must not directly import `*ApiService` or `HttpClient`; '
16
- + 'use data-service / control-service layer (Single Source of Truth).',
17
- recommended: true,
18
- },
19
- schema: [],
20
- messages: {
21
- noApiServiceImport: 'Komponens közvetlenül importál ApiService class-t: `{{names}}`. '
22
- + 'Használj data-service-t vagy control-service-t (Single Source of Truth).',
23
- noHttpClientImport: 'Komponens közvetlenül importálja a `HttpClient`-et. '
24
- + 'Használj api-service / data-service / control-service réteget.',
25
- },
26
- },
27
- create(context) {
28
- const filename = context.filename ?? '';
29
- if (!filename.endsWith('.component.ts')) {
30
- return {};
31
- }
32
- return {
33
- ImportDeclaration(node) {
34
- try {
35
- const source = (node.source && typeof node.source.value === 'string')
36
- ? node.source.value
37
- : '';
38
- const apiServiceNames = [];
39
- let hasHttpClient = false;
40
- for (const specifier of node.specifiers ?? []) {
41
- if (specifier.type !== 'ImportSpecifier') {
42
- continue;
43
- }
44
- const importedName = (specifier.imported && specifier.imported.name)
45
- ? specifier.imported.name
46
- : '';
47
- if (importedName === 'HttpClient' && source === '@angular/common/http') {
48
- hasHttpClient = true;
49
- }
50
- if (API_SERVICE_NAME_REGEX.test(importedName)) {
51
- apiServiceNames.push(importedName);
52
- }
53
- }
54
- if (apiServiceNames.length > 0) {
55
- context.report({
56
- node: node,
57
- messageId: 'noApiServiceImport',
58
- data: { names: apiServiceNames.join(', ') },
59
- });
60
- }
61
- if (hasHttpClient) {
62
- context.report({
63
- node: node,
64
- messageId: 'noHttpClientImport',
65
- });
66
- }
67
- }
68
- catch (error) {
69
- console.error('[no-component-direct-api] Error in ImportDeclaration visitor:', error);
70
- }
71
- },
72
- };
73
- },
74
- };
75
- exports.default = rule;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** ApiService class név regex – `_ApiService` vagy `ApiService` végződésű class. */
4
+ const API_SERVICE_NAME_REGEX = /\w+(?:_)?ApiService$/;
5
+ /**
6
+ * No-component-direct-api szabály: `*.component.ts` fájlok nem importálhatnak közvetlenül
7
+ * `*ApiService` class-okat vagy `HttpClient`-et. Single Source of Truth elv – data-service
8
+ * vagy control-service réteg kötelező.
9
+ * CCAP "no-component-direct-api" review ESLint AST-portja.
10
+ */
11
+ const rule = {
12
+ meta: {
13
+ type: 'suggestion',
14
+ docs: {
15
+ description: 'Components must not directly import `*ApiService` or `HttpClient`; '
16
+ + 'use data-service / control-service layer (Single Source of Truth).',
17
+ recommended: true,
18
+ },
19
+ schema: [],
20
+ messages: {
21
+ noApiServiceImport: 'Komponens közvetlenül importál ApiService class-t: `{{names}}`. '
22
+ + 'Használj data-service-t vagy control-service-t (Single Source of Truth).',
23
+ noHttpClientImport: 'Komponens közvetlenül importálja a `HttpClient`-et. '
24
+ + 'Használj api-service / data-service / control-service réteget.',
25
+ },
26
+ },
27
+ create(context) {
28
+ const filename = context.filename ?? '';
29
+ if (!filename.endsWith('.component.ts')) {
30
+ return {};
31
+ }
32
+ return {
33
+ ImportDeclaration(node) {
34
+ try {
35
+ const source = (node.source && typeof node.source.value === 'string')
36
+ ? node.source.value
37
+ : '';
38
+ const apiServiceNames = [];
39
+ let hasHttpClient = false;
40
+ for (const specifier of node.specifiers ?? []) {
41
+ if (specifier.type !== 'ImportSpecifier') {
42
+ continue;
43
+ }
44
+ const importedName = (specifier.imported && specifier.imported.name)
45
+ ? specifier.imported.name
46
+ : '';
47
+ if (importedName === 'HttpClient' && source === '@angular/common/http') {
48
+ hasHttpClient = true;
49
+ }
50
+ if (API_SERVICE_NAME_REGEX.test(importedName)) {
51
+ apiServiceNames.push(importedName);
52
+ }
53
+ }
54
+ if (apiServiceNames.length > 0) {
55
+ context.report({
56
+ node: node,
57
+ messageId: 'noApiServiceImport',
58
+ data: { names: apiServiceNames.join(', ') },
59
+ });
60
+ }
61
+ if (hasHttpClient) {
62
+ context.report({
63
+ node: node,
64
+ messageId: 'noHttpClientImport',
65
+ });
66
+ }
67
+ }
68
+ catch (error) {
69
+ console.error('[no-component-direct-api] Error in ImportDeclaration visitor:', error);
70
+ }
71
+ },
72
+ };
73
+ },
74
+ };
75
+ exports.default = rule;
76
76
  //# sourceMappingURL=no-component-direct-api.js.map
@@ -1,9 +1,9 @@
1
- import { Rule } from 'eslint';
2
- /**
3
- * No-method-call-in-template szabály: Angular template-ekben tilos metódust hívni
4
- * adat megjelenítéshez. Megengedett: signal `mySignal_$()` és esemény `(click)="handler()"`.
5
- * CCAP "no-method-call-in-template" review ESLint port (template parser source-text scan).
6
- */
7
- declare const rule: Rule.RuleModule;
8
- export default rule;
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-method-call-in-template szabály: Angular template-ekben tilos metódust hívni
4
+ * adat megjelenítéshez. Megengedett: signal `mySignal_$()` és esemény `(click)="handler()"`.
5
+ * CCAP "no-method-call-in-template" review ESLint port (template parser source-text scan).
6
+ */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
9
  //# sourceMappingURL=no-method-call-in-template.d.ts.map
@@ -1,80 +1,80 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * Interpoláció metódushívás regex: `{{ ... method() ... }}`. Signal hívás (`_$()`) kizárva.
5
- * Capture group 1: a hívott metódus neve.
6
- */
7
- const INTERPOLATION_CALL_REGEX = /\{\{[^}]*\b([a-zA-Z_$][a-zA-Z0-9_$]*(?<!_\$))\s*\([^)]*\)[^}]*\}\}/g;
8
- /**
9
- * Property binding metódushívás regex: `[attr]="method()"`. Esemény binding `(event)="..."` kizárva.
10
- */
11
- const PROPERTY_BINDING_CALL_REGEX = /\[[^\]]+\]="[^"]*\b[a-zA-Z_$][a-zA-Z0-9_$]*(?<!_\$)\s*\([^)]*\)[^"]*"/g;
12
- /**
13
- * Angular block (`@if`, `@switch`, `@case`, `@else if`) metódushívás regex.
14
- */
15
- const BLOCK_CALL_REGEX = /@(?:if|switch|case|else if)\s*\([^)]*\b[a-zA-Z_$][a-zA-Z0-9_$]*(?<!_\$)\s*\([^)]*\)/g;
16
- /**
17
- * Adott offset alapján a sor és oszlop kiszámítása az alap szövegből.
18
- */
19
- function computeLoc(text, index) {
20
- const before = text.substring(0, index);
21
- const newlineMatches = before.match(/\n/g);
22
- const line = (newlineMatches ? newlineMatches.length : 0) + 1;
23
- const lastNewline = before.lastIndexOf('\n');
24
- const column = lastNewline === -1 ? index : index - lastNewline - 1;
25
- return { line: line, column: column };
26
- }
27
- /**
28
- * No-method-call-in-template szabály: Angular template-ekben tilos metódust hívni
29
- * adat megjelenítéshez. Megengedett: signal `mySignal_$()` és esemény `(click)="handler()"`.
30
- * CCAP "no-method-call-in-template" review ESLint port (template parser source-text scan).
31
- */
32
- const rule = {
33
- meta: {
34
- type: 'suggestion',
35
- docs: {
36
- description: 'Forbid method calls in Angular templates for data display; '
37
- + 'use signals / computed / pipes instead. Event bindings `(click)="..."` allowed.',
38
- recommended: true,
39
- },
40
- schema: [],
41
- messages: {
42
- interpolationCall: 'Metódushívás interpolációban: `{{ method() }}`. Használj signal-t vagy pipe-ot.',
43
- propertyBindingCall: 'Metódushívás property bindingban. Használj signal-t vagy computed-t.',
44
- blockCall: 'Metódushívás Angular block direktívában (`@if` / `@switch`). Használj signal-t vagy computed-t.',
45
- },
46
- },
47
- create(context) {
48
- const filename = context.filename ?? '';
49
- if (!filename.endsWith('.html')) {
50
- return {};
51
- }
52
- const text = context.sourceCode.text ?? '';
53
- function reportMatches(regex, messageId) {
54
- const localRegex = new RegExp(regex.source, 'g');
55
- let match = localRegex.exec(text);
56
- while (match !== null) {
57
- const loc = computeLoc(text, match.index);
58
- context.report({
59
- loc: { start: loc, end: { line: loc.line, column: loc.column + match[0].length } },
60
- messageId: messageId,
61
- });
62
- match = localRegex.exec(text);
63
- }
64
- }
65
- return {
66
- Program() {
67
- try {
68
- reportMatches(INTERPOLATION_CALL_REGEX, 'interpolationCall');
69
- reportMatches(PROPERTY_BINDING_CALL_REGEX, 'propertyBindingCall');
70
- reportMatches(BLOCK_CALL_REGEX, 'blockCall');
71
- }
72
- catch (error) {
73
- console.error('[no-method-call-in-template] Error in Program visitor:', error);
74
- }
75
- },
76
- };
77
- },
78
- };
79
- exports.default = rule;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Interpoláció metódushívás regex: `{{ ... method() ... }}`. Signal hívás (`_$()`) kizárva.
5
+ * Capture group 1: a hívott metódus neve.
6
+ */
7
+ const INTERPOLATION_CALL_REGEX = /\{\{[^}]*\b([a-zA-Z_$][a-zA-Z0-9_$]*(?<!_\$))\s*\([^)]*\)[^}]*\}\}/g;
8
+ /**
9
+ * Property binding metódushívás regex: `[attr]="method()"`. Esemény binding `(event)="..."` kizárva.
10
+ */
11
+ const PROPERTY_BINDING_CALL_REGEX = /\[[^\]]+\]="[^"]*\b[a-zA-Z_$][a-zA-Z0-9_$]*(?<!_\$)\s*\([^)]*\)[^"]*"/g;
12
+ /**
13
+ * Angular block (`@if`, `@switch`, `@case`, `@else if`) metódushívás regex.
14
+ */
15
+ const BLOCK_CALL_REGEX = /@(?:if|switch|case|else if)\s*\([^)]*\b[a-zA-Z_$][a-zA-Z0-9_$]*(?<!_\$)\s*\([^)]*\)/g;
16
+ /**
17
+ * Adott offset alapján a sor és oszlop kiszámítása az alap szövegből.
18
+ */
19
+ function computeLoc(text, index) {
20
+ const before = text.substring(0, index);
21
+ const newlineMatches = before.match(/\n/g);
22
+ const line = (newlineMatches ? newlineMatches.length : 0) + 1;
23
+ const lastNewline = before.lastIndexOf('\n');
24
+ const column = lastNewline === -1 ? index : index - lastNewline - 1;
25
+ return { line: line, column: column };
26
+ }
27
+ /**
28
+ * No-method-call-in-template szabály: Angular template-ekben tilos metódust hívni
29
+ * adat megjelenítéshez. Megengedett: signal `mySignal_$()` és esemény `(click)="handler()"`.
30
+ * CCAP "no-method-call-in-template" review ESLint port (template parser source-text scan).
31
+ */
32
+ const rule = {
33
+ meta: {
34
+ type: 'suggestion',
35
+ docs: {
36
+ description: 'Forbid method calls in Angular templates for data display; '
37
+ + 'use signals / computed / pipes instead. Event bindings `(click)="..."` allowed.',
38
+ recommended: true,
39
+ },
40
+ schema: [],
41
+ messages: {
42
+ interpolationCall: 'Metódushívás interpolációban: `{{ method() }}`. Használj signal-t vagy pipe-ot.',
43
+ propertyBindingCall: 'Metódushívás property bindingban. Használj signal-t vagy computed-t.',
44
+ blockCall: 'Metódushívás Angular block direktívában (`@if` / `@switch`). Használj signal-t vagy computed-t.',
45
+ },
46
+ },
47
+ create(context) {
48
+ const filename = context.filename ?? '';
49
+ if (!filename.endsWith('.html')) {
50
+ return {};
51
+ }
52
+ const text = context.sourceCode.text ?? '';
53
+ function reportMatches(regex, messageId) {
54
+ const localRegex = new RegExp(regex.source, 'g');
55
+ let match = localRegex.exec(text);
56
+ while (match !== null) {
57
+ const loc = computeLoc(text, match.index);
58
+ context.report({
59
+ loc: { start: loc, end: { line: loc.line, column: loc.column + match[0].length } },
60
+ messageId: messageId,
61
+ });
62
+ match = localRegex.exec(text);
63
+ }
64
+ }
65
+ return {
66
+ Program() {
67
+ try {
68
+ reportMatches(INTERPOLATION_CALL_REGEX, 'interpolationCall');
69
+ reportMatches(PROPERTY_BINDING_CALL_REGEX, 'propertyBindingCall');
70
+ reportMatches(BLOCK_CALL_REGEX, 'blockCall');
71
+ }
72
+ catch (error) {
73
+ console.error('[no-method-call-in-template] Error in Program visitor:', error);
74
+ }
75
+ },
76
+ };
77
+ },
78
+ };
79
+ exports.default = rule;
80
80
  //# sourceMappingURL=no-method-call-in-template.js.map
@@ -1,8 +1,8 @@
1
- import { Rule } from 'eslint';
2
- /**
3
- * No-ngFor-directive szabály: Angular template-ekben `*ngFor` helyett `@for` szintaxist használj.
4
- * CCAP "no-ngfor-directive" review ESLint template-text-scan portja.
5
- */
6
- declare const rule: Rule.RuleModule;
7
- export default rule;
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-ngFor-directive szabály: Angular template-ekben `*ngFor` helyett `@for` szintaxist használj.
4
+ * CCAP "no-ngfor-directive" review ESLint template-text-scan portja.
5
+ */
6
+ declare const rule: Rule.RuleModule;
7
+ export default rule;
8
8
  //# sourceMappingURL=no-ngfor-directive.d.ts.map
@@ -1,60 +1,60 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /** `*ngFor` használat detektálása HTML template-ekben. */
4
- const NGFOR_REGEX = /\*ngFor/g;
5
- /**
6
- * Adott offset alapján a sor és oszlop kiszámítása az alap szövegből.
7
- */
8
- function computeLoc(text, index) {
9
- const before = text.substring(0, index);
10
- const newlineMatches = before.match(/\n/g);
11
- const line = (newlineMatches ? newlineMatches.length : 0) + 1;
12
- const lastNewline = before.lastIndexOf('\n');
13
- const column = lastNewline === -1 ? index : index - lastNewline - 1;
14
- return { line: line, column: column };
15
- }
16
- /**
17
- * No-ngFor-directive szabály: Angular template-ekben `*ngFor` helyett `@for` szintaxist használj.
18
- * CCAP "no-ngfor-directive" review ESLint template-text-scan portja.
19
- */
20
- const rule = {
21
- meta: {
22
- type: 'suggestion',
23
- docs: {
24
- description: 'Forbid `*ngFor` directive in Angular templates; use `@for` block syntax instead.',
25
- recommended: true,
26
- },
27
- schema: [],
28
- messages: {
29
- noNgFor: '`*ngFor` direktíva tilos. Használj `@for` block szintaxist.',
30
- },
31
- },
32
- create(context) {
33
- const filename = context.filename ?? '';
34
- if (!filename.endsWith('.html')) {
35
- return {};
36
- }
37
- const text = context.sourceCode.text ?? '';
38
- return {
39
- Program() {
40
- try {
41
- const localRegex = new RegExp(NGFOR_REGEX.source, 'g');
42
- let match = localRegex.exec(text);
43
- while (match !== null) {
44
- const loc = computeLoc(text, match.index);
45
- context.report({
46
- loc: { start: loc, end: { line: loc.line, column: loc.column + match[0].length } },
47
- messageId: 'noNgFor',
48
- });
49
- match = localRegex.exec(text);
50
- }
51
- }
52
- catch (error) {
53
- console.error('[no-ngfor-directive] Error in Program visitor:', error);
54
- }
55
- },
56
- };
57
- },
58
- };
59
- exports.default = rule;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** `*ngFor` használat detektálása HTML template-ekben. */
4
+ const NGFOR_REGEX = /\*ngFor/g;
5
+ /**
6
+ * Adott offset alapján a sor és oszlop kiszámítása az alap szövegből.
7
+ */
8
+ function computeLoc(text, index) {
9
+ const before = text.substring(0, index);
10
+ const newlineMatches = before.match(/\n/g);
11
+ const line = (newlineMatches ? newlineMatches.length : 0) + 1;
12
+ const lastNewline = before.lastIndexOf('\n');
13
+ const column = lastNewline === -1 ? index : index - lastNewline - 1;
14
+ return { line: line, column: column };
15
+ }
16
+ /**
17
+ * No-ngFor-directive szabály: Angular template-ekben `*ngFor` helyett `@for` szintaxist használj.
18
+ * CCAP "no-ngfor-directive" review ESLint template-text-scan portja.
19
+ */
20
+ const rule = {
21
+ meta: {
22
+ type: 'suggestion',
23
+ docs: {
24
+ description: 'Forbid `*ngFor` directive in Angular templates; use `@for` block syntax instead.',
25
+ recommended: true,
26
+ },
27
+ schema: [],
28
+ messages: {
29
+ noNgFor: '`*ngFor` direktíva tilos. Használj `@for` block szintaxist.',
30
+ },
31
+ },
32
+ create(context) {
33
+ const filename = context.filename ?? '';
34
+ if (!filename.endsWith('.html')) {
35
+ return {};
36
+ }
37
+ const text = context.sourceCode.text ?? '';
38
+ return {
39
+ Program() {
40
+ try {
41
+ const localRegex = new RegExp(NGFOR_REGEX.source, 'g');
42
+ let match = localRegex.exec(text);
43
+ while (match !== null) {
44
+ const loc = computeLoc(text, match.index);
45
+ context.report({
46
+ loc: { start: loc, end: { line: loc.line, column: loc.column + match[0].length } },
47
+ messageId: 'noNgFor',
48
+ });
49
+ match = localRegex.exec(text);
50
+ }
51
+ }
52
+ catch (error) {
53
+ console.error('[no-ngfor-directive] Error in Program visitor:', error);
54
+ }
55
+ },
56
+ };
57
+ },
58
+ };
59
+ exports.default = rule;
60
60
  //# sourceMappingURL=no-ngfor-directive.js.map
@@ -1,8 +1,8 @@
1
- import { Rule } from 'eslint';
2
- /**
3
- * No-ngIf-directive szabály: Angular template-ekben `*ngIf` helyett `@if` szintaxist használj.
4
- * CCAP "no-ngif-directive" review ESLint template-text-scan portja.
5
- */
6
- declare const rule: Rule.RuleModule;
7
- export default rule;
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-ngIf-directive szabály: Angular template-ekben `*ngIf` helyett `@if` szintaxist használj.
4
+ * CCAP "no-ngif-directive" review ESLint template-text-scan portja.
5
+ */
6
+ declare const rule: Rule.RuleModule;
7
+ export default rule;
8
8
  //# sourceMappingURL=no-ngif-directive.d.ts.map
@@ -1,60 +1,60 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /** `*ngIf` használat detektálása HTML template-ekben. */
4
- const NGIF_REGEX = /\*ngIf/g;
5
- /**
6
- * Adott offset alapján a sor és oszlop kiszámítása az alap szövegből.
7
- */
8
- function computeLoc(text, index) {
9
- const before = text.substring(0, index);
10
- const newlineMatches = before.match(/\n/g);
11
- const line = (newlineMatches ? newlineMatches.length : 0) + 1;
12
- const lastNewline = before.lastIndexOf('\n');
13
- const column = lastNewline === -1 ? index : index - lastNewline - 1;
14
- return { line: line, column: column };
15
- }
16
- /**
17
- * No-ngIf-directive szabály: Angular template-ekben `*ngIf` helyett `@if` szintaxist használj.
18
- * CCAP "no-ngif-directive" review ESLint template-text-scan portja.
19
- */
20
- const rule = {
21
- meta: {
22
- type: 'suggestion',
23
- docs: {
24
- description: 'Forbid `*ngIf` directive in Angular templates; use `@if` block syntax instead.',
25
- recommended: true,
26
- },
27
- schema: [],
28
- messages: {
29
- noNgIf: '`*ngIf` direktíva tilos. Használj `@if` block szintaxist.',
30
- },
31
- },
32
- create(context) {
33
- const filename = context.filename ?? '';
34
- if (!filename.endsWith('.html')) {
35
- return {};
36
- }
37
- const text = context.sourceCode.text ?? '';
38
- return {
39
- Program() {
40
- try {
41
- const localRegex = new RegExp(NGIF_REGEX.source, 'g');
42
- let match = localRegex.exec(text);
43
- while (match !== null) {
44
- const loc = computeLoc(text, match.index);
45
- context.report({
46
- loc: { start: loc, end: { line: loc.line, column: loc.column + match[0].length } },
47
- messageId: 'noNgIf',
48
- });
49
- match = localRegex.exec(text);
50
- }
51
- }
52
- catch (error) {
53
- console.error('[no-ngif-directive] Error in Program visitor:', error);
54
- }
55
- },
56
- };
57
- },
58
- };
59
- exports.default = rule;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** `*ngIf` használat detektálása HTML template-ekben. */
4
+ const NGIF_REGEX = /\*ngIf/g;
5
+ /**
6
+ * Adott offset alapján a sor és oszlop kiszámítása az alap szövegből.
7
+ */
8
+ function computeLoc(text, index) {
9
+ const before = text.substring(0, index);
10
+ const newlineMatches = before.match(/\n/g);
11
+ const line = (newlineMatches ? newlineMatches.length : 0) + 1;
12
+ const lastNewline = before.lastIndexOf('\n');
13
+ const column = lastNewline === -1 ? index : index - lastNewline - 1;
14
+ return { line: line, column: column };
15
+ }
16
+ /**
17
+ * No-ngIf-directive szabály: Angular template-ekben `*ngIf` helyett `@if` szintaxist használj.
18
+ * CCAP "no-ngif-directive" review ESLint template-text-scan portja.
19
+ */
20
+ const rule = {
21
+ meta: {
22
+ type: 'suggestion',
23
+ docs: {
24
+ description: 'Forbid `*ngIf` directive in Angular templates; use `@if` block syntax instead.',
25
+ recommended: true,
26
+ },
27
+ schema: [],
28
+ messages: {
29
+ noNgIf: '`*ngIf` direktíva tilos. Használj `@if` block szintaxist.',
30
+ },
31
+ },
32
+ create(context) {
33
+ const filename = context.filename ?? '';
34
+ if (!filename.endsWith('.html')) {
35
+ return {};
36
+ }
37
+ const text = context.sourceCode.text ?? '';
38
+ return {
39
+ Program() {
40
+ try {
41
+ const localRegex = new RegExp(NGIF_REGEX.source, 'g');
42
+ let match = localRegex.exec(text);
43
+ while (match !== null) {
44
+ const loc = computeLoc(text, match.index);
45
+ context.report({
46
+ loc: { start: loc, end: { line: loc.line, column: loc.column + match[0].length } },
47
+ messageId: 'noNgIf',
48
+ });
49
+ match = localRegex.exec(text);
50
+ }
51
+ }
52
+ catch (error) {
53
+ console.error('[no-ngif-directive] Error in Program visitor:', error);
54
+ }
55
+ },
56
+ };
57
+ },
58
+ };
59
+ exports.default = rule;
60
60
  //# sourceMappingURL=no-ngif-directive.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=explicit-types.d.ts.map