@futdevpro/dynamo-eslint 1.15.6 → 1.15.8

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 (119) hide show
  1. package/.cursor/rules/_ag_frontend-structure.mdc +5 -5
  2. package/.dynamo/version-bump.config.json +5 -0
  3. package/.github/workflows/main.yml +424 -395
  4. package/.husky/pre-commit +1 -0
  5. package/__documentations/2026-04-18-ccap-review-integration.md +173 -0
  6. package/build/configs/base.js +20 -1
  7. package/build/configs/base.js.map +1 -1
  8. package/build/configs/ngx.js +10 -0
  9. package/build/configs/ngx.js.map +1 -1
  10. package/build/plugin/index.d.ts +21 -0
  11. package/build/plugin/index.d.ts.map +1 -1
  12. package/build/plugin/index.js +38 -0
  13. package/build/plugin/index.js.map +1 -1
  14. package/build/plugin/rules/angular/angular-for-track-logic.d.ts +8 -0
  15. package/build/plugin/rules/angular/angular-for-track-logic.d.ts.map +1 -0
  16. package/build/plugin/rules/angular/angular-for-track-logic.js +82 -0
  17. package/build/plugin/rules/angular/angular-for-track-logic.js.map +1 -0
  18. package/build/plugin/rules/angular/effect-signal-loop.d.ts +10 -0
  19. package/build/plugin/rules/angular/effect-signal-loop.d.ts.map +1 -0
  20. package/build/plugin/rules/angular/effect-signal-loop.js +113 -0
  21. package/build/plugin/rules/angular/effect-signal-loop.js.map +1 -0
  22. package/build/plugin/rules/angular/no-async-ngoninit.d.ts +9 -0
  23. package/build/plugin/rules/angular/no-async-ngoninit.d.ts.map +1 -0
  24. package/build/plugin/rules/angular/no-async-ngoninit.js +43 -0
  25. package/build/plugin/rules/angular/no-async-ngoninit.js.map +1 -0
  26. package/build/plugin/rules/angular/no-component-direct-api.d.ts +10 -0
  27. package/build/plugin/rules/angular/no-component-direct-api.d.ts.map +1 -0
  28. package/build/plugin/rules/angular/no-component-direct-api.js +76 -0
  29. package/build/plugin/rules/angular/no-component-direct-api.js.map +1 -0
  30. package/build/plugin/rules/angular/no-method-call-in-template.d.ts +9 -0
  31. package/build/plugin/rules/angular/no-method-call-in-template.d.ts.map +1 -0
  32. package/build/plugin/rules/angular/no-method-call-in-template.js +80 -0
  33. package/build/plugin/rules/angular/no-method-call-in-template.js.map +1 -0
  34. package/build/plugin/rules/angular/no-ngfor-directive.d.ts +8 -0
  35. package/build/plugin/rules/angular/no-ngfor-directive.d.ts.map +1 -0
  36. package/build/plugin/rules/angular/no-ngfor-directive.js +60 -0
  37. package/build/plugin/rules/angular/no-ngfor-directive.js.map +1 -0
  38. package/build/plugin/rules/angular/no-ngif-directive.d.ts +8 -0
  39. package/build/plugin/rules/angular/no-ngif-directive.d.ts.map +1 -0
  40. package/build/plugin/rules/angular/no-ngif-directive.js +60 -0
  41. package/build/plugin/rules/angular/no-ngif-directive.js.map +1 -0
  42. package/build/plugin/rules/naming-patterns.d.ts +4 -0
  43. package/build/plugin/rules/naming-patterns.d.ts.map +1 -1
  44. package/build/plugin/rules/naming-patterns.js +331 -8
  45. package/build/plugin/rules/naming-patterns.js.map +1 -1
  46. package/build/plugin/rules/no-getter-logic.d.ts.map +1 -1
  47. package/build/plugin/rules/no-getter-logic.js +21 -2
  48. package/build/plugin/rules/no-getter-logic.js.map +1 -1
  49. package/build/plugin/rules/require-jsdoc-description.d.ts.map +1 -1
  50. package/build/plugin/rules/require-jsdoc-description.js +17 -0
  51. package/build/plugin/rules/require-jsdoc-description.js.map +1 -1
  52. package/build/plugin/rules/ts/data-model-extends.d.ts +9 -0
  53. package/build/plugin/rules/ts/data-model-extends.d.ts.map +1 -0
  54. package/build/plugin/rules/ts/data-model-extends.js +95 -0
  55. package/build/plugin/rules/ts/data-model-extends.js.map +1 -0
  56. package/build/plugin/rules/ts/no-any-type.d.ts +9 -0
  57. package/build/plugin/rules/ts/no-any-type.d.ts.map +1 -0
  58. package/build/plugin/rules/ts/no-any-type.js +37 -0
  59. package/build/plugin/rules/ts/no-any-type.js.map +1 -0
  60. package/build/plugin/rules/ts/no-as-cast.d.ts +9 -0
  61. package/build/plugin/rules/ts/no-as-cast.d.ts.map +1 -0
  62. package/build/plugin/rules/ts/no-as-cast.js +50 -0
  63. package/build/plugin/rules/ts/no-as-cast.js.map +1 -0
  64. package/build/plugin/rules/ts/no-dynamic-imports.d.ts +9 -0
  65. package/build/plugin/rules/ts/no-dynamic-imports.d.ts.map +1 -0
  66. package/build/plugin/rules/ts/no-dynamic-imports.js +51 -0
  67. package/build/plugin/rules/ts/no-dynamic-imports.js.map +1 -0
  68. package/build/plugin/rules/ts/no-native-browser-dialogs.d.ts +9 -0
  69. package/build/plugin/rules/ts/no-native-browser-dialogs.d.ts.map +1 -0
  70. package/build/plugin/rules/ts/no-native-browser-dialogs.js +79 -0
  71. package/build/plugin/rules/ts/no-native-browser-dialogs.js.map +1 -0
  72. package/build/plugin/rules/ts/no-plain-function-export.d.ts +10 -0
  73. package/build/plugin/rules/ts/no-plain-function-export.d.ts.map +1 -0
  74. package/build/plugin/rules/ts/no-plain-function-export.js +70 -0
  75. package/build/plugin/rules/ts/no-plain-function-export.js.map +1 -0
  76. package/build/plugin/rules/ts/one-export-per-file.d.ts +9 -0
  77. package/build/plugin/rules/ts/one-export-per-file.d.ts.map +1 -0
  78. package/build/plugin/rules/ts/one-export-per-file.js +74 -0
  79. package/build/plugin/rules/ts/one-export-per-file.js.map +1 -0
  80. package/package.json +6 -9
  81. package/pipeline.cicd.config.json +152 -0
  82. package/src/configs/base.ts +21 -1
  83. package/src/configs/ngx.ts +12 -0
  84. package/src/plugin/index.ts +44 -3
  85. package/src/plugin/rules/angular/angular-for-track-logic.spec.ts +44 -0
  86. package/src/plugin/rules/angular/angular-for-track-logic.ts +88 -0
  87. package/src/plugin/rules/angular/effect-signal-loop.spec.ts +89 -0
  88. package/src/plugin/rules/angular/effect-signal-loop.ts +125 -0
  89. package/src/plugin/rules/angular/no-async-ngoninit.spec.ts +50 -0
  90. package/src/plugin/rules/angular/no-async-ngoninit.ts +43 -0
  91. package/src/plugin/rules/angular/no-component-direct-api.spec.ts +78 -0
  92. package/src/plugin/rules/angular/no-component-direct-api.ts +82 -0
  93. package/src/plugin/rules/angular/no-method-call-in-template.spec.ts +63 -0
  94. package/src/plugin/rules/angular/no-method-call-in-template.ts +89 -0
  95. package/src/plugin/rules/angular/no-ngfor-directive.spec.ts +44 -0
  96. package/src/plugin/rules/angular/no-ngfor-directive.ts +62 -0
  97. package/src/plugin/rules/angular/no-ngif-directive.spec.ts +44 -0
  98. package/src/plugin/rules/angular/no-ngif-directive.ts +62 -0
  99. package/src/plugin/rules/naming-patterns.spec.ts +108 -22
  100. package/src/plugin/rules/naming-patterns.ts +390 -11
  101. package/src/plugin/rules/no-getter-logic.spec.ts +71 -0
  102. package/src/plugin/rules/no-getter-logic.ts +21 -2
  103. package/src/plugin/rules/require-jsdoc-description.spec.ts +1 -0
  104. package/src/plugin/rules/require-jsdoc-description.ts +19 -0
  105. package/src/plugin/rules/ts/data-model-extends.spec.ts +84 -0
  106. package/src/plugin/rules/ts/data-model-extends.ts +100 -0
  107. package/src/plugin/rules/ts/no-any-type.spec.ts +28 -0
  108. package/src/plugin/rules/ts/no-any-type.ts +36 -0
  109. package/src/plugin/rules/ts/no-as-cast.spec.ts +51 -0
  110. package/src/plugin/rules/ts/no-as-cast.ts +51 -0
  111. package/src/plugin/rules/ts/no-dynamic-imports.spec.ts +54 -0
  112. package/src/plugin/rules/ts/no-dynamic-imports.ts +49 -0
  113. package/src/plugin/rules/ts/no-native-browser-dialogs.spec.ts +54 -0
  114. package/src/plugin/rules/ts/no-native-browser-dialogs.ts +84 -0
  115. package/src/plugin/rules/ts/no-plain-function-export.spec.ts +72 -0
  116. package/src/plugin/rules/ts/no-plain-function-export.ts +73 -0
  117. package/src/plugin/rules/ts/one-export-per-file.spec.ts +64 -0
  118. package/src/plugin/rules/ts/one-export-per-file.ts +77 -0
  119. package/futdevpro-dynamo-eslint-1.15.6.tgz +0 -0
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Parallel date field nevek – ezeket egy DataModel sem tartalmazhatja,
5
+ * mert a `DyFM_Metadata` `__created` / `__updated` mezőit kell használni.
6
+ */
7
+ const PARALLEL_DATE_FIELD_NAMES = new Set([
8
+ 'firstRegisteredAt',
9
+ 'lastSeenAt',
10
+ 'createdAt',
11
+ 'updatedAt',
12
+ 'registeredAt',
13
+ 'seenAt',
14
+ 'modifiedAt',
15
+ 'lastModified',
16
+ 'lastUpdated',
17
+ 'dateCreated',
18
+ 'dateUpdated',
19
+ ]);
20
+ /**
21
+ * Data-model-extends szabály: `*.data-model.ts` osztályoknak `DyFM_Metadata`-t (vagy bármely `DyFM_*`-ot)
22
+ * kell kiterjeszteniük, és tilos párhuzamos dátum mezőket definiálni.
23
+ * CCAP "data-model-extends" review ESLint AST-portja.
24
+ */
25
+ const rule = {
26
+ meta: {
27
+ type: 'suggestion',
28
+ docs: {
29
+ description: '`*.data-model.ts` classes must extend `DyFM_*`; no parallel date fields allowed.',
30
+ recommended: true,
31
+ },
32
+ schema: [],
33
+ messages: {
34
+ missingExtends: '`{{className}}` nem terjeszti ki a `DyFM_Metadata`-t (vagy `DyFM_*` base-t). '
35
+ + 'DataModel osztálynak `extends DyFM_Metadata` szükséges.',
36
+ parallelDateField: 'Párhuzamos dátum mező `{{fieldName}}` tilos. '
37
+ + 'Használd a `DyFM_Metadata`-ból örökölt `__created` / `__updated` mezőket.',
38
+ },
39
+ },
40
+ create(context) {
41
+ const filename = context.filename ?? '';
42
+ if (!filename.endsWith('.data-model.ts')) {
43
+ return {};
44
+ }
45
+ return {
46
+ ClassDeclaration(node) {
47
+ try {
48
+ const superClass = node.superClass;
49
+ let extendsName = null;
50
+ if (superClass && superClass.type === 'Identifier') {
51
+ extendsName = superClass.name;
52
+ }
53
+ else if (superClass
54
+ && superClass.type === 'MemberExpression'
55
+ && superClass.property
56
+ && superClass.property.name) {
57
+ extendsName = superClass.property.name;
58
+ }
59
+ const isDyFmExtends = extendsName !== null && extendsName.startsWith('DyFM_');
60
+ if (!isDyFmExtends) {
61
+ const className = (node.id && node.id.name) ? node.id.name : 'anonymous';
62
+ context.report({
63
+ node: node.id ?? node,
64
+ messageId: 'missingExtends',
65
+ data: { className: className },
66
+ });
67
+ }
68
+ const body = node.body;
69
+ if (!body || !Array.isArray(body.body)) {
70
+ return;
71
+ }
72
+ for (const member of body.body) {
73
+ if (member.type !== 'PropertyDefinition') {
74
+ continue;
75
+ }
76
+ const key = member.key;
77
+ const fieldName = (key && key.type === 'Identifier' && key.name) ? key.name : null;
78
+ if (fieldName !== null && PARALLEL_DATE_FIELD_NAMES.has(fieldName)) {
79
+ context.report({
80
+ node: member,
81
+ messageId: 'parallelDateField',
82
+ data: { fieldName: fieldName },
83
+ });
84
+ }
85
+ }
86
+ }
87
+ catch (error) {
88
+ console.error('[data-model-extends] Error in ClassDeclaration visitor:', error);
89
+ }
90
+ },
91
+ };
92
+ },
93
+ };
94
+ exports.default = rule;
95
+ //# sourceMappingURL=data-model-extends.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-model-extends.js","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/data-model-extends.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AACH,MAAM,yBAAyB,GAAgB,IAAI,GAAG,CAAS;IAC7D,mBAAmB;IACnB,YAAY;IACZ,WAAW;IACX,WAAW;IACX,cAAc;IACd,QAAQ;IACR,YAAY;IACZ,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;CACd,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,kFAAkF;YAC/F,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,cAAc,EACZ,+EAA+E;kBAC7E,yDAAyD;YAC7D,iBAAiB,EACf,+CAA+C;kBAC7C,2EAA2E;SAChF;KACF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AI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;wBACvC,OAAO;oBACT,CAAC;oBACD,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;wBAC/B,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;4BACzC,SAAS;wBACX,CAAC;wBACD,MAAM,GAAG,GAAQ,MAAM,CAAC,GAAG,CAAC;wBAC5B,MAAM,SAAS,GAAkB,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;wBAClG,IAAI,SAAS,KAAK,IAAI,IAAI,yBAAyB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;4BACnE,OAAO,CAAC,MAAM,CAAC;gCACb,IAAI,EAAE,MAAM;gCACZ,SAAS,EAAE,mBAAmB;gCAC9B,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;6BAC/B,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,yDAAyD,EAAE,KAAK,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-any-type szabály: `any` típus annotáció tilos.
4
+ * CCAP "no-any-type" review ESLint AST-portja.
5
+ * Lefedi a `: any`, `<any>`, `as any`, `Array<any>`, `Promise<any>` eseteket egyaránt.
6
+ */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=no-any-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-any-type.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-any-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UA0BhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * No-any-type szabály: `any` típus annotáció tilos.
5
+ * CCAP "no-any-type" review ESLint AST-portja.
6
+ * Lefedi a `: any`, `<any>`, `as any`, `Array<any>`, `Promise<any>` eseteket egyaránt.
7
+ */
8
+ const rule = {
9
+ meta: {
10
+ type: 'suggestion',
11
+ docs: {
12
+ description: 'Forbid `any` type annotation in TypeScript files.',
13
+ recommended: true,
14
+ },
15
+ schema: [],
16
+ messages: {
17
+ noAny: '`any` típus tilos. Adj meg konkrét típust vagy használj `unknown`-t.',
18
+ },
19
+ },
20
+ create(context) {
21
+ return {
22
+ TSAnyKeyword(node) {
23
+ try {
24
+ context.report({
25
+ node: node,
26
+ messageId: 'noAny',
27
+ });
28
+ }
29
+ catch (error) {
30
+ console.error('[no-any-type] Error in TSAnyKeyword visitor:', error);
31
+ }
32
+ },
33
+ };
34
+ },
35
+ };
36
+ exports.default = rule;
37
+ //# sourceMappingURL=no-any-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-any-type.js","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-any-type.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;YAChE,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,KAAK,EAAE,sEAAsE;SAC9E;KACF;IACD,MAAM,CAAC,OAAyB;QAC9B,OAAO;YACL,YAAY,CAAC,IAAS;gBACpB,IAAI,CAAC;oBACH,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,IAAI;wBACV,SAAS,EAAE,OAAO;qBACnB,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,8CAA8C,EAAE,KAAK,CAAC,CAAC;gBACvE,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-as-cast szabály: TypeScript `as` type cast tilos.
4
+ * CCAP "no-as-cast" review ESLint AST-portja.
5
+ * Megjegyzés: az `as const` kifejezést megengedjük (immutable literal-ként standard).
6
+ */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=no-as-cast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-as-cast.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-as-cast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAyChB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * No-as-cast szabály: TypeScript `as` type cast tilos.
5
+ * CCAP "no-as-cast" review ESLint AST-portja.
6
+ * Megjegyzés: az `as const` kifejezést megengedjük (immutable literal-ként standard).
7
+ */
8
+ const rule = {
9
+ meta: {
10
+ type: 'suggestion',
11
+ docs: {
12
+ description: 'Forbid TypeScript `as` type casts (except `as const`); design issue indicator.',
13
+ recommended: true,
14
+ },
15
+ schema: [],
16
+ messages: {
17
+ noAsCast: '`as {{typeName}}` type cast tilos. Tervezési problémát jelezhet — használj rendes típust.',
18
+ },
19
+ },
20
+ create(context) {
21
+ return {
22
+ TSAsExpression(node) {
23
+ try {
24
+ const annotation = node.typeAnnotation;
25
+ if (!annotation) {
26
+ return;
27
+ }
28
+ // `as const` esetén megengedjük – immutable literal idiomatika.
29
+ if (annotation.type === 'TSTypeReference'
30
+ && annotation.typeName
31
+ && annotation.typeName.type === 'Identifier'
32
+ && annotation.typeName.name === 'const') {
33
+ return;
34
+ }
35
+ const typeName = context.sourceCode.getText(annotation);
36
+ context.report({
37
+ node: node,
38
+ messageId: 'noAsCast',
39
+ data: { typeName: typeName },
40
+ });
41
+ }
42
+ catch (error) {
43
+ console.error('[no-as-cast] Error in TSAsExpression visitor:', error);
44
+ }
45
+ },
46
+ };
47
+ },
48
+ };
49
+ exports.default = rule;
50
+ //# sourceMappingURL=no-as-cast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-as-cast.js","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-as-cast.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,gFAAgF;YAC7F,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,QAAQ,EAAE,2FAA2F;SACtG;KACF;IACD,MAAM,CAAC,OAAyB;QAC9B,OAAO;YACL,cAAc,CAAC,IAAS;gBACtB,IAAI,CAAC;oBACH,MAAM,UAAU,GAAQ,IAAI,CAAC,cAAc,CAAC;oBAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;wBAChB,OAAO;oBACT,CAAC;oBACD,gEAAgE;oBAChE,IACE,UAAU,CAAC,IAAI,KAAK,iBAAiB;2BAClC,UAAU,CAAC,QAAQ;2BACnB,UAAU,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY;2BACzC,UAAU,CAAC,QAAQ,CAAC,IAAI,KAAK,OAAO,EACvC,CAAC;wBACD,OAAO;oBACT,CAAC;oBACD,MAAM,QAAQ,GAAW,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;oBAChE,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,IAAI;wBACV,SAAS,EAAE,UAAU;wBACrB,IAAI,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;qBAC7B,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,KAAK,CAAC,CAAC;gBACxE,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-dynamic-imports szabály: `import()` és `require()` dinamikus hívás tilos.
4
+ * Minden import a fájl tetején, top-level `import { … } from '…'` formában szerepeljen.
5
+ * CCAP "no-dynamic-imports" review ESLint AST-portja.
6
+ */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=no-dynamic-imports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-dynamic-imports.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-dynamic-imports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAuChB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * No-dynamic-imports szabály: `import()` és `require()` dinamikus hívás tilos.
5
+ * Minden import a fájl tetején, top-level `import { … } from '…'` formában szerepeljen.
6
+ * CCAP "no-dynamic-imports" review ESLint AST-portja.
7
+ */
8
+ const rule = {
9
+ meta: {
10
+ type: 'suggestion',
11
+ docs: {
12
+ description: 'Forbid dynamic `import()` and `require()` calls; all imports must be top-level.',
13
+ recommended: true,
14
+ },
15
+ schema: [],
16
+ messages: {
17
+ noDynamicImport: 'Dinamikus `import()` hívás tilos. Tedd top-level `import { … } from "…"` formába.',
18
+ noRequireCall: '`require()` hívás tilos. Használj top-level ES `import` szintaxist.',
19
+ },
20
+ },
21
+ create(context) {
22
+ return {
23
+ ImportExpression(node) {
24
+ try {
25
+ context.report({
26
+ node: node,
27
+ messageId: 'noDynamicImport',
28
+ });
29
+ }
30
+ catch (error) {
31
+ console.error('[no-dynamic-imports] Error in ImportExpression visitor:', error);
32
+ }
33
+ },
34
+ CallExpression(node) {
35
+ try {
36
+ if (node.callee && node.callee.type === 'Identifier' && node.callee.name === 'require') {
37
+ context.report({
38
+ node: node,
39
+ messageId: 'noRequireCall',
40
+ });
41
+ }
42
+ }
43
+ catch (error) {
44
+ console.error('[no-dynamic-imports] Error in CallExpression visitor:', error);
45
+ }
46
+ },
47
+ };
48
+ },
49
+ };
50
+ exports.default = rule;
51
+ //# sourceMappingURL=no-dynamic-imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-dynamic-imports.js","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-dynamic-imports.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,iFAAiF;YAC9F,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,eAAe,EAAE,mFAAmF;YACpG,aAAa,EAAE,qEAAqE;SACrF;KACF;IACD,MAAM,CAAC,OAAyB;QAC9B,OAAO;YACL,gBAAgB,CAAC,IAAS;gBACxB,IAAI,CAAC;oBACH,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,IAAI;wBACV,SAAS,EAAE,iBAAiB;qBAC7B,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,yDAAyD,EAAE,KAAK,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC;YACD,cAAc,CAAC,IAAS;gBACtB,IAAI,CAAC;oBACH,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;wBACvF,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,IAAI;4BACV,SAAS,EAAE,eAAe;yBAC3B,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,uDAAuD,EAAE,KAAK,CAAC,CAAC;gBAChF,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-native-browser-dialogs szabály: tilos a natív `window.alert` / `window.confirm` /
4
+ * `window.prompt` / `showModalDialog` hívás. Helyette shared modal komponens (`S_Modal_Component`)
5
+ * használandó. CCAP "no-native-browser-dialogs" review ESLint AST-portja.
6
+ */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=no-native-browser-dialogs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-native-browser-dialogs.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-native-browser-dialogs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAuB9B;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAqDhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Tiltott natív browser dialog nevek.
5
+ */
6
+ const NATIVE_DIALOG_NAMES = new Set([
7
+ 'alert',
8
+ 'confirm',
9
+ 'prompt',
10
+ 'showModalDialog',
11
+ ]);
12
+ /**
13
+ * Globális objektum nevek, amelyeken a dialog hívás detektálandó.
14
+ */
15
+ const GLOBAL_NAMES = new Set([
16
+ 'window',
17
+ 'globalThis',
18
+ 'self',
19
+ 'top',
20
+ 'parent',
21
+ ]);
22
+ /**
23
+ * No-native-browser-dialogs szabály: tilos a natív `window.alert` / `window.confirm` /
24
+ * `window.prompt` / `showModalDialog` hívás. Helyette shared modal komponens (`S_Modal_Component`)
25
+ * használandó. CCAP "no-native-browser-dialogs" review ESLint AST-portja.
26
+ */
27
+ const rule = {
28
+ meta: {
29
+ type: 'suggestion',
30
+ docs: {
31
+ description: 'Forbid native blocking browser dialogs (`alert`, `confirm`, `prompt`, `showModalDialog`); '
32
+ + 'use shared modal component instead.',
33
+ recommended: true,
34
+ },
35
+ schema: [],
36
+ messages: {
37
+ noNativeDialog: 'Natív browser dialog `{{name}}` tilos. '
38
+ + 'Használj shared modal komponenst (pl. `S_Modal_Component` / `app-s-modal`).',
39
+ },
40
+ },
41
+ create(context) {
42
+ return {
43
+ CallExpression(node) {
44
+ try {
45
+ const callee = node.callee;
46
+ if (!callee) {
47
+ return;
48
+ }
49
+ if (callee.type === 'Identifier' && NATIVE_DIALOG_NAMES.has(callee.name)) {
50
+ context.report({
51
+ node: node,
52
+ messageId: 'noNativeDialog',
53
+ data: { name: callee.name },
54
+ });
55
+ return;
56
+ }
57
+ if (callee.type === 'MemberExpression'
58
+ && callee.object
59
+ && callee.object.type === 'Identifier'
60
+ && GLOBAL_NAMES.has(callee.object.name)
61
+ && callee.property
62
+ && callee.property.type === 'Identifier'
63
+ && NATIVE_DIALOG_NAMES.has(callee.property.name)) {
64
+ context.report({
65
+ node: node,
66
+ messageId: 'noNativeDialog',
67
+ data: { name: `${callee.object.name}.${callee.property.name}` },
68
+ });
69
+ }
70
+ }
71
+ catch (error) {
72
+ console.error('[no-native-browser-dialogs] Error in CallExpression visitor:', error);
73
+ }
74
+ },
75
+ };
76
+ },
77
+ };
78
+ exports.default = rule;
79
+ //# sourceMappingURL=no-native-browser-dialogs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-native-browser-dialogs.js","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-native-browser-dialogs.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,MAAM,mBAAmB,GAAgB,IAAI,GAAG,CAAS;IACvD,OAAO;IACP,SAAS;IACT,QAAQ;IACR,iBAAiB;CAClB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,YAAY,GAAgB,IAAI,GAAG,CAAS;IAChD,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,KAAK;IACL,QAAQ;CACT,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,4FAA4F;kBAC1F,qCAAqC;YACzC,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,cAAc,EACZ,yCAAyC;kBACvC,6EAA6E;SAClF;KACF;IACD,MAAM,CAAC,OAAyB;QAC9B,OAAO;YACL,cAAc,CAAC,IAAS;gBACtB,IAAI,CAAC;oBACH,MAAM,MAAM,GAAQ,IAAI,CAAC,MAAM,CAAC;oBAChC,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,OAAO;oBACT,CAAC;oBACD,IAAI,MAAM,CAAC,IAAI,KAAK,YAAY,IAAI,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;wBACzE,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,IAAI;4BACV,SAAS,EAAE,gBAAgB;4BAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;yBAC5B,CAAC,CAAC;wBACH,OAAO;oBACT,CAAC;oBACD,IACE,MAAM,CAAC,IAAI,KAAK,kBAAkB;2BAC/B,MAAM,CAAC,MAAM;2BACb,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY;2BACnC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;2BACpC,MAAM,CAAC,QAAQ;2BACf,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY;2BACrC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAChD,CAAC;wBACD,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,IAAI;4BACV,SAAS,EAAE,gBAAgB;4BAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE;yBAChE,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,8DAA8D,EAAE,KAAK,CAAC,CAAC;gBACvF,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Rule } from 'eslint';
2
+ /**
3
+ * No-plain-function-export szabály: tilos top-level `export function fn()` és
4
+ * `export const fn = () => …` arrow/function deklaráció.
5
+ * Megosztott logika static `_Util` / `UtilService` osztály metódusokban kell legyen.
6
+ * CCAP "no-plain-function-export" review ESLint AST-portja.
7
+ */
8
+ declare const rule: Rule.RuleModule;
9
+ export default rule;
10
+ //# sourceMappingURL=no-plain-function-export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-plain-function-export.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-plain-function-export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;;;;GAKG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UA8DhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * No-plain-function-export szabály: tilos top-level `export function fn()` és
5
+ * `export const fn = () => …` arrow/function deklaráció.
6
+ * Megosztott logika static `_Util` / `UtilService` osztály metódusokban kell legyen.
7
+ * CCAP "no-plain-function-export" review ESLint AST-portja.
8
+ */
9
+ const rule = {
10
+ meta: {
11
+ type: 'suggestion',
12
+ docs: {
13
+ description: 'Forbid top-level `export function` and `export const fn = () => …`; '
14
+ + 'use static methods on `_Util` / `UtilService` classes.',
15
+ recommended: true,
16
+ },
17
+ schema: [],
18
+ messages: {
19
+ noFunctionExport: 'Top-level `export function {{name}}` tilos. '
20
+ + 'Tedd static metódusba `_Util` / `UtilService` osztályon belül.',
21
+ noConstFunctionExport: 'Top-level `export const {{name}} = () => …` tilos. '
22
+ + 'Tedd static metódusba `_Util` / `UtilService` osztályon belül.',
23
+ },
24
+ },
25
+ create(context) {
26
+ const filename = context.filename ?? '';
27
+ if (filename.endsWith('.spec.ts') || filename.endsWith('.test.ts')) {
28
+ return {};
29
+ }
30
+ return {
31
+ ExportNamedDeclaration(node) {
32
+ try {
33
+ const decl = node.declaration;
34
+ if (!decl) {
35
+ return;
36
+ }
37
+ if (decl.type === 'FunctionDeclaration' && decl.id && decl.id.name) {
38
+ context.report({
39
+ node: decl,
40
+ messageId: 'noFunctionExport',
41
+ data: { name: decl.id.name },
42
+ });
43
+ return;
44
+ }
45
+ if (decl.type === 'VariableDeclaration' && Array.isArray(decl.declarations)) {
46
+ for (const declarator of decl.declarations) {
47
+ const init = declarator.init;
48
+ if (!init) {
49
+ continue;
50
+ }
51
+ if (init.type === 'ArrowFunctionExpression' || init.type === 'FunctionExpression') {
52
+ const name = (declarator.id && declarator.id.name) ? declarator.id.name : 'anonymous';
53
+ context.report({
54
+ node: declarator,
55
+ messageId: 'noConstFunctionExport',
56
+ data: { name: name },
57
+ });
58
+ }
59
+ }
60
+ }
61
+ }
62
+ catch (error) {
63
+ console.error('[no-plain-function-export] Error in ExportNamedDeclaration visitor:', error);
64
+ }
65
+ },
66
+ };
67
+ },
68
+ };
69
+ exports.default = rule;
70
+ //# sourceMappingURL=no-plain-function-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-plain-function-export.js","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/no-plain-function-export.ts"],"names":[],"mappings":";;AAEA;;;;;GAKG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,sEAAsE;kBACpE,wDAAwD;YAC5D,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,gBAAgB,EACd,8CAA8C;kBAC5C,gEAAgE;YACpE,qBAAqB,EACnB,qDAAqD;kBACnD,gEAAgE;SACrE;KACF;IACD,MAAM,CAAC,OAAyB;QAC9B,MAAM,QAAQ,GAAW,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;QAChD,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACnE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO;YACL,sBAAsB,CAAC,IAAS;gBAC9B,IAAI,CAAC;oBACH,MAAM,IAAI,GAAQ,IAAI,CAAC,WAAW,CAAC;oBACnC,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,OAAO;oBACT,CAAC;oBACD,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,IAAI,IAAI,CAA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
+ /**
3
+ * One-export-per-file szabály: nem-kivétel fájlokban max 1 exportált
4
+ * class/interface/enum/type/function deklaráció lehet.
5
+ * CCAP "one-export-per-file" review ESLint AST-portja.
6
+ */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=one-export-per-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-export-per-file.d.ts","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/one-export-per-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAc9B;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAuDhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Kivétel fájl-minták – ezekben megengedett több export.
5
+ * CCAP konvenció: `*.const.ts`, `*.type-enum.ts`, `*.interface.ts`, DataModel + DataParams.
6
+ */
7
+ const MULTI_EXPORT_EXCEPTION_PATTERNS = [
8
+ /\.const\.ts$/,
9
+ /\.type-enum\.ts$/,
10
+ /\.interface\.ts$/,
11
+ /\.data-model\.ts$/,
12
+ /\.control-model\.ts$/,
13
+ ];
14
+ /**
15
+ * One-export-per-file szabály: nem-kivétel fájlokban max 1 exportált
16
+ * class/interface/enum/type/function deklaráció lehet.
17
+ * CCAP "one-export-per-file" review ESLint AST-portja.
18
+ */
19
+ const rule = {
20
+ meta: {
21
+ type: 'suggestion',
22
+ docs: {
23
+ description: 'Limit to one exported class/interface/enum/type/function per file (with named exceptions).',
24
+ recommended: true,
25
+ },
26
+ schema: [],
27
+ messages: {
28
+ tooManyExports: '{{count}} export deklaráció a fájlban (max 1). Vegyél ki minden további exportot külön fájlba.',
29
+ },
30
+ },
31
+ create(context) {
32
+ const filename = context.filename ?? '';
33
+ if (MULTI_EXPORT_EXCEPTION_PATTERNS.some((p) => p.test(filename))) {
34
+ return {};
35
+ }
36
+ if (filename.endsWith('.spec.ts') || filename.endsWith('.test.ts') || filename.endsWith('.d.ts')) {
37
+ return {};
38
+ }
39
+ return {
40
+ Program(node) {
41
+ try {
42
+ const exportNodes = [];
43
+ for (const statement of node.body) {
44
+ if (statement.type === 'ExportNamedDeclaration' && statement.declaration) {
45
+ const decl = statement.declaration;
46
+ if (decl.type === 'ClassDeclaration'
47
+ || decl.type === 'TSInterfaceDeclaration'
48
+ || decl.type === 'TSEnumDeclaration'
49
+ || decl.type === 'TSTypeAliasDeclaration'
50
+ || decl.type === 'FunctionDeclaration') {
51
+ exportNodes.push(statement);
52
+ }
53
+ }
54
+ else if (statement.type === 'ExportDefaultDeclaration') {
55
+ exportNodes.push(statement);
56
+ }
57
+ }
58
+ if (exportNodes.length > 1) {
59
+ context.report({
60
+ node: exportNodes[1],
61
+ messageId: 'tooManyExports',
62
+ data: { count: String(exportNodes.length) },
63
+ });
64
+ }
65
+ }
66
+ catch (error) {
67
+ console.error('[one-export-per-file] Error in Program visitor:', error);
68
+ }
69
+ },
70
+ };
71
+ },
72
+ };
73
+ exports.default = rule;
74
+ //# sourceMappingURL=one-export-per-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-export-per-file.js","sourceRoot":"","sources":["../../../../src/plugin/rules/ts/one-export-per-file.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AACH,MAAM,+BAA+B,GAAa;IAChD,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,sBAAsB;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,4FAA4F;YACzG,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,cAAc,EACZ,gGAAgG;SACnG;KACF;IACD,MAAM,CAAC,OAAyB;QAC9B,MAAM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C;4BACpB,SAAS,EAAE,gBAAgB;4BAC3B,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;yBAC5C,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;gBAC1E,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/dynamo-eslint",
3
- "version": "1.15.6",
3
+ "version": "1.15.8",
4
4
  "description": "Shared ESLint configs, Dynamo-powered plugin and validators for FutDevPro stacks",
