@trackunit/eslint-plugin-trackunit 0.4.7 → 0.4.9

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 (65) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/src/lib/config/index.d.ts +21 -21
  4. package/src/lib/config/plugins.d.ts +7 -7
  5. package/src/lib/config/presets/base.d.ts +14 -14
  6. package/src/lib/config/presets/react.d.ts +7 -7
  7. package/src/lib/rules/no-internal-graphql-when-tagged-with-gql-public/no-internal-graphql-when-tagged-with-gql-public.d.ts +3 -4
  8. package/src/lib/rules/no-internal-graphql-when-tagged-with-gql-public/no-internal-graphql-when-tagged-with-gql-public.js +60 -57
  9. package/src/lib/rules/no-jest-mock-trackunit-react-core-hooks/no-jest-mock-trackunit-react-core-hooks.d.ts +4 -2
  10. package/src/lib/rules/no-jest-mock-trackunit-react-core-hooks/no-jest-mock-trackunit-react-core-hooks.js +6 -2
  11. package/src/lib/rules/no-typescript-assertion/no-typescript-assertion.d.ts +5 -4
  12. package/src/lib/rules/no-typescript-assertion/no-typescript-assertion.js +57 -72
  13. package/src/lib/rules/require-list-item-virtualization-props/require-list-item-virtualization-props.js +1 -1
  14. package/src/lib/rules-map.d.ts +7 -8
  15. package/src/index.js.map +0 -1
  16. package/src/lib/config/fragments/ignores.js.map +0 -1
  17. package/src/lib/config/fragments/import-rules.js.map +0 -1
  18. package/src/lib/config/fragments/jest-overrides.js.map +0 -1
  19. package/src/lib/config/fragments/jsdoc-rules.js.map +0 -1
  20. package/src/lib/config/fragments/module-boundaries.js.map +0 -1
  21. package/src/lib/config/fragments/react-rules.js.map +0 -1
  22. package/src/lib/config/fragments/restricted-imports.js.map +0 -1
  23. package/src/lib/config/fragments/testing-library.js.map +0 -1
  24. package/src/lib/config/fragments/typescript-rules.js.map +0 -1
  25. package/src/lib/config/index.js.map +0 -1
  26. package/src/lib/config/plugins.js.map +0 -1
  27. package/src/lib/config/presets/base.js.map +0 -1
  28. package/src/lib/config/presets/e2e.js.map +0 -1
  29. package/src/lib/config/presets/react.js.map +0 -1
  30. package/src/lib/config/presets/server.js.map +0 -1
  31. package/src/lib/config/utils.js.map +0 -1
  32. package/src/lib/config-helpers/create-skip-when.js.map +0 -1
  33. package/src/lib/rules/cva-merge-base-classes-as-array/cva-merge-base-classes-as-array.js.map +0 -1
  34. package/src/lib/rules/design-guideline-button-icon-size-match/design-guideline-button-icon-size-match.js.map +0 -1
  35. package/src/lib/rules/no-internal-barrel-files/examples.d.ts +0 -80
  36. package/src/lib/rules/no-internal-barrel-files/examples.js +0 -84
  37. package/src/lib/rules/no-internal-barrel-files/examples.js.map +0 -1
  38. package/src/lib/rules/no-internal-barrel-files/no-internal-barrel-files.js.map +0 -1
  39. package/src/lib/rules/no-internal-graphql-when-tagged-with-gql-public/no-internal-graphql-when-tagged-with-gql-public.js.map +0 -1
  40. package/src/lib/rules/no-jest-mock-trackunit-react-core-hooks/no-jest-mock-trackunit-react-core-hooks.js.map +0 -1
  41. package/src/lib/rules/no-template-strings-in-classname-prop/no-template-strings-in-classname-prop.js.map +0 -1
  42. package/src/lib/rules/no-typescript-assertion/examples.d.ts +0 -1
  43. package/src/lib/rules/no-typescript-assertion/examples.js +0 -45
  44. package/src/lib/rules/no-typescript-assertion/examples.js.map +0 -1
  45. package/src/lib/rules/no-typescript-assertion/no-typescript-assertion.js.map +0 -1
  46. package/src/lib/rules/prefer-destructured-imports/prefer-destructured-imports.js.map +0 -1
  47. package/src/lib/rules/prefer-event-specific-callback-naming/name-suggestion-strategies.js.map +0 -1
  48. package/src/lib/rules/prefer-event-specific-callback-naming/prefer-event-specific-callback-naming.js.map +0 -1
  49. package/src/lib/rules/prefer-event-specific-callback-naming/strategies/string-based.js.map +0 -1
  50. package/src/lib/rules/prefer-event-specific-callback-naming/strategies/type-based.js.map +0 -1
  51. package/src/lib/rules/prefer-event-specific-callback-naming/utils.js.map +0 -1
  52. package/src/lib/rules/prefer-field-components/prefer-field-components.js.map +0 -1
  53. package/src/lib/rules/prefer-mouse-event-handler-in-react-props/prefer-mouse-event-handler-in-react-props.js.map +0 -1
  54. package/src/lib/rules/require-classname-alternatives/require-classname-alternatives.js.map +0 -1
  55. package/src/lib/rules/require-list-item-virtualization-props/require-list-item-virtualization-props.js.map +0 -1
  56. package/src/lib/rules/require-optional-prop-initialization/require-optional-prop-initialization.js.map +0 -1
  57. package/src/lib/rules/require-optional-prop-initialization/suggestion-utils.js.map +0 -1
  58. package/src/lib/rules-map.js.map +0 -1
  59. package/src/lib/utils/ast-utils.js.map +0 -1
  60. package/src/lib/utils/classname-utils.js.map +0 -1
  61. package/src/lib/utils/file-utils.js.map +0 -1
  62. package/src/lib/utils/import-utils.js.map +0 -1
  63. package/src/lib/utils/nx-utils.js.map +0 -1
  64. package/src/lib/utils/package-utils.js.map +0 -1
  65. package/src/lib/utils/typescript-utils.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.4.9 (2026-03-12)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated shared-utils to 1.13.65
6
+
7
+ ## 0.4.8 (2026-03-12)
8
+
9
+ ### 🧱 Updated Dependencies
10
+
11
+ - Updated shared-utils to 1.13.64
12
+
1
13
  ## 0.4.7 (2026-03-12)
2
14
 
3
15
  This was a version bump only for eslint-plugin-trackunit to align it with other projects, there were no code changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/eslint-plugin-trackunit",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -10,13 +10,11 @@ export declare const configs: {
10
10
  "no-internal-barrel-files": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
11
11
  name: string;
12
12
  };
13
- "no-typescript-assertion": {
14
- meta: import("eslint").Rule.RuleMetaData;
15
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
13
+ "no-typescript-assertion": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
14
+ name: string;
16
15
  };
17
- "no-internal-graphql-when-tagged-with-gql-public": {
18
- meta: import("eslint").Rule.RuleMetaData;
19
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
16
+ "no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
17
+ name: string;
20
18
  };
21
19
  "design-guideline-button-icon-size-match": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
22
20
  name: string;
@@ -30,7 +28,9 @@ export declare const configs: {
30
28
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
31
29
  name: string;
32
30
  };
33
- "no-jest-mock-trackunit-react-core-hooks": import("eslint").Rule.RuleModule;
31
+ "no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
32
+ name: string;
33
+ };
34
34
  "prefer-destructured-imports": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
35
35
  packages: Record<string, string>;
36
36
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
@@ -175,13 +175,11 @@ export declare const configs: {
175
175
  "no-internal-barrel-files": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
176
176
  name: string;
177
177
  };
178
- "no-typescript-assertion": {
179
- meta: import("eslint").Rule.RuleMetaData;
180
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
178
+ "no-typescript-assertion": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
179
+ name: string;
181
180
  };