5
5
  "author": "Future Development Program Ltd.",
6
6
  "license": "ISC",
@@ -17,26 +17,21 @@
17
17
  "preprep-setup-safechain-windows": "iex (iwr \"https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.ps1\" -UseBasicParsing)",
18
18
  "preprep-setup-safechain-linux": "curl -fsSL https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.sh | sh",
19
19
  "start": "npm run prep && nodemon",
20
-
21
20
  "deploy": "npm run build",
22
21
  "clean-deploy": "pnpm run clean && pnpm run build-all",
23
-
24
22
  "build": "pnpm run build-base && jasmine && npm publish",
25
23
  "build-tgz": "pnpm run build-base && jasmine && pnpm pack && move ./*.tgz ../tgz-collection/dynamo-eslint",
26
24
  "build-all": "pnpm run build-tgz && pnpm run build",
27
25
  "build-base": "rimraf ./build && npx tsc",
28
26
  "build-clean": "pnpm run clean && pnpm run build-base",
29
27
  "build-n-test": "pnpm i && pnpm run build-tgz",
30
-
31
28
  "clean": "pnpm run prep && rimraf ./build && rimraf package-lock.json && rimraf pnpm-lock.yaml && rimraf ./node_modules",
32
-
33
29
  "test": "npm run prep && pnpm run build-base && jasmine",