182
- "no-internal-graphql-when-tagged-with-gql-public": {
183
- meta: import("eslint").Rule.RuleMetaData;
184
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
181
+ "no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
182
+ name: string;
185
183
  };
186
184
  "design-guideline-button-icon-size-match": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
187
185
  name: string;
@@ -195,7 +193,9 @@ export declare const configs: {
195
193
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
196
194
  name: string;
197
195
  };
198
- "no-jest-mock-trackunit-react-core-hooks": import("eslint").Rule.RuleModule;
196
+ "no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
197
+ name: string;
198
+ };
199
199
  "prefer-destructured-imports": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
200
200
  packages: Record<string, string>;
201
201
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
@@ -273,13 +273,11 @@ export declare const configs: {
273
273
  "no-internal-barrel-files": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
274
274
  name: string;
275
275
  };
276
- "no-typescript-assertion": {
277
- meta: import("eslint").Rule.RuleMetaData;
278
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
276
+ "no-typescript-assertion": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
277
+ name: string;
279
278
  };
280
- "no-internal-graphql-when-tagged-with-gql-public": {
281
- meta: import("eslint").Rule.RuleMetaData;
282
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
279
+ "no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
280
+ name: string;
283
281
  };
284
282
  "design-guideline-button-icon-size-match": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
285
283
  name: string;
@@ -293,7 +291,9 @@ export declare const configs: {
293
291
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
294
292
  name: string;
295
293
  };
296
- "no-jest-mock-trackunit-react-core-hooks": import("eslint").Rule.RuleModule;
294
+ "no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
295
+ name: string;
296
+ };
297
297
  "prefer-destructured-imports": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
298
298
  packages: Record<string, string>;
299
299
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
@@ -28,13 +28,11 @@ export declare const localRulesPlugin: {
28
28
  "no-internal-barrel-files": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
29
29
  name: string;
30
30
  };
31
- "no-typescript-assertion": {
32
- meta: import("eslint").Rule.RuleMetaData;
33
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
31
+ "no-typescript-assertion": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
32
+ name: string;
34
33
  };
35
- "no-internal-graphql-when-tagged-with-gql-public": {
36
- meta: import("eslint").Rule.RuleMetaData;
37
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
34
+ "no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
35
+ name: string;
38
36
  };
39
37
  "design-guideline-button-icon-size-match": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
40
38
  name: string;
@@ -48,7 +46,9 @@ export declare const localRulesPlugin: {
48
46
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
49
47
  name: string;
50
48
  };
51
- "no-jest-mock-trackunit-react-core-hooks": import("eslint").Rule.RuleModule;
49
+ "no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
50
+ name: string;
51
+ };
52
52
  "prefer-destructured-imports": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
53
53
  packages: Record<string, string>;
54
54
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
@@ -10,13 +10,11 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
10
10
  "no-internal-barrel-files": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
11
11
  name: string;
12
12
  };
13
- "no-typescript-assertion": {
14
- meta: import("eslint").Rule.RuleMetaData;
15
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
13
+ "no-typescript-assertion": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
14
+ name: string;
16
15
  };
17
- "no-internal-graphql-when-tagged-with-gql-public": {
18
- meta: import("eslint").Rule.RuleMetaData;
19
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
16
+ "no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
17
+ name: string;
20
18
  };
21
19
  "design-guideline-button-icon-size-match": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
22
20
  name: string;
@@ -30,7 +28,9 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
30
28
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
31
29
  name: string;
32
30
  };
33
- "no-jest-mock-trackunit-react-core-hooks": import("eslint").Rule.RuleModule;
31
+ "no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
32
+ name: string;
33
+ };
34
34
  "prefer-destructured-imports": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
35
35
  packages: Record<string, string>;
36
36
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
@@ -175,13 +175,11 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
175
175
  "no-internal-barrel-files": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
176
176
  name: string;
177
177
  };
178
- "no-typescript-assertion": {
179
- meta: import("eslint").Rule.RuleMetaData;
180
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
178
+ "no-typescript-assertion": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
179
+ name: string;
181
180
  };