34
30
  "test-clean": "pnpm run build-clean && jasmine",
35
31
  "test:coverage": "npx c8 --reporter=html --reporter=text --reporter=lcov node scripts/run-coverage-tests.js",
36
32
  "test-full": "pnpm run prep && pnpm run test",
37
33
  "test-lint": "npm test && npm run lint",
38
34
  "test-fix": "npm test && npm run lint:fix",
39
-
40
35
  "nodemon-run": "npm run build-tgz",
41
36
  "lint": "eslint src --ext .ts",
42
37
  "lint:fix": "eslint src --ext .ts --fix --fix-type problem,suggestion,layout",
@@ -45,7 +40,8 @@
45
40
  "validate:naming": "dynamo-validate-naming",
46
41
  "audit:eslintrc": "dynamo-eslintrc-audit",
47
42
  "fix": "dynamo-fix",
48
- "fix:return-types": "dynamo-fix-return-types"
43
+ "fix:return-types": "dynamo-fix-return-types",
44
+ "prepare": "husky"
49
45
  },
50
46
  "exports": {
51
47
  ".": {
@@ -87,7 +83,7 @@
87
83
  "prettier": "3.3.0"
88
84
  },
89
85
  "dependencies": {
90
- "@futdevpro/fsm-dynamo": "1.15.7",
86
+ "@futdevpro/fsm-dynamo": "1.15.8",
91
87
  "fast-glob": "3.3.2",
92
88
  "tslib": "2.8.1"
93
89
  },
@@ -103,6 +99,7 @@
103
99
  "jasmine-spec-reporter": "7.0.0",
104
100
  "rimraf": "5.0.5",
105
101
  "ts-node": "~10.9.1",
106
- "typescript": "5.5.4"
102
+ "typescript": "5.5.4",
103
+ "husky": "^9.1.7"
107
104
  }
108
105
  }