182
- "no-internal-graphql-when-tagged-with-gql-public": {
183
- meta: import("eslint").Rule.RuleMetaData;
184
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
181
+ "no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
182
+ name: string;
185
183
  };
186
184
  "design-guideline-button-icon-size-match": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
187
185
  name: string;
@@ -195,7 +193,9 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
195
193
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
196
194
  name: string;
197
195
  };
198
- "no-jest-mock-trackunit-react-core-hooks": import("eslint").Rule.RuleModule;
196
+ "no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
197
+ name: string;
198
+ };
199
199
  "prefer-destructured-imports": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
200
200
  packages: Record<string, string>;
201
201
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
@@ -9,13 +9,11 @@ export declare const reactPreset: ({
9
9
  "no-internal-barrel-files": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
10
10
  name: string;
11
11
  };
12
- "no-typescript-assertion": {
13
- meta: import("eslint").Rule.RuleMetaData;
14
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
12
+ "no-typescript-assertion": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
13
+ name: string;
15
14
  };
16
- "no-internal-graphql-when-tagged-with-gql-public": {
17
- meta: import("eslint").Rule.RuleMetaData;
18
- create: (context: import("eslint").Rule.RuleContext) => import("eslint").Rule.RuleListener;
15
+ "no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
16
+ name: string;
19
17
  };
20
18
  "design-guideline-button-icon-size-match": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
21
19
  name: string;
@@ -29,7 +27,9 @@ export declare const reactPreset: ({
29
27
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
30
28
  name: string;
31
29
  };
32
- "no-jest-mock-trackunit-react-core-hooks": import("eslint").Rule.RuleModule;
30
+ "no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
31
+ name: string;
32
+ };
33
33
  "prefer-destructured-imports": import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
34
34
  packages: Record<string, string>;
35
35
  } | undefined)?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener> & {
@@ -1,5 +1,4 @@
1
- import { Rule } from "eslint";
2
- export declare const noInternalGraphqlWhenTaggedWithGqlPublic: {
3
- meta: Rule.RuleMetaData;
4
- create: (context: Rule.RuleContext) => Rule.RuleListener;
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ export declare const noInternalGraphqlWhenTaggedWithGqlPublic: ESLintUtils.RuleModule<"internalGraphqlFileFound", [], unknown, ESLintUtils.RuleListener> & {
3
+ name: string;
5
4
  };
@@ -2,66 +2,69 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.noInternalGraphqlWhenTaggedWithGqlPublic = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const utils_1 = require("@typescript-eslint/utils");
5
6
  const fs = tslib_1.__importStar(require("fs"));
6
7
  const path = tslib_1.__importStar(require("path"));
7
- const meta = {
8
- type: "problem",
9
- docs: {
10
- description: "Disallow '-internal.graphql' files in projects tagged with 'gql:public'",
11
- },
12
- messages: {
13
- internalGraphqlFileFound: "'-internal.graphql' file found in a 'gql:public' tagged project.",
8
+ const createRule = utils_1.ESLintUtils.RuleCreator(name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`);
9
+ exports.noInternalGraphqlWhenTaggedWithGqlPublic = createRule({
10
+ name: "no-internal-graphql-when-tagged-with-gql-public",
11
+ meta: {
12
+ type: "problem",
13
+ docs: {
14
+ description: "Disallow '-internal.graphql' files in projects tagged with 'gql:public'",
15
+ },
16
+ messages: {
17
+ internalGraphqlFileFound: "'*-internal.graphql' file found in a 'gql:public' tagged project. - {{path}}",
18
+ },
19
+ schema: [],
14
20
  },
15
- schema: [],
16
- };
17
- const create = (context) => {
18
- const getLineAndColumnFromPosition = (content, position) => {
19
- const lines = content.substring(0, position).split("\n");
20
- const line = lines.length;
21
- const column = lines[lines.length - 1]?.length ?? 0;
22
- return { line, column };
23
- };
24
- const checkDirectoryForInternalGraphQLFiles = (directory, projectJson) => {
25
- const files = fs.readdirSync(directory);
26
- for (const file of files) {
27
- const fullPath = path.join(directory, file);
28
- // Handle broken symlinks or inaccessible paths gracefully
29
- let stat;
30
- try {
31
- stat = fs.statSync(fullPath);
32
- }
33
- catch {
34
- // Skip paths that can't be accessed (broken symlinks, permission issues, etc.)
35
- continue;
36
- }
37
- if (stat.isDirectory()) {
38
- checkDirectoryForInternalGraphQLFiles(fullPath, projectJson);
39
- }
40
- else if (file.endsWith("-internal.graphql")) {
41
- context.report({
42
- message: `'*-internal.graphql' file found in a 'gql:public' tagged project. - ${fullPath}`,
43
- loc: getLineAndColumnFromPosition(projectJson, projectJson.indexOf("gql:public")),
44
- });
45
- return;
46
- }
47
- }
48
- };
49
- return {
50
- Program: _node => {
51
- const sourceFilePath = context.getFilename();
52
- if (sourceFilePath.endsWith("/project.json")) {
53
- const projectJsonString = fs.readFileSync(sourceFilePath, "utf8");
54
- const projectJson = JSON.parse(projectJsonString);
55
- if (Array.isArray(projectJson.tags) && projectJson.tags.includes("gql:public")) {
56
- const projectDir = path.dirname(sourceFilePath);
57
- checkDirectoryForInternalGraphQLFiles(projectDir, projectJsonString);
21
+ defaultOptions: [],
22
+ create(context) {
23
+ const getLineAndColumnFromPosition = (content, position) => {
24
+ const lines = content.substring(0, position).split("\n");
25
+ const line = lines.length;
26
+ const column = lines[lines.length - 1]?.length ?? 0;
27
+ return { line, column };
28
+ };
29
+ const checkDirectoryForInternalGraphQLFiles = (directory, projectJson) => {
30
+ const entries = fs.readdirSync(directory, { withFileTypes: true });
31
+ for (const entry of entries) {
32
+ const fullPath = path.join(directory, entry.name);
33
+ // Handle broken symlinks or inaccessible paths gracefully
34
+ let stat;
35
+ try {
36
+ stat = fs.statSync(fullPath);
37
+ }
38
+ catch {
39
+ // Skip paths that can't be accessed (broken symlinks, permission issues, etc.)
40
+ continue;
41
+ }
42
+ if (stat.isDirectory()) {
43
+ checkDirectoryForInternalGraphQLFiles(fullPath, projectJson);
44
+ }
45
+ else if (entry.name.endsWith("-internal.graphql")) {
46
+ context.report({
47
+ messageId: "internalGraphqlFileFound",
48
+ data: { path: fullPath },
49
+ loc: getLineAndColumnFromPosition(projectJson, projectJson.indexOf("gql:public")),
50
+ });
51
+ return;
58
52
  }
59
53
  }
60
- },
61
- };
62
- };
63
- exports.noInternalGraphqlWhenTaggedWithGqlPublic = {
64
- meta,
65
- create,
66
- };
54
+ };
55
+ return {
56
+ Program: _node => {
57
+ const sourceFilePath = context.getFilename();
58
+ if (sourceFilePath.endsWith("/project.json")) {
59
+ const projectJsonString = fs.readFileSync(sourceFilePath, "utf8");
60
+ const projectJson = JSON.parse(projectJsonString);
61
+ if (Array.isArray(projectJson.tags) && projectJson.tags.includes("gql:public")) {
62
+ const projectDir = path.dirname(sourceFilePath);
63
+ checkDirectoryForInternalGraphQLFiles(projectDir, projectJsonString);
64
+ }
65
+ }
66
+ },
67
+ };
68
+ },
69
+ });
67
70
  //# sourceMappingURL=no-internal-graphql-when-tagged-with-gql-public.js.map
@@ -1,2 +1,4 @@
1
- import type { Rule } from "eslint";
2
- export declare const noJestMockTrackunitReactCoreHooks: Rule.RuleModule;
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ export declare const noJestMockTrackunitReactCoreHooks: ESLintUtils.RuleModule<"noDirectMock", [], unknown, ESLintUtils.RuleListener> & {
3
+ name: string;
4
+ };
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.noJestMockTrackunitReactCoreHooks = void 0;
4
- exports.noJestMockTrackunitReactCoreHooks = {
4
+ const utils_1 = require("@typescript-eslint/utils");
5
+ const createRule = utils_1.ESLintUtils.RuleCreator(name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`);
6
+ exports.noJestMockTrackunitReactCoreHooks = createRule({
7
+ name: "no-jest-mock-trackunit-react-core-hooks",
5
8
  meta: {
6
9
  type: "problem",
7
10
  docs: {
@@ -12,6 +15,7 @@ exports.noJestMockTrackunitReactCoreHooks = {
12
15
  },
13
16
  schema: [],
14
17
  },
18
+ defaultOptions: [],
15
19
  create(context) {
16
20
  return {
17
21
  CallExpression(node) {
@@ -30,5 +34,5 @@ exports.noJestMockTrackunitReactCoreHooks = {
30
34
  },
31
35
  };
32
36
  },
33
- };
37
+ });
34
38
  //# sourceMappingURL=no-jest-mock-trackunit-react-core-hooks.js.map
@@ -13,8 +13,9 @@
13
13
  * const foo = bar;
14
14
  * const options = ["a", "b"] as const;
15
15
  */
16
- import { Rule } from "eslint";
17
- export declare const noTypescriptAssertion: {
18
- meta: Rule.RuleMetaData;
19
- create: (context: Rule.RuleContext) => Rule.RuleListener;
16
+ import { ESLintUtils } from "@typescript-eslint/utils";
17
+ type MessageIds = "angleBracketAssertion" | "asAssertion" | "nonNullAssertion";
18
+ export declare const noTypescriptAssertion: ESLintUtils.RuleModule<MessageIds, [], unknown, ESLintUtils.RuleListener> & {
19
+ name: string;
20
20
  };
21
+ export {};
@@ -1,83 +1,68 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.noTypescriptAssertion = void 0;
4
- const meta = {
5
- type: "suggestion",
6
- docs: {
7
- description: "Prevent the use of type assertions to encourage better type safety.",
8
- },
9
- messages: {
10
- angleBracketAssertion: "Avoid using angle bracket for type casting. It bypasses type checking.",
11
- asAssertion: "Avoid using the `as` keyword for type casting. It bypasses type checking.",
12
- nonNullAssertion: "Avoid using the non-null assertion operator (!). It can lead to runtime errors.",
13
- },
14
- schema: [],
15
- };
16
4
  /**
17
- * Create ESLint rule listener.
5
+ * ESLint rule to disallow type assertions in TypeScript.
6
+ * Initial implementation based on eslint-plugin-no-type-assertion
7
+ * https://github.com/Dremora/eslint-plugin-no-type-assertion/blob/master/lib/rules/no-type-assertion.js
8
+ *
9
+ * @example
10
+ * // Bad - type assertions bypass type checking
11
+ * const foo = <string> bar;
12
+ * const baz = bar as string;
13
+ * const qux = bar!;
18
14
  *
19
- * @param {Rule.RuleContext} context - The ESLint rule context.
20
- * @returns {Rule.RuleListener} - The listener object for this rule.
15
+ * // Good - proper typing or const assertions
16
+ * const foo = bar;
17
+ * const options = ["a", "b"] as const;
21
18
  */
22
- const create = (context) => {
23
- return {
24
- /**
25
- * Handle TypeScript type assertions using angle brackets.
26
- *
27
- * @example
28
- * // Bad
29
- * const foo = <string> bar;
30
- * @param {any} node - The AST node.
31
- */
32
- TSTypeAssertion(node) {
33
- const { typeAnnotation } = node;
34
- if (typeAnnotation.type === "TSUnknownKeyword") {
35
- return;
36
- }
37
- if (typeAnnotation.type === "TSTypeReference") {
38
- const { typeName } = typeAnnotation;
39
- if (typeName.type === "Identifier" && typeName.name === "const") {
19
+ const utils_1 = require("@typescript-eslint/utils");
20
+ const createRule = utils_1.ESLintUtils.RuleCreator(name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`);
21
+ function isAllowedTypeAssertion(typeAnnotation) {
22
+ if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSUnknownKeyword) {
23
+ return true;
24
+ }
25
+ if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference) {
26
+ const { typeName } = typeAnnotation;
27
+ if (typeName.type === utils_1.AST_NODE_TYPES.Identifier && typeName.name === "const") {
28
+ return true;
29
+ }
30
+ }
31
+ return false;
32
+ }
33
+ exports.noTypescriptAssertion = createRule({
34
+ name: "no-typescript-assertion",
35
+ meta: {
36
+ type: "suggestion",
37
+ docs: {
38
+ description: "Prevent the use of type assertions to encourage better type safety.",
39
+ },
40
+ messages: {
41
+ angleBracketAssertion: "Avoid using angle bracket for type casting. It bypasses type checking.",
42
+ asAssertion: "Avoid using the `as` keyword for type casting. It bypasses type checking.",
43
+ nonNullAssertion: "Avoid using the non-null assertion operator (!). It can lead to runtime errors.",
44
+ },
45
+ schema: [],
46
+ },
47
+ defaultOptions: [],
48
+ create(context) {
49
+ return {
50
+ TSTypeAssertion(node) {
51
+ if (isAllowedTypeAssertion(node.typeAnnotation)) {
40
52
  return;
41
53
  }
42
- }
43
- context.report({ node, messageId: "angleBracketAssertion" });
44
- },
45
- /**
46
- * Handle TypeScript 'as' expressions for type assertions.
47
- *
48
- * @example
49
- * // Bad
50
- * const baz = bar as string;
51
- * @param {any} node - The AST node.
52
- */
53
- TSAsExpression(node) {
54
- const { typeAnnotation } = node;
55
- if (typeAnnotation.type === "TSUnknownKeyword") {
56
- return;
57
- }
58
- if (typeAnnotation.type === "TSTypeReference") {
59
- const { typeName } = typeAnnotation;
60
- if (typeName.type === "Identifier" && typeName.name === "const") {
54
+ context.report({ node, messageId: "angleBracketAssertion" });
55
+ },
56
+ TSAsExpression(node) {
57
+ if (isAllowedTypeAssertion(node.typeAnnotation)) {
61
58
  return;
62
59
  }
63
- }
64
- context.report({ node, messageId: "asAssertion" });
65
- },
66
- /**
67
- * Handle TypeScript non-null expressions using the postfix expression '!'.
68
- *
69
- * @example
70
- * // Bad
71
- * const qux = bar!;
72
- * @param {any} node - The AST node.
73
- */
74
- TSNonNullExpression(node) {
75
- context.report({ node, messageId: "nonNullAssertion" });
76
- },
77
- };
78
- };
79
- exports.noTypescriptAssertion = {
80
- meta,
81
- create,
82
- };
60
+ context.report({ node, messageId: "asAssertion" });
61
+ },
62
+ TSNonNullExpression(node) {
63
+ context.report({ node, messageId: "nonNullAssertion" });
64
+ },
65
+ };
66
+ },
67
+ });
83
68
  //# sourceMappingURL=no-typescript-assertion.js.map
@@ -151,7 +151,7 @@ exports.requireListItemVirtualizationProps = createRule({
151
151
  ],
152
152
  messages: {
153
153
  requireVirtualizationProps: "List item '{{elementName}}' must include VirtualizationListItemProps. " +
154
- "Spread {{...listItemProps}} or manually specify className, data-index, tabIndex, ref props.",
154
+ "Spread {...listItemProps} or manually specify className, data-index, tabIndex, ref props.",
155
155
  spreadListItemProps: "Spread {...listItemProps} on this element",
156
156
  useSemanticListItem: "Use semantic <li> elements for list items instead of '{{elementName}}'. " +
157
157
  "List items should be <li> elements with proper VirtualizationListItemProps.",
@@ -1,5 +1,4 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
- import type { Rule } from "eslint";
3
2
  export declare const rulesMap: {
4
3
  "cva-merge-base-classes-as-array": ESLintUtils.RuleModule<"stringNeedsArray" | "arrayNeedsSplit", [], unknown, ESLintUtils.RuleListener> & {
5
4
  name: string;
@@ -7,13 +6,11 @@ export declare const rulesMap: {
7
6
  "no-internal-barrel-files": ESLintUtils.RuleModule<"noInternalBarrel", [], unknown, ESLintUtils.RuleListener> & {
8
7
  name: string;
9
8
  };
10
- "no-typescript-assertion": {
11
- meta: Rule.RuleMetaData;
12
- create: (context: Rule.RuleContext) => Rule.RuleListener;
9
+ "no-typescript-assertion": ESLintUtils.RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, ESLintUtils.RuleListener> & {
10
+ name: string;
13
11
  };
14
- "no-internal-graphql-when-tagged-with-gql-public": {
15
- meta: Rule.RuleMetaData;
16
- create: (context: Rule.RuleContext) => Rule.RuleListener;
12
+ "no-internal-graphql-when-tagged-with-gql-public": ESLintUtils.RuleModule<"internalGraphqlFileFound", [], unknown, ESLintUtils.RuleListener> & {
13
+ name: string;
17
14
  };
18
15
  "design-guideline-button-icon-size-match": ESLintUtils.RuleModule<"incorrectIconSize", [], unknown, ESLintUtils.RuleListener> & {
19
16
  name: string;
@@ -27,7 +24,9 @@ export declare const rulesMap: {
27
24
  } | undefined)?], unknown, ESLintUtils.RuleListener> & {
28
25
  name: string;
29
26
  };
30
- "no-jest-mock-trackunit-react-core-hooks": Rule.RuleModule;
27
+ "no-jest-mock-trackunit-react-core-hooks": ESLintUtils.RuleModule<"noDirectMock", [], unknown, ESLintUtils.RuleListener> & {
28
+ name: string;
29
+ };
31
30
  "prefer-destructured-imports": ESLintUtils.RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
32
31
  packages: Record<string, string>;
33
32
  } | undefined)?], unknown, ESLintUtils.RuleListener> & {
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/eslint/plugin-trackunit/src/index.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,kBAAe,oBAAQ,CAAC;AAExB,uCAAuC;AAA9B,iGAAA,OAAO,OAAA;AAChB,0EAAuE;AAA9D,kHAAA,cAAc,OAAA;AACvB,4CAAsD;AAA7C,yGAAA,gBAAgB,OAAA;AAGzB,kEAAsE;AAA7D,+GAAA,gBAAgB,OAAA;AACzB,gDAAgF;AAAvE,kGAAA,OAAO,OAAA;AAAE,gGAAA,KAAK,OAAA;AAAE,6FAAA,EAAE,OAAA;AAAE,qGAAA,UAAU,OAAA;AAAE,mGAAA,QAAQ,OAAA","sourcesContent":["import { rulesMap } from \"./lib/rules-map\";\n\nexport default rulesMap;\n\nexport { configs } from \"./lib/config\";\nexport { createSkipWhen } from \"./lib/config-helpers/create-skip-when\";\nexport { findMonorepoRoot } from \"./lib/config/utils\";\nexport type { MatchCriteria, ProjectMetadata } from \"./lib/utils/nx-utils\";\n\nexport { strictJsdocRules } from \"./lib/config/fragments/jsdoc-rules\";\nexport { globals, jsdoc, nx, reactHooks, tsParser } from \"./lib/config/plugins\";\n"]}