@trackunit/eslint-plugin-trackunit 0.6.53 β†’ 0.6.55

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 (59) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -1
  3. package/migrations/entry.js +3 -0
  4. package/migrations.json +3 -0
  5. package/package.json +2 -1
  6. package/src/lib/config/index.d.ts +4 -0
  7. package/src/lib/config/presets/react.d.ts +4 -0
  8. package/src/lib/config/presets/react.js +3 -0
  9. package/src/index.js.map +0 -1
  10. package/src/lib/config/fragments/ignores.js.map +0 -1
  11. package/src/lib/config/fragments/import-rules.js.map +0 -1
  12. package/src/lib/config/fragments/jest-overrides.js.map +0 -1
  13. package/src/lib/config/fragments/jsdoc-rules.js.map +0 -1
  14. package/src/lib/config/fragments/module-boundaries.js.map +0 -1
  15. package/src/lib/config/fragments/no-direct-storage-access.js.map +0 -1
  16. package/src/lib/config/fragments/react-rules.js.map +0 -1
  17. package/src/lib/config/fragments/restricted-imports.js.map +0 -1
  18. package/src/lib/config/fragments/testing-library.js.map +0 -1
  19. package/src/lib/config/fragments/typescript-rules.js.map +0 -1
  20. package/src/lib/config/index.js.map +0 -1
  21. package/src/lib/config/plugins.js.map +0 -1
  22. package/src/lib/config/presets/base.js.map +0 -1
  23. package/src/lib/config/presets/e2e.js.map +0 -1
  24. package/src/lib/config/presets/react.js.map +0 -1
  25. package/src/lib/config/presets/server.js.map +0 -1
  26. package/src/lib/config/utils.js.map +0 -1
  27. package/src/lib/config-helpers/create-skip-when.js.map +0 -1
  28. package/src/lib/rules/component-name-matches-filename/component-name-matches-filename.js.map +0 -1
  29. package/src/lib/rules/cva-merge-base-classes-as-array/cva-merge-base-classes-as-array.js.map +0 -1
  30. package/src/lib/rules/design-guideline-button-icon-size-match/design-guideline-button-icon-size-match.js.map +0 -1
  31. package/src/lib/rules/no-internal-barrel-files/no-internal-barrel-files.js.map +0 -1
  32. package/src/lib/rules/no-internal-graphql-when-tagged-with-gql-public/no-internal-graphql-when-tagged-with-gql-public.js.map +0 -1
  33. package/src/lib/rules/no-jest-mock-trackunit-react-core-hooks/no-jest-mock-trackunit-react-core-hooks.js.map +0 -1
  34. package/src/lib/rules/no-template-strings-in-classname-prop/no-template-strings-in-classname-prop.js.map +0 -1
  35. package/src/lib/rules/no-typescript-assertion/no-typescript-assertion.js.map +0 -1
  36. package/src/lib/rules/one-component-per-file/one-component-per-file.js.map +0 -1
  37. package/src/lib/rules/prefer-destructured-imports/prefer-destructured-imports.js.map +0 -1
  38. package/src/lib/rules/prefer-event-specific-callback-naming/name-suggestion-strategies.js.map +0 -1
  39. package/src/lib/rules/prefer-event-specific-callback-naming/prefer-event-specific-callback-naming.js.map +0 -1
  40. package/src/lib/rules/prefer-event-specific-callback-naming/strategies/string-based.js.map +0 -1
  41. package/src/lib/rules/prefer-event-specific-callback-naming/strategies/type-based.js.map +0 -1
  42. package/src/lib/rules/prefer-event-specific-callback-naming/utils.js.map +0 -1
  43. package/src/lib/rules/prefer-field-components/prefer-field-components.js.map +0 -1
  44. package/src/lib/rules/prefer-mouse-event-handler-in-react-props/prefer-mouse-event-handler-in-react-props.js.map +0 -1
  45. package/src/lib/rules/require-classname-alternatives/require-classname-alternatives.js.map +0 -1
  46. package/src/lib/rules/require-component-prop-contracts/require-component-prop-contracts.js.map +0 -1
  47. package/src/lib/rules/require-list-item-virtualization-props/require-list-item-virtualization-props.js.map +0 -1
  48. package/src/lib/rules/require-optional-prop-initialization/require-optional-prop-initialization.js.map +0 -1
  49. package/src/lib/rules/require-optional-prop-initialization/suggestion-utils.js.map +0 -1
  50. package/src/lib/rules/require-storybook-folder-landing-page/require-storybook-folder-landing-page.js.map +0 -1
  51. package/src/lib/rules-map.js.map +0 -1
  52. package/src/lib/utils/ast-utils.js.map +0 -1
  53. package/src/lib/utils/classname-utils.js.map +0 -1
  54. package/src/lib/utils/component-utils.js.map +0 -1
  55. package/src/lib/utils/file-utils.js.map +0 -1
  56. package/src/lib/utils/import-utils.js.map +0 -1
  57. package/src/lib/utils/nx-utils.js.map +0 -1
  58. package/src/lib/utils/package-utils.js.map +0 -1
  59. package/src/lib/utils/typescript-utils.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## 0.6.55 (2026-07-02)
2
+
3
+ ### πŸš€ Features
4
+
5
+ - **migrations:** standard migration scaffold for all publish:npm packages [GLU-1354] ([#24119](https://github.com/Trackunit/manager/pull/24119))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated shared-utils to 1.15.55
10
+
11
+ ### ❀️ Thank You
12
+
13
+ - Cursor @cursoragent
14
+ - Mikkel ThorbjΓΈrn Andersen @mta-trackunit
15
+
16
+ ## 0.6.54 (2026-07-02)
17
+
18
+ ### 🧱 Updated Dependencies
19
+
20
+ - Updated shared-utils to 1.15.54
21
+
1
22
  ## 0.6.53 (2026-07-02)
2
23
 
3
24
  ### 🧱 Updated Dependencies
package/README.md CHANGED
@@ -87,7 +87,7 @@ All custom rules are enabled automatically through the presets under the `@track
87
87
 
88
88
  | Rule | Severity | Auto-fix | Description |
89
89
  | ----------------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
90
- | `@trackunit/require-storybook-folder-landing-page` | β€” | no | Requires a `*.docs.mdx` landing page (`<Meta title>`) for every ancestor folder implied by a story's title. Report-only; not yet enabled in a preset. |
90
+ | `@trackunit/require-storybook-folder-landing-page` | error | no | Requires a `*.docs.mdx` landing page (`<Meta title>`) for every ancestor folder implied by a story's title. Enabled for `*.stories.{ts,tsx}` files in the `react` preset. |
91
91
 
92
92
  ## Utilities
93
93
 
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1,3 @@
1
+ {
2
+ "generators": {}
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/eslint-plugin-trackunit",
3
- "version": "0.6.53",
3
+ "version": "0.6.55",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -28,6 +28,7 @@
28
28
  "@typescript-eslint/parser": "^8.58.1",
29
29
  "eslint": "^9.33.0"
30
30
  },
31
+ "migrations": "./migrations.json",
31
32
  "types": "./src/index.d.ts",
32
33
  "main": "./src/index.js",
33
34
  "type": "commonjs"
@@ -841,6 +841,7 @@ export declare const configs: {
841
841
  "@typescript-eslint/no-empty-function"?: undefined;
842
842
  "@trackunit/one-component-per-file"?: undefined;
843
843
  "@trackunit/component-name-matches-filename"?: undefined;
844
+ "@trackunit/require-storybook-folder-landing-page"?: undefined;
844
845
  };
845
846
  plugins?: undefined;
846
847
  settings?: undefined;
@@ -853,6 +854,7 @@ export declare const configs: {
853
854
  "@typescript-eslint/no-empty-function": string;
854
855
  "@trackunit/one-component-per-file": string;
855
856
  "@trackunit/component-name-matches-filename": string;
857
+ "@trackunit/require-storybook-folder-landing-page": string;
856
858
  "no-restricted-properties"?: undefined;
857
859
  };
858
860
  plugins?: undefined;
@@ -867,6 +869,7 @@ export declare const configs: {
867
869
  "jsdoc/require-jsdoc"?: undefined;
868
870
  "no-console"?: undefined;
869
871
  "@typescript-eslint/no-empty-function"?: undefined;
872
+ "@trackunit/require-storybook-folder-landing-page"?: undefined;
870
873
  };
871
874
  plugins?: undefined;
872
875
  settings?: undefined;
@@ -944,6 +947,7 @@ export declare const configs: {
944
947
  "@typescript-eslint/no-empty-function"?: undefined;
945
948
  "@trackunit/one-component-per-file"?: undefined;
946
949
  "@trackunit/component-name-matches-filename"?: undefined;
950
+ "@trackunit/require-storybook-folder-landing-page"?: undefined;
947
951
  "no-restricted-properties"?: undefined;
948
952
  };
949
953
  settings?: undefined;
@@ -530,6 +530,7 @@ export declare const reactPreset: (import("eslint").Linter.Config<import("eslint
530
530
  "@typescript-eslint/no-empty-function"?: undefined;
531
531
  "@trackunit/one-component-per-file"?: undefined;
532
532
  "@trackunit/component-name-matches-filename"?: undefined;
533
+ "@trackunit/require-storybook-folder-landing-page"?: undefined;
533
534
  };
534
535
  plugins?: undefined;
535
536
  settings?: undefined;
@@ -542,6 +543,7 @@ export declare const reactPreset: (import("eslint").Linter.Config<import("eslint
542
543
  "@typescript-eslint/no-empty-function": string;
543
544
  "@trackunit/one-component-per-file": string;
544
545
  "@trackunit/component-name-matches-filename": string;
546
+ "@trackunit/require-storybook-folder-landing-page": string;
545
547
  "no-restricted-properties"?: undefined;
546
548
  };
547
549
  plugins?: undefined;
@@ -556,6 +558,7 @@ export declare const reactPreset: (import("eslint").Linter.Config<import("eslint
556
558
  "jsdoc/require-jsdoc"?: undefined;
557
559
  "no-console"?: undefined;
558
560
  "@typescript-eslint/no-empty-function"?: undefined;
561
+ "@trackunit/require-storybook-folder-landing-page"?: undefined;
559
562
  };
560
563
  plugins?: undefined;
561
564
  settings?: undefined;
@@ -633,6 +636,7 @@ export declare const reactPreset: (import("eslint").Linter.Config<import("eslint
633
636
  "@typescript-eslint/no-empty-function"?: undefined;
634
637
  "@trackunit/one-component-per-file"?: undefined;
635
638
  "@trackunit/component-name-matches-filename"?: undefined;
639
+ "@trackunit/require-storybook-folder-landing-page"?: undefined;
636
640
  "no-restricted-properties"?: undefined;
637
641
  };
638
642
  settings?: undefined;
@@ -71,6 +71,9 @@ exports.reactPreset = [
71
71
  "@typescript-eslint/no-empty-function": "off",
72
72
  "@trackunit/one-component-per-file": "off",
73
73
  "@trackunit/component-name-matches-filename": "off",
74
+ // Every Storybook folder implied by a story title must have a landing page
75
+ // (*.docs.mdx with a matching <Meta title>). See docs/STORYBOOK-LANDING-PAGES.md.
76
+ "@trackunit/require-storybook-folder-landing-page": "error",
74
77
  },
75
78
  },
76
79
  {
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,gFAAkF;AAAzE,2HAAA,qBAAqB,OAAA;AAC9B,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 { restrictedImportRules } from \"./lib/config/fragments/restricted-imports\";\nexport { globals, jsdoc, nx, reactHooks, tsParser } from \"./lib/config/plugins\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ignores.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/ignores.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAkB;IAC1C,OAAO,EAAE;QACP,oBAAoB;QACpB,qBAAqB;QACrB,kBAAkB;QAClB,sBAAsB;QACtB,kBAAkB;QAClB,iBAAiB;QACjB,mBAAmB;QACnB,kBAAkB;QAClB,4BAA4B;QAC5B,uBAAuB;QACvB,cAAc;QACd,eAAe;KAChB;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n\nexport const globalIgnores: Linter.Config = {\n ignores: [\n \"**/src/gql-api.tsx\",\n \"**/src/typings/**/*\",\n \"**/testUtils.tsx\",\n \"**/webpack.config.js\",\n \"**/jest.config.*\",\n \"**/jest.setup.*\",\n \"**/vite*.config.*\",\n \"**/vite*.setup.*\",\n \"**/src/**/generated/**/*.*\",\n \"**/src/**/generated.*\",\n \"**/dist/**/*\",\n \"**/*.docs.mdx\",\n ],\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"import-rules.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/import-rules.ts"],"names":[],"mappings":";;;AACA,4EAAuE;AACvE,wCAA0C;AAE7B,QAAA,WAAW,GAAuB;IAC7C,mBAAmB,EAAE;QACnB,OAAO;QACP;YACE,cAAc,EAAE,IAAI;SACrB;KACF;IACD,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEK,MAAM,wCAAwC,GAAG,CAAC,OAAe,EAAiB,EAAE,CACzF,IAAA,iCAAc,EAAC;IACb,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE;IAC9B,OAAO,EAAE;QACP,UAAU,EAAE,sBAAY;KACzB;IACD,KAAK,EAAE;QACL,qCAAqC,EAAE;YACrC,OAAO;YACP;gBACE,UAAU,EAAE,OAAO;gBACnB,eAAe,EAAE;oBACf,oBAAoB;oBACpB,oBAAoB;oBACpB,iBAAiB;oBACjB,iBAAiB;oBACjB,mBAAmB;oBACnB,YAAY;oBACZ,aAAa;oBACb,eAAe;oBACf,kBAAkB;oBAClB,kBAAkB;oBAClB,iBAAiB;oBACjB,iBAAiB;oBACjB,mBAAmB;oBACnB,0BAA0B;oBAC1B,uBAAuB;oBACvB,4BAA4B;oBAC5B,kBAAkB;oBAClB,eAAe;oBACf,aAAa;oBACb,6BAA6B;oBAC7B,oBAAoB;oBACpB,6CAA6C;oBAC7C,4BAA4B;iBAC7B;gBACD,oBAAoB,EAAE,KAAK;gBAC3B,gBAAgB,EAAE,IAAI;gBACtB,mBAAmB,EAAE,IAAI;aAC1B;SACF;KACF;CACF,CAAC,CAAC;AA1CQ,QAAA,wCAAwC,4CA0ChD","sourcesContent":["import type { Linter } from \"eslint\";\nimport { createSkipWhen } from \"../../config-helpers/create-skip-when\";\nimport { importPlugin } from \"../plugins\";\n\nexport const importRules: Linter.RulesRecord = {\n \"import-x/no-cycle\": [\n \"error\",\n {\n ignoreExternal: true,\n },\n ],\n \"import-x/first\": \"off\",\n};\n\nexport const createImportExtraneousDependenciesConfig = (rootDir: string): Linter.Config =>\n createSkipWhen({\n when: { tags: [\"scope:tool\"] },\n plugins: {\n \"import-x\": importPlugin,\n },\n rules: {\n \"import-x/no-extraneous-dependencies\": [\n \"error\",\n {\n packageDir: rootDir,\n devDependencies: [\n \"**/*.spec.{ts,tsx}\",\n \"**/*.test.{ts,tsx}\",\n \"**/jest.setup.*\",\n \"**/vite.setup.*\",\n \"**/vite.config.ts\",\n \"**/test/**\",\n \"**/tests/**\",\n \"**/testing/**\",\n \"**/test-setup/**\",\n \"**/test-utils/**\",\n \"**/__tests__/**\",\n \"**/__mocks__/**\",\n \"**/mocks.{ts,tsx}\",\n \"**/core-contexts-test/**\",\n \"**/*.stories.{ts,tsx}\",\n \"**/storybookUtils.{ts,tsx}\",\n \"**/.storybook/**\",\n \"**/scripts/**\",\n \"**/tools/**\",\n \"**/*.config.{ts,js,cjs,mjs}\",\n \"**/css/tailwind/**\",\n \"**/css/tailwind-custom-properties-plugin/**\",\n \"**/css/component-tokens/**\",\n ],\n optionalDependencies: false,\n peerDependencies: true,\n bundledDependencies: true,\n },\n ],\n },\n });\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jest-overrides.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/jest-overrides.ts"],"names":[],"mappings":";;;AACA,wCAAkD;AAErC,QAAA,iBAAiB,GAAkB;IAC9C,KAAK,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC;IACxC,eAAe,EAAE;QACf,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE;YACb,OAAO,EAAE,CAAC,oBAAoB,CAAC;SAChC;KACF;IAED,OAAO,EAAE;QACP,IAAI,EAAJ,cAAI;QACJ,iBAAiB,EAAE,wBAAc;KAClC;IAED,KAAK,EAAE;QACL,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;QACjC,GAAG,cAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;QAC3B,oCAAoC,EAAE,KAAK;QAC3C,sCAAsC,EAAE,KAAK;QAC7C,0CAA0C,EAAE,KAAK;QACjD,oCAAoC,EAAE,KAAK;QAC3C,oDAAoD,EAAE,OAAO;QAC7D,YAAY,EAAE,KAAK;QACnB,uBAAuB,EAAE,KAAK;QAC9B,0BAA0B,EAAE,KAAK;QACjC,+CAA+C,EAAE,KAAK;KACvD;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\nimport { jest, testingLibrary } from \"../plugins\";\n\nexport const baseJestOverrides: Linter.Config = {\n files: [\"**/*.spec.ts\", \"**/*.spec.tsx\"],\n languageOptions: {\n ecmaVersion: 5,\n sourceType: \"script\",\n parserOptions: {\n project: [\"./tsconfig.*?.json\"],\n },\n },\n\n plugins: {\n jest,\n \"testing-library\": testingLibrary,\n },\n\n rules: {\n ...jest.configs.recommended.rules,\n ...jest.configs.style.rules,\n \"@typescript-eslint/no-explicit-any\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@trackunit/no-typescript-assertion\": \"off\",\n \"@trackunit/no-jest-mock-trackunit-react-core-hooks\": \"error\",\n \"no-console\": \"off\",\n \"no-restricted-globals\": \"off\",\n \"no-restricted-properties\": \"off\",\n \"@typescript-eslint/strict-boolean-expressions\": \"off\",\n },\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsdoc-rules.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/jsdoc-rules.ts"],"names":[],"mappings":";;;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AE,OAAO;IAC5C,sBAAsB,EAAE,OAAO;IAC/B,4BAA4B,EAAE,OAAO;CACtC,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n\nexport const basicJsdocRules: Linter.RulesRecord = {\n \"jsdoc/tag-lines\": [\n \"error\",\n \"never\",\n {\n startLines: 1,\n },\n ],\n \"jsdoc/check-alignment\": \"error\",\n \"prefer-arrow-functions\": \"off\",\n \"jsdoc/check-indentation\": \"off\",\n \"jsdoc/no-restricted-syntax\": [\n \"error\",\n {\n contexts: [\n {\n comment: \"JsdocBlock:has(JsdocTag[tag=/type/])\",\n context: \"any\",\n message: \"Projects should not use @type annotation in JSDocs.\",\n },\n ],\n },\n ],\n};\n\nexport const strictJsdocRules: Linter.RulesRecord = {\n \"jsdoc/require-jsdoc\": [\n \"error\",\n {\n publicOnly: true,\n\n require: {\n ArrowFunctionExpression: true,\n ClassDeclaration: true,\n FunctionDeclaration: true,\n FunctionExpression: true,\n MethodDefinition: true,\n },\n },\n ],\n\n \"jsdoc/no-undefined-types\": [\n \"error\",\n {\n definedTypes: [\"JSX\"],\n },\n ],\n\n \"jsdoc/check-param-names\": \"error\",\n \"jsdoc/require-returns-type\": \"error\",\n \"jsdoc/valid-types\": \"error\",\n \"jsdoc/require-param-description\": \"error\",\n \"jsdoc/check-access\": \"error\",\n \"jsdoc/check-property-names\": \"error\",\n \"jsdoc/check-tag-names\": \"error\",\n \"jsdoc/check-types\": \"error\",\n \"jsdoc/check-values\": \"error\",\n \"jsdoc/check-alignment\": \"error\",\n \"jsdoc/empty-tags\": \"error\",\n \"jsdoc/implements-on-classes\": \"error\",\n \"jsdoc/multiline-blocks\": \"error\",\n \"jsdoc/no-multi-asterisks\": \"error\",\n \"jsdoc/require-property\": \"error\",\n \"jsdoc/require-property-description\": \"error\",\n \"jsdoc/require-property-name\": \"error\",\n \"jsdoc/require-property-type\": \"error\",\n \"jsdoc/require-returns-check\": \"error\",\n \"jsdoc/require-returns-description\": \"error\",\n \"jsdoc/require-yields\": \"error\",\n \"jsdoc/require-yields-check\": \"error\",\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"module-boundaries.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/module-boundaries.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAuB;IACrD,+BAA+B,EAAE;QAC/B,OAAO;QACP;YACE,KAAK,EAAE,EAAE;YAET,cAAc,EAAE;gBACd;oBACE,SAAS,EAAE,UAAU;oBACrB,wBAAwB,EAAE,CAAC,gBAAgB,EAAE,YAAY,EAAE,cAAc,CAAC;oBAC1E,qBAAqB,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;iBACpD;gBACD;oBACE,SAAS,EAAE,gBAAgB;oBAC3B,wBAAwB,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;oBACxD,qBAAqB,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;iBACpD;gBACD;oBACE,SAAS,EAAE,YAAY;oBACvB,wBAAwB,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;oBACxD,qBAAqB,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;iBACpD;gBACD;oBACE,SAAS,EAAE,cAAc;oBACzB,wBAAwB,EAAE,CAAC,cAAc,CAAC;oBAC1C,qBAAqB,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;iBAC7C;gBACD;oBACE,SAAS,EAAE,WAAW;oBACtB,wBAAwB,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC;iBAC3D;gBACD;oBACE,SAAS,EAAE,cAAc;oBACzB,wBAAwB,EAAE,CAAC,cAAc,CAAC;iBAC3C;gBACD;oBACE,SAAS,EAAE,YAAY;oBACvB,wBAAwB,EAAE,CAAC,YAAY,CAAC;iBACzC;gBACD;oBACE,SAAS,EAAE,cAAc;oBACzB,wBAAwB,EAAE,CAAC,cAAc,CAAC;iBAC3C;gBACD;oBACE,SAAS,EAAE,iBAAiB;oBAC5B,wBAAwB,EAAE,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;iBACnE;gBACD;oBACE,SAAS,EAAE,qBAAqB;oBAChC,wBAAwB,EAAE,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;iBACvE;gBACD;oBACE,SAAS,EAAE,mBAAmB;oBAC9B,wBAAwB,EAAE,CAAC,mBAAmB,CAAC;iBAChD;gBACD;oBACE,SAAS,EAAE,4BAA4B;oBACvC,uBAAuB,EAAE,CAAC,YAAY,CAAC;iBACxC;gBACD;oBACE,SAAS,EAAE,cAAc;iBAC1B;gBACD;oBACE,SAAS,EAAE,YAAY;iBACxB;gBACD;oBACE,SAAS,EAAE,OAAO;iBACnB;gBACD;oBACE,SAAS,EAAE,OAAO;iBACnB;gBACD;oBACE,SAAS,EAAE,OAAO;iBACnB;gBACD;oBACE,SAAS,EAAE,OAAO;iBACnB;gBACD;oBACE,SAAS,EAAE,aAAa;oBACxB,wBAAwB,EAAE,CAAC,aAAa,CAAC;oBACzC,qBAAqB,EAAE,CAAC,WAAW,CAAC;oBACpC,uBAAuB,EAAE,CAAC,YAAY,CAAC;iBACxC;aACF;YAED,6BAA6B,EAAE,IAAI;YACnC,yBAAyB,EAAE,IAAI;SAChC;KACF;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n\nexport const moduleBoundaryRules: Linter.RulesRecord = {\n \"@nx/enforce-module-boundaries\": [\n \"error\",\n {\n allow: [],\n\n depConstraints: [\n {\n sourceTag: \"type:app\",\n onlyDependOnLibsWithTags: [\"type:extension\", \"type:react\", \"type:vanilla\"],\n bannedExternalImports: [\"i18next\", \"react-i18next\"],\n },\n {\n sourceTag: \"type:extension\",\n onlyDependOnLibsWithTags: [\"type:react\", \"type:vanilla\"],\n bannedExternalImports: [\"i18next\", \"react-i18next\"],\n },\n {\n sourceTag: \"type:react\",\n onlyDependOnLibsWithTags: [\"type:react\", \"type:vanilla\"],\n bannedExternalImports: [\"i18next\", \"react-i18next\"],\n },\n {\n sourceTag: \"type:vanilla\",\n onlyDependOnLibsWithTags: [\"type:vanilla\"],\n bannedExternalImports: [\"i18next\", \"react*\"],\n },\n {\n sourceTag: \"scope:app\",\n onlyDependOnLibsWithTags: [\"scope:client\", \"scope:server\"],\n },\n {\n sourceTag: \"scope:client\",\n onlyDependOnLibsWithTags: [\"scope:client\"],\n },\n {\n sourceTag: \"scope:tool\",\n onlyDependOnLibsWithTags: [\"scope:tool\"],\n },\n {\n sourceTag: \"scope:server\",\n onlyDependOnLibsWithTags: [\"scope:server\"],\n },\n {\n sourceTag: \"visibility:host\",\n onlyDependOnLibsWithTags: [\"visibility:host\", \"visibility:shared\"],\n },\n {\n sourceTag: \"visibility:iris-app\",\n onlyDependOnLibsWithTags: [\"visibility:iris-app\", \"visibility:shared\"],\n },\n {\n sourceTag: \"visibility:shared\",\n onlyDependOnLibsWithTags: [\"visibility:shared\"],\n },\n {\n sourceTag: \"dependencies:no-deprecated\",\n notDependOnLibsWithTags: [\"deprecated\"],\n },\n {\n sourceTag: \"gql:internal\",\n },\n {\n sourceTag: \"gql:public\",\n },\n {\n sourceTag: \"tier1\",\n },\n {\n sourceTag: \"tier2\",\n },\n {\n sourceTag: \"tier3\",\n },\n {\n sourceTag: \"tier4\",\n },\n {\n sourceTag: \"publish:npm\",\n onlyDependOnLibsWithTags: [\"publish:npm\"],\n bannedExternalImports: [\"@sentry/*\"],\n notDependOnLibsWithTags: [\"deprecated\"],\n },\n ],\n\n enforceBuildableLibDependency: true,\n banTransitiveDependencies: true,\n },\n ],\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-direct-storage-access.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/no-direct-storage-access.ts"],"names":[],"mappings":";;;AACA,oCAA4C;AAE5C,MAAM,mBAAmB,GACvB,uHAAuH,CAAC;AAC1H,MAAM,qBAAqB,GACzB,6HAA6H,CAAC;AAEnH,QAAA,0BAA0B,GAAqB;IAC1D,OAAO;IACP;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,mBAAmB;KAC7B;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,qBAAqB;KAC/B;CACF,CAAC;AAEW,QAAA,6BAA6B,GAAqB;IAC7D,OAAO;IACP;QACE,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,cAAc;QACxB,OAAO,EAAE,mBAAmB;KAC7B;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,gBAAgB;QAC1B,OAAO,EAAE,qBAAqB;KAC/B;IACD;QACE,MAAM,EAAE,YAAY;QACpB,QAAQ,EAAE,cAAc;QACxB,OAAO,EAAE,mBAAmB;KAC7B;IACD;QACE,MAAM,EAAE,YAAY;QACpB,QAAQ,EAAE,gBAAgB;QAC1B,OAAO,EAAE,qBAAqB;KAC/B;CACF,CAAC;AAEF,MAAM,8BAA8B,GAAG;IACrC,iEAAiE;IACjE,wEAAwE;IACxE,mEAAmE;IACnE,0EAA0E;CAC3E,CAAC;AAEW,QAAA,yCAAyC,GAAkB;IACtE,QAAQ,EAAE,IAAA,wBAAgB,GAAE;IAC5B,KAAK,EAAE,8BAA8B;IACrC,KAAK,EAAE;QACL,0BAA0B,EAAE,KAAK;KAClC;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\nimport { findMonorepoRoot } from \"../utils\";\n\nconst localStorageMessage =\n \"Use useLocalStorage or useLocalStorageReducer from @trackunit/react-components instead of direct localStorage access.\";\nconst sessionStorageMessage =\n \"Use useSessionStorage or useSessionStorageReducer from @trackunit/react-components instead of direct sessionStorage access.\";\n\nexport const noDirectStorageGlobalsRule: Linter.RuleEntry = [\n \"error\",\n {\n name: \"localStorage\",\n message: localStorageMessage,\n },\n {\n name: \"sessionStorage\",\n message: sessionStorageMessage,\n },\n];\n\nexport const noDirectStoragePropertiesRule: Linter.RuleEntry = [\n \"error\",\n {\n object: \"window\",\n property: \"localStorage\",\n message: localStorageMessage,\n },\n {\n object: \"window\",\n property: \"sessionStorage\",\n message: sessionStorageMessage,\n },\n {\n object: \"globalThis\",\n property: \"localStorage\",\n message: localStorageMessage,\n },\n {\n object: \"globalThis\",\n property: \"sessionStorage\",\n message: sessionStorageMessage,\n },\n];\n\nconst storageHookImplementationFiles = [\n \"libs/react/components/src/hooks/localStorage/useLocalStorage.ts\",\n \"libs/react/components/src/hooks/localStorage/useLocalStorageReducer.ts\",\n \"libs/react/components/src/hooks/localStorage/useSessionStorage.ts\",\n \"libs/react/components/src/hooks/localStorage/useSessionStorageReducer.ts\",\n];\n\nexport const noDirectStoragePropertyExceptionOverrides: Linter.Config = {\n basePath: findMonorepoRoot(),\n files: storageHookImplementationFiles,\n rules: {\n \"no-restricted-properties\": \"off\",\n },\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-rules.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/react-rules.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAuB;IAC5C,4BAA4B,EAAE,OAAO;IACrC,6BAA6B,EAAE,OAAO;IAEtC,oBAAoB,EAAE,OAAO;IAC7B,8BAA8B,EAAE,OAAO;IACvC,sCAAsC,EAAE,OAAO;IAC/C,oBAAoB,EAAE,OAAO;IAC7B,qBAAqB,EAAE,OAAO;IAC9B,iCAAiC,EAAE,OAAO;IAC1C,sBAAsB,EAAE,OAAO;IAC/B,yBAAyB,EAAE,OAAO;IAClC,gCAAgC,EAAE,OAAO;IACzC,+BAA+B,EAAE,OAAO;IACxC,oBAAoB,EAAE,OAAO;IAE7B,0BAA0B,EAAE,MAAM;IAClC,qCAAqC,EAAE,MAAM;IAC7C,kBAAkB,EAAE,MAAM;IAC1B,iCAAiC,EAAE,MAAM;IACzC,yCAAyC,EAAE,MAAM;IACjD,kCAAkC,EAAE,MAAM;IAE1C,gCAAgC,EAAE;QAChC,OAAO;QACP;YACE,QAAQ,EAAE,OAAO;YACjB,iBAAiB,EAAE,QAAQ;YAC3B,K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AE,KAAK;QACnB,sCAAsC,EAAE,KAAK;KAC9C;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n\nexport const reactRules: Linter.RulesRecord = {\n \"react-hooks/rules-of-hooks\": \"error\",\n \"react-hooks/exhaustive-deps\": \"error\",\n\n \"react-hooks/config\": \"error\",\n \"react-hooks/error-boundaries\": \"error\",\n \"react-hooks/component-hook-factories\": \"error\",\n \"react-hooks/gating\": \"error\",\n \"react-hooks/globals\": \"error\",\n \"react-hooks/set-state-in-render\": \"error\",\n \"react-hooks/use-memo\": \"error\",\n \"react/self-closing-comp\": \"error\",\n \"react-hooks/unsupported-syntax\": \"error\",\n \"react-hooks/static-components\": \"error\",\n \"react-hooks/purity\": \"error\",\n\n \"react-hooks/immutability\": \"warn\",\n \"react/no-unstable-nested-components\": \"warn\",\n \"react-hooks/refs\": \"warn\",\n \"react-hooks/set-state-in-effect\": \"warn\",\n \"react-hooks/preserve-manual-memoization\": \"warn\",\n \"react-hooks/incompatible-library\": \"warn\",\n\n \"react/jsx-curly-brace-presence\": [\n \"error\",\n {\n children: \"never\",\n propElementValues: \"always\",\n props: \"never\",\n },\n ],\n\n \"react/jsx-key\": \"error\",\n \"react/jsx-no-leaked-render\": \"error\",\n \"react/jsx-uses-react\": \"error\",\n \"react/jsx-uses-vars\": \"error\",\n \"react/no-danger\": \"error\",\n \"react/no-unused-prop-types\": \"error\",\n \"react/jsx-sort-props\": \"error\",\n\n \"react/no-children-prop\": [\n \"error\",\n {\n allowFunctions: false,\n },\n ],\n};\n\nexport const reactCustomRules: Linter.RulesRecord = {\n \"@trackunit/no-template-strings-in-classname-prop\": \"error\",\n \"@trackunit/require-classname-alternatives\": [\n \"error\",\n {\n alternatives: {\n slate: [\"neutral\"],\n gray: [\"neutral\"],\n zinc: [\"neutral\"],\n stone: [\"neutral\"],\n teal: [\"cyan\"],\n purple: [\"violet\"],\n fuchsia: [\"pink\"],\n red: [\"danger\"],\n yellow: [\"warning\"],\n green: [\"success\"],\n emerald: [\"success\"],\n amber: [\"warning\", \"low\", \"idle\"],\n sky: [\"primary\", \"info\"],\n blue: [\"primary\", \"info\", \"working\", \"utilized\"],\n indigo: [\"primary\", \"violet\"],\n rose: [\"danger\", \"pink\"],\n },\n prefixes: [\n \"bg\",\n \"text\",\n \"border\",\n \"border-t\",\n \"border-r\",\n \"border-b\",\n \"border-l\",\n \"border-x\",\n \"border-y\",\n \"ring\",\n \"ring-offset\",\n \"outline\",\n \"divide\",\n \"shadow\",\n \"accent\",\n \"caret\",\n \"fill\",\n \"stroke\",\n \"decoration\",\n \"placeholder\",\n \"from\",\n \"via\",\n \"to\",\n ],\n },\n ],\n \"@trackunit/require-list-item-virtualization-props\": \"error\",\n \"@trackunit/cva-merge-base-classes-as-array\": \"error\",\n \"@trackunit/design-guideline-button-icon-size-match\": \"error\",\n \"@trackunit/prefer-destructured-imports\": [\n \"error\",\n {\n packages: {\n react: \"React\",\n },\n },\n ],\n \"@trackunit/require-optional-prop-initialization\": \"error\",\n \"@trackunit/prefer-event-specific-callback-naming\": [\n \"error\",\n {\n events: [\"onClick\", \"onSubmit\", \"onDoubleClick\"],\n },\n ],\n \"@trackunit/prefer-mouse-event-handler-in-react-props\": [\n \"error\",\n {\n allowedNames: [\"onClickClose\"],\n },\n ],\n \"@trackunit/prefer-field-components\": \"error\",\n \"@trackunit/one-component-per-file\": \"warn\",\n \"@trackunit/component-name-matches-filename\": [\n \"warn\",\n {\n allowedMismatches: [\n // i18next convention: every library's translation.tsx exports a `Trans` wrapper\n // named after the library component, not the file.\n { file: \"translation\", component: \"Trans\" },\n // React context pattern: *Context files always contain both the context object and\n // the provider component. The provider can't be renamed to match the file because\n // the context object already uses that name.\n { file: \"*Context\", component: \"*Provider\" },\n ],\n },\n ],\n};\n\nexport const reactTestingLibraryOverrides: Linter.Config = {\n files: [\"**/*.spec.ts\", \"**/*.spec.tsx\"],\n rules: {\n \"jest/no-commented-out-tests\": \"error\",\n \"jest/expect-expect\": \"error\",\n },\n};\n\nexport const reactStoryOverrides: Linter.Config = {\n files: [\"**/*.stories.ts\", \"**/*.stories.tsx\"],\n rules: {\n \"jsdoc/require-jsdoc\": \"off\",\n \"no-console\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n },\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"restricted-imports.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/restricted-imports.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAuB;IACvD,uBAAuB,EAAE;QACvB,OAAO;QACP;YACE,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,sBAAsB;oBAC5B,OAAO,EAAE,2DAA2D;iBACrE;gBACD;oBACE,IAAI,EAAE,eAAe;oBACrB,WAAW,EAAE,CAAC,gBAAgB,CAAC;oBAC/B,OAAO,EAAE,gFAAgF;iBAC1F;gBACD;oBACE,IAAI,EAAE,eAAe;oBACrB,WAAW,EAAE,CAAC,OAAO,CAAC;oBACtB,OAAO,EAAE,uEAAuE;iBACjF;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,WAAW,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC;oBACzC,OAAO,EACL,mHAAmH;iBACtH;gBACD;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,OAAO,EAAE,+EAA+E;iBACzF;gBACD;oBACE,IAAI,EAAE,2BAA2B;oBACjC,OAAO,EAAE,8DAA8D;iBACxE;gBACD;oBACE,IAAI,EAAE,6BAA6B;oBACnC,OAAO,EAAE,8DAA8D;iBACxE;gBACD;oBACE,IAAI,EAAE,0BAA0B;oBAChC,OAAO,EACL,0HAA0H;iBAC7H;aACF;YAED,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,CAAC,WAAW,CAAC;oBACpB,OAAO,EAAE,sFAAsF;iBAChG;gBACD;oBACE,KAAK,EAAE,CAAC,cAAc,CAAC;oBACvB,OAAO,EAAE,sFAAsF;iBAChG;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n\nexport const restrictedImportRules: Linter.RulesRecord = {\n \"no-restricted-imports\": [\n \"error\",\n {\n paths: [\n {\n name: \"react-dom/test-utils\",\n message: \"Please use 'act' from the @testing-library/react instead.\",\n },\n {\n name: \"react-i18next\",\n importNames: [\"useTranslation\"],\n message: \"Please import useTranslation from @trackunit/i18n-manager-translation instead.\",\n },\n {\n name: \"react-i18next\",\n importNames: [\"Trans\"],\n message: \"Please import Trans from @trackunit/i18n-manager-translation instead.\",\n },\n {\n name: \"@apollo/client\",\n importNames: [\"useQuery\", \"useLazyQuery\"],\n message:\n \"Please import the same from @trackunit/react-graphql-hooks instead, to ensure loading state is handled correctly.\",\n },\n {\n name: \"@nx/plugin/testing\",\n message: \"Please import it from @trackunit/nx-utils instead or expose it from that lib.\",\n },\n {\n name: \"@heroicons/react/20/solid\",\n message: \"Please use the Icon component from react-components instead.\",\n },\n {\n name: \"@heroicons/react/24/outline\",\n message: \"Please use the Icon component from react-components instead.\",\n },\n {\n name: \"class-variance-authority\",\n message:\n \"Import our wrappers from, @trackunit/css-class-variance-utilities or twMerge instead. [cva -> cvaMerge], [cx -> twMerge]\",\n },\n ],\n\n patterns: [\n {\n group: [\"date-fns*\"],\n message: \"Please use @trackunit/date-and-time-utils or @trackunit/date-and-time-hooks instead.\",\n },\n {\n group: [\"date-fns-tz*\"],\n message: \"Please use @trackunit/date-and-time-utils or @trackunit/date-and-time-hooks instead.\",\n },\n ],\n },\n ],\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"testing-library.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/testing-library.ts"],"names":[],"mappings":";;;AACA,wCAA4C;AAE5C,MAAM,WAAW,GAAG,wBAAc,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;AAEhD,QAAA,wBAAwB,GAAuB,MAAM,CAAC,WAAW,CAC5E,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAuC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAC3G,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\nimport { testingLibrary } from \"../plugins\";\n\nconst configRules = testingLibrary.configs.react.rules ?? {};\n\nexport const reactTestingLibraryRules: Linter.RulesRecord = Object.fromEntries(\n Object.entries(configRules).filter((entry): entry is [string, Linter.RuleEntry] => entry[1] !== undefined)\n);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript-rules.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/fragments/typescript-rules.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAuB;IACjD,oCAAoC,EAAE,OAAO;IAC7C,wCAAwC,EAAE,OAAO;IACjD,uCAAuC,EAAE,OAAO;IAChD,6CAA6C,EAAE,OAAO;IACtD,gBAAgB,EAAE,KAAK;IACvB,mCAAmC,EAAE;QACnC,OAAO;QACP;YACE,IAAI,EAAE,KAAK;YACX,iBAAiB,EAAE,IAAI;YACvB,YAAY,EAAE,KAAK;YACnB,yBAAyB,EAAE,IAAI;YAC/B,8BAA8B,EAAE,IAAI;YACpC,iBAAiB,EAAE,IAAI;YACvB,kBAAkB,EAAE,IAAI;SACzB;KACF;IACD,+BAA+B,EAAE;QAC/B,OAAO;QACP;YACE,OAAO,EAAE,SAAS;SACnB;KACF;IACD,iCAAiC,EAAE,CAAC,OAAO,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IACvE,8BAA8B,EAAE;QAC9B,OAAO;QACP;YACE,KAAK,EAAE,KAAK;SACb;KACF;IACD,+CAA+C,EAAE;QAC/C,MAAM;QACN;YACE,oBAAoB,EAAE,IAAI;YAC1B,mBAAmB,EAAE,IAAI;SAC1B;KACF;IACD,sCAAsC,EAAE;QACtC,OAAO;QACP;YACE,QAAQ,EAAE,WAAW;YACrB,MAAM,EAAE,CAAC,YAAY,CAAC;YAEtB,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,KAAK;aACb;SACF;QACD;YACE,QAAQ,EAAE,eAAe;YACzB,MAAM,EAAE,CAAC,YAAY,CAAC;YAEtB,MAAM,EAAE;gBACN,KAAK,EAAE,2BAA2B;gBAClC,KAAK,EAAE,IAAI;aACZ;SACF;KACF;IACD,0CAA0C,EAAE,MAAM;IAClD,sCAAsC,EAAE,OAAO;IAC/C,0CAA0C,EAAE,OAAO;IACnD,iCAAiC,EAAE,OAAO;IAC1C,mCAAmC,EAAE,MAAM;IAC3C,mCAAmC,EAAE,MAAM;IAC3C,oCAAoC,EAAE,OAAO;IAC7C,yCAAyC,EAAE,OAAO;IAClD,yCAAyC,EAAE,OAAO;IAClD,kDAAkD,EAAE;QAClD,OAAO;QACP;YACE,aAAa,EAAE,UAAU;YACzB,SAAS,EAAE;gBACT,SAAS,EAAE,UAAU;gBACrB,YAAY,EAAE,UAAU;gBACxB,mBAAmB,EAAE,UAAU;aAChC;SACF;KACF;IACD,kDAAkD,EAAE,OAAO;IAC3D,uCAAuC,EAAE,MAAM;IAC/C,wCAAwC,EAAE;QACxC,OAAO;QACP;YACE,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,OAAO,EAAE,6CAA6C;iBACvD;gBAED,EAAE,EAAE;oBACF,OAAO,EAAE,6CAA6C;iBACvD;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import type { Linter } from \"eslint\";\n\nexport const typescriptRules: Linter.RulesRecord = {\n \"@typescript-eslint/no-explicit-any\": \"error\",\n \"@typescript-eslint/no-inferrable-types\": \"error\",\n \"@typescript-eslint/unified-signatures\": \"error\",\n \"@typescript-eslint/no-unnecessary-condition\": \"error\",\n \"no-unused-vars\": \"off\",\n \"@typescript-eslint/no-unused-vars\": [\n \"error\",\n {\n args: \"all\",\n argsIgnorePattern: \"^_\",\n caughtErrors: \"all\",\n caughtErrorsIgnorePattern: \"^_\",\n destructuredArrayIgnorePattern: \"^_\",\n varsIgnorePattern: \"^_\",\n ignoreRestSiblings: true,\n },\n ],\n \"@typescript-eslint/array-type\": [\n \"error\",\n {\n default: \"generic\",\n },\n ],\n \"@typescript-eslint/no-redeclare\": [\"error\", { builtinGlobals: false }],\n \"@typescript-eslint/no-shadow\": [\n \"error\",\n {\n hoist: \"all\",\n },\n ],\n \"@typescript-eslint/strict-boolean-expressions\": [\n \"warn\",\n {\n allowNullableBoolean: true,\n allowNullableString: true,\n },\n ],\n \"@typescript-eslint/naming-convention\": [\n \"error\",\n {\n selector: \"interface\",\n format: [\"PascalCase\"],\n\n custom: {\n regex: \"^I[A-Z]\",\n match: false,\n },\n },\n {\n selector: \"typeParameter\",\n format: [\"PascalCase\"],\n\n custom: {\n regex: \"^(T|Keys?)[A-Z][a-zA-Z]+$\",\n match: true,\n },\n },\n ],\n \"@typescript-eslint/no-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-empty-function\": \"error\",\n \"@typescript-eslint/no-unused-expressions\": \"error\",\n \"@typescript-eslint/dot-notation\": \"error\",\n \"@typescript-eslint/await-thenable\": \"warn\",\n \"@typescript-eslint/ban-ts-comment\": \"warn\",\n \"@typescript-eslint/member-ordering\": \"error\",\n \"@typescript-eslint/no-empty-object-type\": \"error\",\n \"@typescript-eslint/no-floating-promises\": \"error\",\n \"@typescript-eslint/explicit-member-accessibility\": [\n \"error\",\n {\n accessibility: \"explicit\",\n overrides: {\n accessors: \"explicit\",\n constructors: \"explicit\",\n parameterProperties: \"explicit\",\n },\n },\n ],\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"error\",\n \"@typescript-eslint/no-require-imports\": \"warn\",\n \"@typescript-eslint/no-restricted-types\": [\n \"error\",\n {\n types: {\n \"React.FC\": {\n message: \"Please use props interface or type instead.\",\n },\n\n FC: {\n message: \"Please use props interface or type instead.\",\n },\n },\n },\n ],\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/index.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,2CAA8C;AAEjC,QAAA,OAAO,GAAG;IACrB,IAAI,EAAJ,WAAI;IACJ,KAAK,EAAE,mBAAW;CACnB,CAAC","sourcesContent":["import { base } from \"./presets/base\";\nimport { reactPreset } from \"./presets/react\";\n\nexport const configs = {\n base,\n react: reactPreset,\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/plugins.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;GAQG;AACH,8DAAwC;AAwBtC,gBAAE;AAvBJ,2FAAqE;AA4BnE,4CAAgB;AA3BlB,4EAAsD;AA0BpD,4BAAQ;AAzBV,+EAA+D;AAc7D,+BAdK,cAAoB,CAcL;AAbtB,2EAAqD;AAenD,oCAAY;AAdd,iEAA2C;AAezC,oBAAI;AAdN,mEAA6C;AAe3C,sBAAK;AAdP,sEAAgD;AAgB9C,wBAAM;AAfR,mEAA6C;AAiB3C,sBAAK;AAhBP,8EAAwD;AAiBtD,gCAAU;AAhBZ,sFAAgE;AAiB9D,wCAAc;AAhBhB,yDAAmC;AAOjC,0BAAO;AANT,yEAAmD;AAUjD,kCAAW;AATb,4CAAwC;AAE3B,QAAA,gBAAgB,GAAG,EAAE,KAAK,EAAE,oBAAQ,EAAE,CAAC","sourcesContent":["/**\n * Shared plugin instances for ESLint flat config.\n *\n * ESLint flat config requires that the same plugin name always maps to the same\n * object reference. With TypeScript's __importStar() helper (from esModuleInterop),\n * each file that does `import * as foo from \"pkg\"` gets its own wrapper object.\n * By importing all plugins once here and re-exporting, all presets share the same\n * object references.\n */\nimport * as nx from \"@nx/eslint-plugin\";\nimport * as typescriptEslint from \"@typescript-eslint/eslint-plugin\";\nimport * as tsParser from \"@typescript-eslint/parser\";\nimport eslintConfigPrettier from \"eslint-config-prettier/flat\";\nimport * as importPlugin from \"eslint-plugin-import\";\nimport * as jest from \"eslint-plugin-jest\";\nimport * as jsdoc from \"eslint-plugin-jsdoc\";\nimport * as noNull from \"eslint-plugin-no-null\";\nimport * as react from \"eslint-plugin-react\";\nimport * as reactHooks from \"eslint-plugin-react-hooks\";\nimport * as testingLibrary from \"eslint-plugin-testing-library\";\nimport * as globals from \"globals\";\nimport * as jsoncParser from \"jsonc-eslint-parser\";\nimport { rulesMap } from \"../rules-map\";\n\nexport const localRulesPlugin = { rules: rulesMap };\nexport {\n eslintConfigPrettier,\n globals,\n importPlugin,\n jest,\n jsdoc,\n jsoncParser,\n noNull,\n nx,\n react,\n reactHooks,\n testingLibrary,\n tsParser,\n typescriptEslint,\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/presets/base.ts"],"names":[],"mappings":";;;AAAA,4EAAuE;AAEvE,kDAAqD;AACrD,4DAAwD;AACxD,gEAAgE;AAChE,0DAA2D;AAC3D,sEAAqE;AACrE,oFAAmF;AACnF,wEAAwE;AACxE,oEAAgE;AAChE,wCAUoB;AACpB,oCAA4C;AAE/B,QAAA,IAAI,GAAG;IAClB,uBAAa;IACb;QACE,OAAO,EAAE;YACP,KAAK,EAAE,YAAE;YACT,YAAY,EAAE,0BAAgB;YAC9B,oBAAoB,EAAE,0BAAgB;YACtC,SAAS,EAAE,gBAAM;YACjB,UAAU,EAAE,sBAAY;YACxB,KAAK,EAAL,eAAK;SACN;QAED,KAAK,EAAE;YACL,GAAG,uCAAmB;YACtB,GAAG,0CAAqB;SACzB;KACF;IACD,IAAA,iCAAc,EAAC;QACb,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE;QAC9B,OAAO,EAAE;YACP,UAAU,EAAE,sBAAY;SACzB;QACD,KAAK,EAAE;YACL,qCAAqC,EAAE;gBACrC,OAAO;gBACP;oBACE,UAAU,EAAE,I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;YAC7B,cAAc,EAAE,KAAK;YACrB,mBAAmB,EAAE,KAAK;YAC1B,uBAAuB,EAAE,KAAK;YAC9B,WAAW,EAAE,KAAK;YAElB,GAAG,6BAAe;YAElB,uBAAuB,EAAE,qDAA0B;YAEnD,qCAAqC,EAAE,OAAO;YAC9C,oCAAoC,EAAE,MAAM;YAE5C,GAAG,0BAAW;YAEd,GAAG,kCAAe;SACnB;KACF;IACD;QACE,KAAK,EAAE,CAAC,iBAAiB,CAAC;QAC1B,eAAe,EAAE;YACf,MAAM,EAAE,qBAAW;SACpB;QACD,OAAO,EAAE;YACP,YAAY,EAAE,0BAAgB;SAC/B;QACD,KAAK,EAAE;YACL,4DAA4D,EAAE,OAAO;SACtE;KACF;IACD,kCAAiB;IACjB;QACE,KAAK,EAAE;YACL,sBAAsB;YACtB,yBAAyB;YACzB,qBAAqB;YACrB,qBAAqB;YACrB,sBAAsB;SACvB;QACD,KAAK,EAAE;YACL,uCAAuC,EAAE,KAAK;SAC/C;KACF;IACD;QACE,KAAK,EAAE,CAAC,sBAAsB,CAAC;QAC/B,KAAK,EAAE;YACL,+BAA+B,EAAE,KAAK;SACvC;KACF;IACD,8BAAoB;IACpB;QACE,KAAK,EAAE,CAAC,8BAA8B,EAAE,2BAA2B,CAAC;QACpE,KAAK,EAAE;YACL,+BAA+B,EAAE,KAAK;SACvC;KACF;CACF,CAAC","sourcesContent":["import { createSkipWhen } from \"../../config-helpers/create-skip-when\";\n\nimport { globalIgnores } from \"../fragments/ignores\";\nimport { importRules } from \"../fragments/import-rules\";\nimport { baseJestOverrides } from \"../fragments/jest-overrides\";\nimport { basicJsdocRules } from \"../fragments/jsdoc-rules\";\nimport { moduleBoundaryRules } from \"../fragments/module-boundaries\";\nimport { noDirectStorageGlobalsRule } from \"../fragments/no-direct-storage-access\";\nimport { restrictedImportRules } from \"../fragments/restricted-imports\";\nimport { typescriptRules } from \"../fragments/typescript-rules\";\nimport {\n eslintConfigPrettier,\n importPlugin,\n jsdoc,\n jsoncParser,\n localRulesPlugin,\n noNull,\n nx,\n tsParser,\n typescriptEslint,\n} from \"../plugins\";\nimport { findMonorepoRoot } from \"../utils\";\n\nexport const base = [\n globalIgnores,\n {\n plugins: {\n \"@nx\": nx,\n \"@trackunit\": localRulesPlugin,\n \"@typescript-eslint\": typescriptEslint,\n \"no-null\": noNull,\n \"import-x\": importPlugin,\n jsdoc,\n },\n\n rules: {\n ...moduleBoundaryRules,\n ...restrictedImportRules,\n },\n },\n createSkipWhen({\n when: { tags: [\"scope:tool\"] },\n plugins: {\n \"import-x\": importPlugin,\n },\n rules: {\n \"import-x/no-extraneous-dependencies\": [\n \"error\",\n {\n packageDir: findMonorepoRoot(),\n devDependencies: [\n \"**/*.spec.{ts,tsx}\",\n \"**/*.test.{ts,tsx}\",\n \"**/jest.setup.*\",\n \"**/test/**\",\n \"**/tests/**\",\n \"**/testing/**\",\n \"**/test-setup/**\",\n \"**/test-utils/**\",\n \"**/vite.setup.*\",\n \"**/vite.config.ts\",\n \"**/__tests__/**\",\n \"**/__mocks__/**\",\n \"**/mocks.{ts,tsx}\",\n \"**/core-contexts-test/**\",\n \"**/*.stories.{ts,tsx}\",\n \"**/storybookUtils.{ts,tsx}\",\n \"**/.storybook/**\",\n \"**/scripts/**\",\n \"**/tools/**\",\n \"**/*.config.{ts,js,cjs,mjs}\",\n \"**/css/tailwind/**\",\n \"**/css/tailwind-custom-properties-plugin/**\",\n \"**/css/component-tokens/**\",\n ],\n optionalDependencies: false,\n peerDependencies: true,\n bundledDependencies: true,\n },\n ],\n },\n }),\n {\n files: [\"**/*.ts\", \"**/*.tsx\", \"**/*.js\", \"**/*.jsx\"],\n\n languageOptions: {\n ecmaVersion: 5,\n sourceType: \"script\",\n parser: tsParser,\n parserOptions: {\n project: [\"./tsconfig.*?.json\"],\n },\n },\n rules: {\n \"constructor-super\": \"error\",\n curly: \"error\",\n \"default-case\": \"error\",\n \"id-match\": \"error\",\n \"no-caller\": \"error\",\n \"no-debugger\": \"error\",\n \"no-duplicate-imports\": \"error\",\n \"no-empty\": \"error\",\n \"no-eval\": \"error\",\n \"no-console\": \"error\",\n \"no-var\": \"error\",\n \"prefer-const\": \"error\",\n \"no-template-curly-in-string\": \"error\",\n eqeqeq: [\"error\", \"always\"],\n \"no-undef-init\": \"error\",\n \"no-invalid-this\": \"off\",\n \"no-null/no-null\": \"off\",\n \"no-underscore-dangle\": \"off\",\n \"no-redeclare\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-shadow\": \"off\",\n\n ...basicJsdocRules,\n\n \"no-restricted-globals\": noDirectStorageGlobalsRule,\n\n \"@trackunit/no-internal-barrel-files\": \"error\",\n \"@trackunit/no-typescript-assertion\": \"warn\",\n\n ...importRules,\n\n ...typescriptRules,\n },\n },\n {\n files: [\"**/project.json\"],\n languageOptions: {\n parser: jsoncParser,\n },\n plugins: {\n \"@trackunit\": localRulesPlugin,\n },\n rules: {\n \"@trackunit/no-internal-graphql-when-tagged-with-gql-public\": \"error\",\n },\n },\n baseJestOverrides,\n {\n files: [\n \"**/eslint.config.cjs\",\n \"**/iris-app-manifest.ts\",\n \"**/rspack.config.ts\",\n \"**/rspack.config.js\",\n \"**/webpack.config.ts\",\n ],\n rules: {\n \"@typescript-eslint/no-require-imports\": \"off\",\n },\n },\n {\n files: [\"**/eslint.config.cjs\"],\n rules: {\n \"@nx/enforce-module-boundaries\": \"off\",\n },\n },\n eslintConfigPrettier,\n {\n files: [\"**/*.stories.{ts,tsx,js,jsx}\", \"**/*.demo.{ts,tsx,js,jsx}\"],\n rules: {\n \"@nx/enforce-module-boundaries\": \"off\",\n },\n },\n];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"e2e.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/presets/e2e.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;IACjB;QACE,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC;QAErD,eAAe,EAAE;YACf,WAAW,EAAE,CAAC;YACd,UAAU,EAAE,QAAQ;YAEpB,aAAa,EAAE;gBACb,OAAO,EAAE,CAAC,oBAAoB,EAAE,iBAAiB,EAAE,4BAA4B,CAAC;aACjF;SACF;KACF;IACD;QACE,KAAK,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;QACpD,KAAK,EAAE;YACL,uCAAuC,EAAE,KAAK;YAC9C,gCAAgC,EAAE,KAAK;YACvC,8BAA8B,EAAE,KAAK;YACrC,iDAAiD,EAAE,KAAK;YACxD,wCAAwC,EAAE,KAAK;SAChD;KACF;CACF,CAAC","sourcesContent":["export const e2e = [\n {\n files: [\"**/*.ts\", \"**/*.tsx\", \"**/*.js\", \"**/*.jsx\"],\n\n languageOptions: {\n ecmaVersion: 5,\n sourceType: \"script\",\n\n parserOptions: {\n project: [\"./tsconfig.*?.json\", \"./tsconfig.json\", \"./playwright/tsconfig.json\"],\n },\n },\n },\n {\n files: [\"playwright/**/*.ts\", \"playwright/**/*.tsx\"],\n rules: {\n \"testing-library/prefer-screen-queries\": \"off\",\n \"testing-library/no-node-access\": \"off\",\n \"testing-library/no-container\": \"off\",\n \"testing-library/render-result-naming-convention\": \"off\",\n \"testing-library/no-render-in-lifecycle\": \"off\",\n },\n },\n];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/presets/react.ts"],"names":[],"mappings":";;;AAAA,oFAG+C;AAC/C,0DAAwE;AACxE,kEAAwE;AACxE,wCAWoB;AAEP,QAAA,WAAW,GAAG;IACzB;QACE,OAAO,EAAE;YACP,YAAY,EAAE,0BAAgB;YAC9B,oBAAoB,EAAE,0BAAgB;YACtC,KAAK,EAAL,eAAK;YACL,KAAK,EAAL,eAAK;YACL,aAAa,EAAE,oBAAU;YACzB,iBAAiB,EAAE,wBAAc;YACjC,KAAK,EAAE,YAAE;S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AA0B,EAAE,KAAK;SAClC;KACF;IACD;QACE,KAAK,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC;QAExC,OAAO,EAAE;YACP,IAAI,EAAJ,cAAI;YACJ,iBAAiB,EAAE,wBAAc;SAClC;QACD,eAAe,EAAE;YACf,OAAO,EAAE;gBACP,GAAG,iBAAO,CAAC,OAAO;gBAClB,GAAG,cAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO;gBACpC,GAAG,iBAAO,CAAC,IAAI;gBACf,IAAI,EAAE,UAAU;gBAChB,MAAM,EAAE,UAAU;aACnB;YAED,MAAM,EAAE,kBAAQ;SACjB;QAED,KAAK,EAAE;YACL,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;YACjC,GAAG,cAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;YAC3B,GAAG,0CAAwB;YAC3B,6BAA6B,EAAE,OAAO;YACtC,oBAAoB,EAAE,OAAO;SAC9B;KACF;CACF,CAAC","sourcesContent":["import {\n noDirectStoragePropertiesRule,\n noDirectStoragePropertyExceptionOverrides,\n} from \"../fragments/no-direct-storage-access\";\nimport { reactCustomRules, reactRules } from \"../fragments/react-rules\";\nimport { reactTestingLibraryRules } from \"../fragments/testing-library\";\nimport {\n globals,\n jest,\n jsdoc,\n localRulesPlugin,\n nx,\n react,\n reactHooks,\n testingLibrary,\n tsParser,\n typescriptEslint,\n} from \"../plugins\";\n\nexport const reactPreset = [\n {\n plugins: {\n \"@trackunit\": localRulesPlugin,\n \"@typescript-eslint\": typescriptEslint,\n jsdoc,\n react,\n \"react-hooks\": reactHooks,\n \"testing-library\": testingLibrary,\n \"@nx\": nx,\n },\n\n settings: {\n react: {\n version: \"detect\",\n },\n },\n languageOptions: {\n globals: {\n ...globals.browser,\n ...jest.environments.globals.globals,\n ...globals.node,\n Text: \"writable\",\n screen: \"writable\",\n },\n parser: tsParser,\n ecmaVersion: 2022,\n sourceType: \"commonjs\",\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n },\n {\n files: [\"**/*.ts\", \"**/*.tsx\", \"**/*.js\", \"**/*.jsx\"],\n rules: {\n ...reactCustomRules,\n\n \"no-multiple-empty-lines\": [\n \"error\",\n {\n max: 1,\n },\n ],\n\n \"no-unreachable\": \"error\",\n \"prefer-spread\": \"error\",\n\n ...reactRules,\n\n \"no-restricted-syntax\": [\n \"warn\",\n {\n selector: \"TSEnumDeclaration\",\n message: \"Please use string literal union or objects instead of enums.\",\n },\n ],\n\n \"no-restricted-properties\": noDirectStoragePropertiesRule,\n },\n },\n noDirectStoragePropertyExceptionOverrides,\n {\n files: [\"**/*.stories.ts\", \"**/*.stories.tsx\"],\n rules: {\n \"jsdoc/require-jsdoc\": \"off\",\n \"no-console\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@trackunit/one-component-per-file\": \"off\",\n \"@trackunit/component-name-matches-filename\": \"off\",\n },\n },\n {\n files: [\"**/*.spec.ts\", \"**/*.spec.tsx\", \"**/*.test.ts\", \"**/*.test.tsx\"],\n rules: {\n \"@trackunit/one-component-per-file\": \"off\",\n \"@trackunit/component-name-matches-filename\": \"off\",\n \"no-restricted-properties\": \"off\",\n },\n },\n {\n files: [\"**/*.spec.ts\", \"**/*.spec.tsx\"],\n\n plugins: {\n jest,\n \"testing-library\": testingLibrary,\n },\n languageOptions: {\n globals: {\n ...globals.browser,\n ...jest.environments.globals.globals,\n ...globals.node,\n Text: \"writable\",\n screen: \"writable\",\n },\n\n parser: tsParser,\n },\n\n rules: {\n ...jest.configs.recommended.rules,\n ...jest.configs.style.rules,\n ...reactTestingLibraryRules,\n \"jest/no-commented-out-tests\": \"error\",\n \"jest/expect-expect\": \"error\",\n },\n },\n];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/presets/server.ts"],"names":[],"mappings":";;;;AAAA,2CAAkD;AAClD,gFAA0D;AAE1D,wCAAsD;AAEzC,QAAA,MAAM,GAAG;IACpB;QACE,eAAe,EAAE;YACf,OAAO,EAAE;gBACP,GAAG,iBAAO,CAAC,OAAO;aACnB;YAED,MAAM,EAAE,kBAAQ;SACjB;KACF;IACD;QACE,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;QAC7B,OAAO,EAAE;YACP,KAAK,EAAL,eAAK;YACL,cAAc,EAAE,IAAA,yBAAgB,EAAC,WAAW,CAAC;SAC9C;QACD,eAAe,EAAE;YACf,aAAa,EAAE;gBACb,OAAO,EAAE,CAAC,oBAAoB,CAAC;aAChC;SACF;QAED,KAAK,EAAE;YACL,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;YACxC,qCAAqC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;YACvD,2CAA2C,EAAE,KAAK;YAClD,wCAAwC,EAAE,OAAO;YACjD,0CAA0C,EAAE,KAAK;SAClD;KACF;CACF,CAAC","sourcesContent":["import { fixupPluginRules } from \"@eslint/compat\";\nimport * as typeGraphql from \"eslint-plugin-type-graphql\";\n\nimport { globals, jsdoc, tsParser } from \"../plugins\";\n\nexport const server = [\n {\n languageOptions: {\n globals: {\n ...globals.browser,\n },\n\n parser: tsParser,\n },\n },\n {\n files: [\"**/*.ts\", \"**/*.js\"],\n plugins: {\n jsdoc,\n \"type-graphql\": fixupPluginRules(typeGraphql),\n },\n languageOptions: {\n parserOptions: {\n project: [\"./tsconfig.*?.json\"],\n },\n },\n\n rules: {\n ...typeGraphql.configs.recommended.rules,\n \"type-graphql/missing-decorator-type\": [\"error\", \"all\"],\n \"type-graphql/invalid-nullable-output-type\": \"off\",\n \"type-graphql/wrong-decorator-signature\": \"error\",\n \"type-graphql/invalid-nullable-input-type\": \"off\",\n },\n },\n];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../libs/eslint/plugin-trackunit/src/lib/config/utils.ts"],"names":[],"mappings":";;AAUA,4CAcC;;AAxBD,+CAAyB;AACzB,mDAA6B;AAE7B,IAAI,UAA8B,CAAC;AAEnC;;;;GAIG;AACH,SAAgB,gBAAgB;IAC9B,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAI,GAAG,GAAG,SAAS,CAAC;IACpB,OAAO,GAAG,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;YAC7C,UAAU,GAAG,GAAG,CAAC;YACjB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC3B,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import * as fs from \"fs\";\nimport * as path from \"path\";\n\nlet cachedRoot: string | undefined;\n\n/**\n * Finds the monorepo root by walking up from the config package directory\n * until a directory containing nx.json is found.\n * Falls back to process.cwd() if no nx.json is found.\n */\nexport function findMonorepoRoot(): string {\n if (cachedRoot !== undefined) {\n return cachedRoot;\n }\n let dir = __dirname;\n while (dir !== path.dirname(dir)) {\n if (fs.existsSync(path.join(dir, \"nx.json\"))) {\n cachedRoot = dir;\n return dir;\n }\n dir = path.dirname(dir);\n }\n cachedRoot = process.cwd();\n return cachedRoot;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-skip-when.js","sourceRoot":"","sources":["../../../../../../../libs/eslint/plugin-trackunit/src/lib/config-helpers/create-skip-when.ts"],"names":[],"mappings":";;;AAqBA,gDAAmG;AAUnG,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB;;GAEG;AACI,MAAM,cAAc,GAAG,CAAC,OAA8B,EAAqB,EAAE;IAClF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,CAAC,GAAG,KAAK,CAAC;QAE9B,6BAA6B;QAC7B,WAAW,CAAC,GAAG,UAAU,IAAI,QAAQ,EAAE,CAAC,GAAG,UAAU,CAAC;IACxD,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP,CAAC,UAAU,CAAC,EAAE;gBACZ,KAAK,EAAE,YAAY;aACpB;SACF;QACD,KAAK,EAAE,WAAW;KACnB,CAAC;AACJ,CAAC,CAAC;AArDW,QAAA,cAAc,kBAqDzB","sourcesContent":["/**\n * Helper to create ESLint config that wraps rules with skip-when-lib-has-tag-tool logic.\n *\n * This provides a cleaner API than manually using the skip-when-lib-has-tag-tool/ prefix.\n *\n * @example\n * createSkipWhen({\n * when: { tags: ['scope:tool'] },\n * plugins: {\n * 'import-x': importXPlugin,\n * },\n * rules: {\n * 'import-x/no-extraneous-dependencies': [\"error\", { ... }],\n * }\n * })\n *\n * Returns a config object with:\n * - A unique plugin containing the wrapped rules for this specific config\n * - Rules configured to use the wrapped versions\n */\nimport type { Linter, Rule } from \"eslint\";\nimport { getProjectMetadata, projectMatchesCriteria, type MatchCriteria } from \"../utils/nx-utils\";\n\ntype PluginMap = Record<string, { rules: Record<string, Rule.RuleModule> }>;\n\ntype CreateSkipWhenOptions = {\n when: MatchCriteria;\n plugins: PluginMap;\n rules: Linter.RulesRecord;\n};\n\nlet skipWhenCounter = 0;\n\n/**\n * Creates an ESLint config that wraps rules to skip enforcement based on NX project criteria.\n */\nexport const createSkipWhen = (options: CreateSkipWhenOptions): Linter.FlatConfig => {\n const { when, plugins, rules } = options;\n\n // Create a unique plugin name for this config\n const pluginName = `skip-when-${skipWhenCounter++}`;\n\n // Build wrapped rules from provided plugins\n const wrappedRules: Record<string, Rule.RuleModule> = {};\n\n for (const [originalPluginName, plugin] of Object.entries(plugins)) {\n for (const [ruleName, originalRule] of Object.entries(plugin.rules)) {\n const fullRuleName = `${originalPluginName}/${ruleName}`;\n\n // Create wrapped version of this rule\n wrappedRules[fullRuleName] = {\n meta: originalRule.meta,\n create(context: Rule.RuleContext) {\n // Check if this file belongs to a project matching the criteria\n const filename = context.filename || context.getFilename();\n const metadata = getProjectMetadata(filename);\n\n // Check if project matches the skip criteria\n if (metadata && projectMatchesCriteria(metadata, when)) {\n // Skip enforcement - return empty visitor\n return {};\n }\n\n // Otherwise, delegate to the original rule\n return originalRule.create(context);\n },\n };\n }\n }\n\n // Build the rules config\n const rulesConfig: Linter.RulesRecord = {};\n\n for (const [ruleName, ruleConfig] of Object.entries(rules)) {\n // Disable the original rule\n rulesConfig[ruleName] = \"off\";\n\n // Enable our wrapped version\n rulesConfig[`${pluginName}/${ruleName}`] = ruleConfig;\n }\n\n return {\n plugins: {\n [pluginName]: {\n rules: wrappedRules,\n },\n },\n rules: rulesConfig,\n };\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-name-matches-filename.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/component-name-matches-filename/component-name-matches-filename.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;AAEH,oDAAuD;AACvD,yCAAsC;AACtC,wDAAwB;AACxB,iEAAyE;AAEzE,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CAAC,6FAA6F,IAAI,IAAI,IAAI,KAAK,CACvH,CAAC;AAaW,QAAA,4BAA4B,GAAG,UAAU,CAAsB;IAC1E,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,+EAA+E;gBAC/E,yDAAyD;SAC5D;QACD,QAAQ,EAAE;YACR,qBAAqB,EACnB,kDAAkD,GAAG,yDAAyD;SACjH;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,iBAAiB,EAAE;wBACjB,IAAI,EAAE,OAAO;wBACb,WAAW,EACT,uGAAuG;4BACvG,i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EAAE,OAAO,CAAC,0BAA0B;YAE5D,cAAc;gBACZ,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC;oBAC7D,IAAI,IAAI,KAAK,IAAI;wBAAE,SAAS,CAAC,uCAAuC;oBACpE,IAAI,IAAI,KAAK,YAAY;wBAAE,SAAS;oBAEpC,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CACtC,KAAK,CAAC,EAAE,CAAC,IAAA,qBAAS,EAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,IAAA,qBAAS,EAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAC7E,CAAC;oBACF,IAAI,SAAS;wBAAE,SAAS;oBAExB,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,uBAAuB;wBAClC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE;qBACvC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["/**\n * ESLint rule: component-name-matches-filename\n *\n * Enforces that every exported React component is named after the file it lives in.\n * For a file named `Foo.tsx`, the exported component must be named `Foo`.\n *\n * Anonymous default exports are skipped (no name to compare).\n * `index.*` files are skipped (they are entry-point re-export files, not component files).\n *\n * When combined with `one-component-per-file`, these two rules together fully enforce\n * the \"one named component per file\" convention.\n *\n * @example\n * // File: Foo.tsx\n * // Bad β€” exported name doesn't match filename\n * export function Bar() { return <div />; }\n *\n * // Good\n * export function Foo() { return <div />; }\n */\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { minimatch } from \"minimatch\";\nimport path from \"path\";\nimport { createComponentFileTracker } from \"../../utils/component-utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`\n);\n\ntype MessageIds = \"componentNameMismatch\";\n\ntype AllowedMismatch = {\n /** Basename of the file (without extension) where the mismatch is permitted. Supports glob patterns (`*`, `?`). */\n file: string;\n /** Exported component name that is permitted despite not matching the filename. Supports glob patterns (`*`, `?`). */\n component: string;\n};\n\ntype Options = [{ allowedMismatches?: ReadonlyArray<AllowedMismatch> }];\n\nexport const componentNameMatchesFilename = createRule<Options, MessageIds>({\n name: \"component-name-matches-filename\",\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Enforce that exported React component names match the filename they live in. \" +\n \"index.* files and anonymous default exports are exempt.\",\n },\n messages: {\n componentNameMismatch:\n \"Component '{{name}}' should match the filename. \" + \"Rename it to '{{expected}}' or move it to its own file.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n allowedMismatches: {\n type: \"array\",\n description:\n \"Pairs that are exempt from the name-matching rule. Both `file` and `component` support glob patterns \" +\n \"(`*`, `?`), so one entry can cover a whole family of files (e.g. { file: '*Context', component: '*Provider' }).\",\n items: {\n type: \"object\",\n properties: {\n file: {\n type: \"string\",\n description:\n \"Basename of the file without extension. Supports glob patterns (`*`, `?`). \" +\n \"e.g. 'translation' or '*Context'.\",\n },\n component: {\n type: \"string\",\n description:\n \"Exported component name. Supports glob patterns (`*`, `?`). \" + \"e.g. 'Trans' or '*Provider'.\",\n },\n },\n required: [\"file\", \"component\"],\n additionalProperties: false,\n },\n },\n },\n additionalProperties: false,\n },\n ],\n },\n defaultOptions: [{}],\n create(context, [{ allowedMismatches = [] }]) {\n const filename = context.filename;\n const basename = path.basename(filename, path.extname(filename));\n\n if (basename === \"index\" || basename === \"<input>\") return {};\n\n // Normalize kebab-case and snake_case filenames to PascalCase.\n // e.g. `current-weather-status` β†’ `CurrentWeatherStatus`, `app` β†’ `App`.\n const expectedName = basename\n .split(/[-_]/)\n .map(segment => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join(\"\");\n\n const tracker = createComponentFileTracker();\n\n return {\n FunctionDeclaration: tracker.onFunctionDeclaration,\n VariableDeclarator: tracker.onVariableDeclarator,\n ExportNamedDeclaration: tracker.onExportNamedDeclaration,\n ExportDefaultDeclaration: tracker.onExportDefaultDeclaration,\n\n \"Program:exit\"() {\n for (const { name, node } of tracker.getExportedComponents()) {\n if (name === null) continue; // anonymous default exports are exempt\n if (name === expectedName) continue;\n\n const isAllowed = allowedMismatches.some(\n entry => minimatch(basename, entry.file) && minimatch(name, entry.component)\n );\n if (isAllowed) continue;\n\n context.report({\n node,\n messageId: \"componentNameMismatch\",\n data: { name, expected: expectedName },\n });\n }\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cva-merge-base-classes-as-array.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/cva-merge-base-classes-as-array/cva-merge-base-classes-as-array.ts"],"names":[],"mappings":";;;AAAA,oDAAiF;AACjF,iEAAyF;AAEzF,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CAAC,6FAA6F,IAAI,KAAK,CAC/G,CAAC;AAKF;;;;;;;;;GASG;AACU,QAAA,0BAA0B,GAAG,UAAU,CAAsB;IACxE,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE;YACJ,WAAW,EAAE,wEAAwE;SACtF;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,gBAAgB,EAAE,4FAA4F;YAC9G,eAAe,EAAE,sDAAsD;SACxE;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,cAAc,CAAC,IAA6B;gBAC1C,MAAM,UAAU,GAAG,IAAA,+BAAa,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAE9C,IAAI,UAAU,KAAK,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;o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,CAAC,QAAQ,EAAE,CAAC;oCACxC,IAAI,OAAO,EAAE,IAAI,KAAK,sBAAc,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;wCAClF,UAAU,CAAC,IAAI,CAAC,GAAG,IAAA,8BAAY,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;oCAClD,CAAC;gCACH,CAAC;gCACD,OAAO,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAA,+BAAa,EAAC,UAAU,CAAC,CAAC,CAAC;4BAChE,CAAC;yBACF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { AST_NODE_TYPES, ESLintUtils, TSESTree } from \"@typescript-eslint/utils\";\nimport { formatAsArray, getCalleeName, splitClasses } from \"../../utils/classname-utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}.ts`\n);\n\ntype MessageIds = \"stringNeedsArray\" | \"arrayNeedsSplit\";\ntype Options = [];\n\n/**\n * ESLint rule that converts cvaMerge base styles to arrays if more than one class is used.\n *\n * @example\n * Invalid:\n * const cvaMyComponent = cvaMerge(\"text-danger-600 mb-4 font-semibold\");\n * const cvaMyComponent = cvaMerge([\"text-danger-600 mb-4\",\"font-semibold\"]);\n * Valid:\n * const cvaMyComponent = cvaMerge([\"text-danger-600\", \"mb-4\", \"font-semibold\"]);\n */\nexport const cvaMergeBaseClassesAsArray = createRule<Options, MessageIds>({\n name: \"cva-merge-base-classes-as-array\",\n meta: {\n type: \"layout\",\n docs: {\n description: \"Convert cvaMerge base styles to arrays if more than one class is used.\",\n },\n fixable: \"code\",\n messages: {\n stringNeedsArray: \"[cvaMerge] The first argument of cvaMerge should be an array if multiple classes are used.\",\n arrayNeedsSplit: \"[cvaMerge] Only one class per array item is allowed.\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n CallExpression(node: TSESTree.CallExpression) {\n const calleeName = getCalleeName(node.callee);\n\n if (calleeName !== \"cvaMerge\" || node.arguments.length === 0) {\n return;\n }\n\n const firstArg = node.arguments[0];\n if (!firstArg) {\n return;\n }\n\n // Handle string literal: cvaMerge(\"class1 class2\")\n if (firstArg.type === AST_NODE_TYPES.Literal && typeof firstArg.value === \"string\") {\n const value = firstArg.value;\n if (value.includes(\" \")) {\n context.report({\n node,\n messageId: \"stringNeedsArray\",\n fix(fixer) {\n return fixer.replaceText(firstArg, formatAsArray(splitClasses(value)));\n },\n });\n }\n return;\n }\n\n // Handle array: cvaMerge([\"class1 class2\", \"class3\"])\n if (firstArg.type === AST_NODE_TYPES.ArrayExpression) {\n const hasMultiClassElement = firstArg.elements.some(\n element =>\n element?.type === AST_NODE_TYPES.Literal &&\n typeof element.value === \"string\" &&\n element.value.includes(\" \")\n );\n\n if (hasMultiClassElement) {\n context.report({\n node,\n messageId: \"arrayNeedsSplit\",\n fix(fixer) {\n // Extract all string values and split them into individual classes\n const allClasses: Array<string> = [];\n for (const element of firstArg.elements) {\n if (element?.type === AST_NODE_TYPES.Literal && typeof element.value === \"string\") {\n allClasses.push(...splitClasses(element.value));\n }\n }\n return fixer.replaceText(firstArg, formatAsArray(allClasses));\n },\n });\n }\n }\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"design-guideline-button-icon-size-match.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/design-guideline-button-icon-size-match/design-guideline-button-icon-size-match.ts"],"names":[],"mappings":";;;;AAAA,oDAAqF;AACrF,uDAAiC;AAEjC,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CAAC,0FAA0F,IAAI,KAAK,CAC5G,CAAC;AAEF,sEAAsE;AACtE,SAAS,yBAAyB,CAChC,OAA6D,EAC7D,UAA+B;IAE/B,I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K,EAAE,eAAe,CAAC,CAAC;wCAChE,CAAC;6CAAM,CAAC;4CACN,qBAAqB;4CACrB,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;4CAC3E,IAAI,QAAQ,EAAE,CAAC;gDACb,OAAO,KAAK,CAAC,eAAe,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;4CACrE,CAAC;iDAAM,CAAC;gDACN,OAAO,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;4CAC7E,CAAC;wCACH,CAAC;oCACH,CAAC;iCACF,CAAC,CAAC;4BACL,CAAC;wBACH,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { ESLintUtils, type TSESLint, type TSESTree } from \"@typescript-eslint/utils\";\nimport * as ts from \"typescript\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/docs/rules/${name}.md`\n);\n\n// Helper to get possible string literal values from a variable's type\nfunction getPossibleStringLiterals(\n context: TSESLint.RuleContext<string, ReadonlyArray<unknown>>,\n identifier: TSESTree.Identifier\n): Array<string> | null {\n try {\n const services = ESLintUtils.getParserServices(context);\n const checker = services.program.getTypeChecker();\n const tsNode = services.esTreeNodeToTSNodeMap.get(identifier);\n const type = checker.getTypeAtLocation(tsNode);\n\n const literalValues: Array<string> = [];\n\n // Type guard for string literal types\n const isStringLiteralType = (t: ts.Type): t is ts.Type & { value: string } => {\n if ((t.flags & ts.TypeFlags.StringLiteral) === 0) {\n return false;\n }\n // Check if the type has a value property and it's a string\n // eslint-disable-next-line @trackunit/no-typescript-assertion\n const typeWithValue = t as { value?: unknown };\n return \"value\" in typeWithValue && typeof typeWithValue.value === \"string\";\n };\n\n if (type.isUnion()) {\n for (const unionType of type.types) {\n if (isStringLiteralType(unionType)) {\n literalValues.push(unionType.value);\n }\n }\n } else if (isStringLiteralType(type)) {\n literalValues.push(type.value);\n }\n\n return literalValues.length > 0 ? literalValues : null;\n } catch {\n return null;\n }\n}\n\n// Helper to check if a conditional expression matches the expected button-icon size pattern\nfunction isCorrectConditionalExpression(expression: TSESTree.Expression, buttonVariableName: string): boolean {\n if (expression.type !== \"ConditionalExpression\") {\n return false;\n }\n\n const { test, consequent, alternate } = expression;\n\n // Check if test is: variable === \"large\"\n if (\n test.type === \"BinaryExpression\" &&\n test.operator === \"===\" &&\n test.left.type === \"Identifier\" &&\n test.left.name === buttonVariableName &&\n test.right.type === \"Literal\" &&\n test.right.value === \"large\"\n ) {\n // Check if consequent is \"medium\" and alternate is \"small\"\n return (\n consequent.type === \"Literal\" &&\n consequent.value === \"medium\" &&\n alternate.type === \"Literal\" &&\n alternate.value === \"small\"\n );\n }\n\n return false;\n}\n\nexport const designGuidelineButtonIconSizeMatch = createRule({\n name: \"design-guideline-button-icon-size-match\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Ensure Icon components within Button have the correct size prop based on the Button's size.\",\n },\n fixable: \"code\",\n schema: [],\n messages: {\n incorrectIconSize:\n \"Expected Icon size to be '{{expectedSize}}' for Button size '{{buttonSize}}', found '{{iconSize}}'.\",\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n JSXOpeningElement(node: TSESTree.JSXOpeningElement) {\n if (node.name.type === \"JSXIdentifier\" && node.name.name === \"Button\") {\n const sizeAttr = node.attributes.find(\n (attr): attr is TSESTree.JSXAttribute =>\n attr.type === \"JSXAttribute\" && attr.name.type === \"JSXIdentifier\" && attr.name.name === \"size\"\n );\n\n const buttonSizeInfo = (() => {\n if (!sizeAttr?.value) return { type: \"implicit\", value: null };\n\n if (sizeAttr.value.type === \"Literal\" && typeof sizeAttr.value.value === \"string\") {\n return { type: \"literal\", value: sizeAttr.value.value };\n }\n\n if (sizeAttr.value.type === \"JSXExpressionContainer\") {\n const expr = sizeAttr.value.expression;\n if (expr.type === \"Identifier\") {\n return { type: \"variable\", value: expr.name, expression: expr };\n }\n return { type: \"expression\", value: null, expression: expr };\n }\n\n return { type: \"implicit\", value: null };\n })();\n\n node.attributes.forEach(attr => {\n if (\n attr.type === \"JSXAttribute\" &&\n attr.name.type === \"JSXIdentifier\" &&\n (attr.name.name === \"prefix\" || attr.name.name === \"suffix\") &&\n attr.value?.type === \"JSXExpressionContainer\"\n ) {\n // Find Icon element - could be direct or inside conditional\n const findIconElement = (expression: TSESTree.Expression): TSESTree.JSXOpeningElement | null => {\n if (\n expression.type === \"JSXElement\" &&\n expression.openingElement.name.type === \"JSXIdentifier\" &&\n expression.openingElement.name.name === \"Icon\"\n ) {\n return expression.openingElement;\n }\n\n if (expression.type === \"ConditionalExpression\") {\n // Check both consequent and alternate\n const consequent = findIconElement(expression.consequent);\n if (consequent) return consequent;\n\n const alternate = findIconElement(expression.alternate);\n if (alternate) return alternate;\n }\n\n return null;\n };\n\n // Skip empty JSX expressions like {}\n if (attr.value.expression.type === \"JSXEmptyExpression\") return;\n\n const iconElement = findIconElement(attr.value.expression);\n if (!iconElement) return;\n const iconSizeAttr = iconElement.attributes.find(\n (iconAttr): iconAttr is TSESTree.JSXAttribute =>\n iconAttr.type === \"JSXAttribute\" &&\n iconAttr.name.type === \"JSXIdentifier\" &&\n iconAttr.name.name === \"size\"\n );\n\n const iconSizeInfo = (() => {\n if (!iconSizeAttr?.value) return { type: \"implicit\", value: null };\n\n if (iconSizeAttr.value.type === \"Literal\" && typeof iconSizeAttr.value.value === \"string\") {\n return { type: \"literal\", value: iconSizeAttr.value.value };\n }\n\n if (iconSizeAttr.value.type === \"JSXExpressionContainer\") {\n const expr = iconSizeAttr.value.expression;\n if (expr.type === \"Identifier\") {\n return { type: \"variable\", value: expr.name, expression: expr };\n }\n return { type: \"expression\", value: null, expression: expr };\n }\n\n return { type: \"implicit\", value: null };\n })();\n\n // Rule: large buttons β†’ medium icons, small/medium buttons β†’ small icons\n const getExpectedIconSize = (buttonSize: string): string => {\n if (buttonSize === \"large\") return \"medium\";\n return \"small\"; // both \"small\" and \"medium\" buttons get \"small\" icons\n };\n\n const shouldReport = (() => {\n // For complex expressions, always warn but don't autofix\n if (buttonSizeInfo.type === \"expression\") {\n return true;\n }\n\n // For variables, check if icon already has the correct size\n if (buttonSizeInfo.type === \"variable\" && buttonSizeInfo.expression?.type === \"Identifier\") {\n const possibleSizes = getPossibleStringLiterals(context, buttonSizeInfo.expression);\n\n if (possibleSizes) {\n // Check if all possible button sizes map to the same icon size\n const iconSizes = possibleSizes.map(getExpectedIconSize);\n const uniqueIconSizes = [...new Set(iconSizes)];\n\n if (uniqueIconSizes.length === 1) {\n // All map to same icon size - check if icon already has correct literal\n const variableExpectedIconSize = uniqueIconSizes[0];\n const variableIconEffectiveSize = iconSizeInfo.value || \"medium\";\n\n if (variableIconEffectiveSize === variableExpectedIconSize) {\n return false; // Icon already has correct literal size\n }\n } else {\n // Mixed mapping - check if icon has correct conditional expression\n if (\n iconSizeInfo.type === \"expression\" &&\n iconSizeInfo.expression &&\n iconSizeInfo.expression.type !== \"JSXEmptyExpression\" &&\n buttonSizeInfo.value &&\n isCorrectConditionalExpression(iconSizeInfo.expression, buttonSizeInfo.value)\n ) {\n return false; // Icon already has correct conditional\n }\n }\n }\n\n // Mixed mapping or can't determine - always warn\n return true;\n }\n\n // For literals and implicit, check the mapping\n const buttonEffectiveSize = buttonSizeInfo.value || \"medium\";\n const iconEffectiveSize = iconSizeInfo.value || \"medium\";\n const expectedIconSize = getExpectedIconSize(buttonEffectiveSize);\n\n return iconEffectiveSize !== expectedIconSize;\n })();\n\n if (shouldReport) {\n context.report({\n node: iconElement,\n messageId: \"incorrectIconSize\",\n data: {\n expectedSize: (() => {\n if (buttonSizeInfo.type === \"variable\" && buttonSizeInfo.expression?.type === \"Identifier\") {\n // Analyze the variable's type to determine expected message\n const possibleSizes = getPossibleStringLiterals(context, buttonSizeInfo.expression);\n\n if (possibleSizes) {\n const iconSizes = possibleSizes.map(getExpectedIconSize);\n const uniqueIconSizes = [...new Set(iconSizes)];\n\n if (uniqueIconSizes.length === 1) {\n return uniqueIconSizes[0];\n }\n }\n\n return `{${buttonSizeInfo.value} === \"large\" ? \"medium\" : \"small\"}`;\n }\n if (buttonSizeInfo.type === \"expression\") {\n return \"small (for small/medium buttons) or medium (for large buttons)\";\n }\n const buttonEffectiveSize = buttonSizeInfo.value || \"medium\";\n return getExpectedIconSize(buttonEffectiveSize);\n })(),\n buttonSize:\n buttonSizeInfo.type === \"implicit\"\n ? \"medium (default)\"\n : buttonSizeInfo.type === \"literal\"\n ? buttonSizeInfo.value\n : buttonSizeInfo.type === \"variable\"\n ? (() => {\n if (buttonSizeInfo.expression?.type === \"Identifier\") {\n const possibleSizes = getPossibleStringLiterals(context, buttonSizeInfo.expression);\n if (possibleSizes && possibleSizes.length > 0) {\n const sizeList = possibleSizes.map(s => `\"${s}\"`).join(\" | \");\n return `{${buttonSizeInfo.value}} (of type ${sizeList})`;\n }\n }\n return `{${buttonSizeInfo.value}}`;\n })()\n : \"expression\",\n iconSize:\n iconSizeInfo.type === \"implicit\"\n ? \"medium (default)\"\n : iconSizeInfo.type === \"literal\"\n ? iconSizeInfo.value\n : iconSizeInfo.type === \"variable\"\n ? `{${iconSizeInfo.value}}`\n : \"expression\",\n },\n fix(fixer) {\n // Don't autofix complex expressions, only variables and literals\n if (buttonSizeInfo.type === \"expression\") {\n return null;\n }\n\n let targetSizeValue: string;\n\n if (buttonSizeInfo.type === \"variable\" && buttonSizeInfo.expression?.type === \"Identifier\") {\n // Analyze the variable's type to determine optimal autofix\n const possibleSizes = getPossibleStringLiterals(context, buttonSizeInfo.expression);\n\n if (possibleSizes) {\n // Check if all possible button sizes map to the same icon size\n const iconSizes = possibleSizes.map(getExpectedIconSize);\n const uniqueIconSizes = [...new Set(iconSizes)];\n\n if (uniqueIconSizes.length === 1) {\n // All possible button sizes map to the same icon size\n targetSizeValue = `\"${uniqueIconSizes[0]}\"`;\n } else {\n // Mixed mapping, use conditional\n targetSizeValue = `{${buttonSizeInfo.value} === \"large\" ? \"medium\" : \"small\"}`;\n }\n } else {\n // Can't determine type, use conditional\n targetSizeValue = `{${buttonSizeInfo.value} === \"large\" ? \"medium\" : \"small\"}`;\n }\n } else {\n // Calculate target icon size based on button size (literal or implicit)\n const buttonEffectiveSize = buttonSizeInfo.value || \"medium\";\n const targetIconSize = getExpectedIconSize(buttonEffectiveSize);\n targetSizeValue = `\"${targetIconSize}\"`;\n }\n\n if (iconSizeAttr) {\n // Replace existing size attribute\n if (!iconSizeAttr.value) return null;\n return fixer.replaceText(iconSizeAttr.value, targetSizeValue);\n } else {\n // Add size attribute\n const lastAttr = iconElement.attributes[iconElement.attributes.length - 1];\n if (lastAttr) {\n return fixer.insertTextAfter(lastAttr, ` size=${targetSizeValue}`);\n } else {\n return fixer.insertTextAfter(iconElement.name, ` size=${targetSizeValue}`);\n }\n }\n },\n });\n }\n }\n });\n }\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-internal-barrel-files.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/no-internal-barrel-files/no-internal-barrel-files.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oDAAuD;AACvD,+CAAyB;AACzB,mDAA6B;AAC7B,6BAAwB;AACxB,uDAAyD;AAEzD,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACjC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,eAAe,EAAE,OAAC;SACf,MAAM,CAAC;QACN,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MA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AC,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC;gBAChF,MAAM,qBAAqB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;gBAEzD,2CAA2C;gBAC3C,IAAI,qBAAqB,KAAK,YAAY,IAAI,qBAAqB,KAAK,aAAa,EAAE,CAAC;oBACtF,OAAO;gBACT,CAAC;gBAED,4EAA4E;gBAC5E,IAAI,aAAa,EAAE,CAAC;oBAClB,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAC;oBACpE,IAAI,oBAAoB,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC;wBACpD,uDAAuD;wBACvD,OAAO;oBACT,CAAC;gBACH,CAAC;gBAED,4CAA4C;gBAC5C,sDAAsD;gBACtD,qDAAqD;gBACrD,uDAAuD;gBACvD,2DAA2D;gBAC3D,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAE,kBAAkB;iBAC9B,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["/**\n * ESLint rule to disallow internal barrel files.\n *\n * Internal barrel files (any index.ts or index.tsx that is not at the library root) cause:\n * - Multiple import paths to the same module\n * - Slower builds (bundlers must traverse more barrel files)\n * - Confusion about canonical import paths\n * - Potential bundle size issues\n * - Module identity problems\n *\n * EXCEPTION: Secondary entry points configured in tsconfig.base.json are allowed.\n * These are intentional barrel files that provide separate package imports\n * (e.g., @trackunit/react-core-contexts-host-test pointing to src/test/index.ts).\n *\n * @example\n * // Valid - Root barrel file\n * // libs/my-lib/src/index.ts βœ…\n *\n * // Valid - Secondary entry point configured in tsconfig.base.json\n * // libs/my-lib/src/test/index.ts βœ… (if configured as @trackunit/my-lib-test)\n *\n * // Invalid - Internal barrel file\n * // libs/my-lib/src/components/index.ts ❌\n * // libs/my-lib/src/utils/helpers/index.ts ❌\n */\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { z } from \"zod\";\nimport { findNearestFile } from \"../../utils/file-utils\";\n\nconst projectJsonSchema = z.object({\n sourceRoot: z.string().optional(),\n});\n\nconst tsconfigSchema = z.object({\n compilerOptions: z\n .object({\n paths: z.record(z.array(z.string())).optional(),\n })\n .optional(),\n});\n\n/**\n * Cache for tsconfig.base.json secondary entry points.\n * Key: workspace root path\n * Value: Set of absolute paths to allowed secondary entry points\n */\nconst secondaryEntryPointsCache = new Map<string, Set<string>>();\n\n/**\n * Find the workspace root by looking for nx.json\n */\nconst findWorkspaceRoot = (startPath: string): string | null => {\n const nxJsonPath = findNearestFile(startPath, \"nx.json\");\n return nxJsonPath ? path.dirname(nxJsonPath) : null;\n};\n\n/**\n * Get secondary entry points from tsconfig.base.json.\n * These are path mappings that point to index.ts files inside src/ subdirectories.\n * Results are cached per workspace root.\n */\nconst getSecondaryEntryPoints = (workspaceRoot: string): Set<string> => {\n const cached = secondaryEntryPointsCache.get(workspaceRoot);\n if (cached) {\n return cached;\n }\n\n const entryPoints = new Set<string>();\n const tsconfigPath = path.join(workspaceRoot, \"tsconfig.base.json\");\n\n try {\n const tsconfigContent = fs.readFileSync(tsconfigPath, \"utf-8\");\n const parsed = tsconfigSchema.safeParse(JSON.parse(tsconfigContent));\n\n if (parsed.success && parsed.data.compilerOptions?.paths) {\n const paths = parsed.data.compilerOptions.paths;\n\n for (const pathMappings of Object.values(paths)) {\n for (const mapping of pathMappings) {\n // Only consider mappings that point to index.ts files\n if (mapping.endsWith(\"/index.ts\") || mapping.endsWith(\"/index.tsx\")) {\n const absolutePath = path.normalize(path.join(workspaceRoot, mapping));\n entryPoints.add(absolutePath);\n }\n }\n }\n }\n } catch {\n // If we can't read tsconfig.base.json, return empty set\n }\n\n secondaryEntryPointsCache.set(workspaceRoot, entryPoints);\n return entryPoints;\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}.ts`\n);\n\ntype MessageIds = \"noInternalBarrel\";\ntype Options = [];\n\n/**\n * Check if a file is a barrel file (index.ts or index.tsx).\n */\nconst isBarrelFile = (filePath: string): boolean => {\n const basename = path.basename(filePath);\n return basename === \"index.ts\" || basename === \"index.tsx\";\n};\n\n/**\n * Normalize file path for comparison (handles potential trailing slashes, etc.)\n */\nconst normalizePath = (filePath: string): string => {\n return path.normalize(filePath);\n};\n\nexport const noInternalBarrelFiles = createRule<Options, MessageIds>({\n name: \"no-internal-barrel-files\",\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow internal barrel files (index.ts) that are not at the library root or configured as secondary entry points\",\n },\n schema: [],\n messages: {\n noInternalBarrel:\n \"Internal barrel files are not allowed. Move exports to the root barrel file (src/index.ts) instead. Use the flatten-barrel-exports tool: yarn ts-node devtools/flatten-barrel-exports/flatten-barrel-exports.ts\",\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n Program(node) {\n const currentFile = context.filename;\n\n // Only analyze barrel files (index.ts/tsx)\n if (!isBarrelFile(currentFile)) {\n return;\n }\n\n // Find the project root by looking for project.json\n const projectJsonPath = findNearestFile(currentFile, \"project.json\");\n if (projectJsonPath === null) {\n // Not in an NX project, skip\n return;\n }\n\n const projectRoot = path.dirname(projectJsonPath);\n const workspaceRoot = findWorkspaceRoot(currentFile);\n\n // Read sourceRoot from project.json, defaulting to \"src\" if not specified\n // sourceRoot in project.json is relative to workspace root (e.g., \"libs/my-lib/src\")\n let sourceRootAbsolute = path.join(projectRoot, \"src\");\n try {\n const projectJsonContent = fs.readFileSync(projectJsonPath, \"utf-8\");\n const parsed = projectJsonSchema.safeParse(JSON.parse(projectJsonContent));\n if (parsed.success && parsed.data.sourceRoot && workspaceRoot) {\n // sourceRoot is relative to workspace root, so resolve it\n sourceRootAbsolute = path.join(workspaceRoot, parsed.data.sourceRoot);\n }\n } catch {\n // If we can't read project.json, fall back to projectRoot/src\n }\n\n // The root barrel is at {sourceRoot}/index.ts or {sourceRoot}/index.tsx\n const rootBarrelTs = normalizePath(path.join(sourceRootAbsolute, \"index.ts\"));\n const rootBarrelTsx = normalizePath(path.join(sourceRootAbsolute, \"index.tsx\"));\n const normalizedCurrentFile = normalizePath(currentFile);\n\n // If this IS the root barrel, it's allowed\n if (normalizedCurrentFile === rootBarrelTs || normalizedCurrentFile === rootBarrelTsx) {\n return;\n }\n\n // Check if this is a secondary entry point configured in tsconfig.base.json\n if (workspaceRoot) {\n const secondaryEntryPoints = getSecondaryEntryPoints(workspaceRoot);\n if (secondaryEntryPoints.has(normalizedCurrentFile)) {\n // This is a configured secondary entry point, allow it\n return;\n }\n }\n\n // This is an internal barrel file - flag it\n // Note: No autofix or suggestion is provided because:\n // 1. The exports need to be moved to the root barrel\n // 2. Imports throughout the codebase may need updating\n // 3. The flatten-barrel-exports tool handles this properly\n context.report({\n node,\n messageId: \"noInternalBarrel\",\n });\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-internal-graphql-when-tagged-with-gql-public.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/no-internal-graphql-when-tagged-with-gql-public/no-internal-graphql-when-tagged-with-gql-public.ts"],"names":[],"mappings":";;;;AAAA,oDAAuD;AACvD,+CAAyB;AACzB,mDAA6B;AAE7B,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CAAC,6FAA6F,IAAI,IAAI,IAAI,KAAK,CACvH,CAAC;AAKW,QAAA,wCAAwC,GAAG,UAAU,CAAsB;IACtF,IAAI,EAAE,iDAAiD;IACvD,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,yEAAyE;SACvF;QACD,QAAQ,EAAE;YACR,wBAAwB,EAAE,8EAA8E;SACzG;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MA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EAAE,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;qBAClF,CAAC,CAAC;oBACH,OAAO;gBACT,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QACF,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,EAAE;gBACf,MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;gBACxC,IAAI,cAAc,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;oBAC7C,MAAM,iBAAiB,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;oBAClE,MAAM,WAAW,GAA6B,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;oBAC5E,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;wBAC/E,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;wBAChD,qCAAqC,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;oBACvE,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { ESLintUtils } from \"@typescript-eslint/utils\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`\n);\n\ntype MessageIds = \"internalGraphqlFileFound\";\ntype Options = [];\n\nexport const noInternalGraphqlWhenTaggedWithGqlPublic = createRule<Options, MessageIds>({\n name: \"no-internal-graphql-when-tagged-with-gql-public\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow '-internal.graphql' files in projects tagged with 'gql:public'\",\n },\n messages: {\n internalGraphqlFileFound: \"'*-internal.graphql' file found in a 'gql:public' tagged project. - {{path}}\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n const getLineAndColumnFromPosition = (content: string, position: number) => {\n const lines = content.substring(0, position).split(\"\\n\");\n const line = lines.length;\n const column = lines[lines.length - 1]?.length ?? 0;\n return { line, column };\n };\n\n const checkDirectoryForInternalGraphQLFiles = (directory: string, projectJson: string) => {\n const entries = fs.readdirSync(directory, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = path.join(directory, entry.name);\n\n // Handle broken symlinks or inaccessible paths gracefully\n let stat: fs.Stats;\n try {\n stat = fs.statSync(fullPath);\n } catch {\n // Skip paths that can't be accessed (broken symlinks, permission issues, etc.)\n continue;\n }\n\n if (stat.isDirectory()) {\n checkDirectoryForInternalGraphQLFiles(fullPath, projectJson);\n } else if (entry.name.endsWith(\"-internal.graphql\")) {\n context.report({\n messageId: \"internalGraphqlFileFound\",\n data: { path: fullPath },\n loc: getLineAndColumnFromPosition(projectJson, projectJson.indexOf(\"gql:public\")),\n });\n return;\n }\n }\n };\n return {\n Program: _node => {\n const sourceFilePath = context.filename;\n if (sourceFilePath.endsWith(\"/project.json\")) {\n const projectJsonString = fs.readFileSync(sourceFilePath, \"utf8\");\n const projectJson: { tags?: Array<string> } = JSON.parse(projectJsonString);\n if (Array.isArray(projectJson.tags) && projectJson.tags.includes(\"gql:public\")) {\n const projectDir = path.dirname(sourceFilePath);\n checkDirectoryForInternalGraphQLFiles(projectDir, projectJsonString);\n }\n }\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-jest-mock-trackunit-react-core-hooks.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/no-jest-mock-trackunit-react-core-hooks/no-jest-mock-trackunit-react-core-hooks.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AAEvD,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CACL,6FAA6F,IAAI,IAAI,IAAI,KAAK,CACjH,CAAC;AAKW,QAAA,iCAAiC,GAAG,UAAU,CAAsB;IAC/E,IAAI,EAAE,yCAAyC;IAC/C,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,4DAA4D;SAC1E;QACD,QAAQ,EAAE;YACR,YAAY,EACV,oKAAoK;SACvK;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,cAAc,CAAC,IAAI;gBACjB,IACE,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,kBAAkB;oBACvC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY;oBACxC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;oBAClC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY;oBAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;oBACpC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,SAAS;oBACrC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,6BAA6B,EACzD,CAAC;oBACD,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,cAAc;qBAC1B,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { ESLintUtils } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name =>\n `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`\n);\n\ntype MessageIds = \"noDirectMock\";\ntype Options = [];\n\nexport const noJestMockTrackunitReactCoreHooks = createRule<Options, MessageIds>({\n name: \"no-jest-mock-trackunit-react-core-hooks\",\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow direct jest.mock() of @trackunit/react-core-hooks\",\n },\n messages: {\n noDirectMock:\n 'Don\\'t use jest.mock(\"@trackunit/react-core-hooks\"). Use mock builder from trackunitProviders(), trackunitProvidersInternal() or trackunitProvidersHost() instead.',\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n CallExpression(node) {\n if (\n node.callee.type === \"MemberExpression\" &&\n node.callee.object.type === \"Identifier\" &&\n node.callee.object.name === \"jest\" &&\n node.callee.property.type === \"Identifier\" &&\n node.callee.property.name === \"mock\" &&\n node.arguments[0]?.type === \"Literal\" &&\n node.arguments[0].value === \"@trackunit/react-core-hooks\"\n ) {\n context.report({\n node,\n messageId: \"noDirectMock\",\n });\n }\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-template-strings-in-classname-prop.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/no-template-strings-in-classname-prop/no-template-strings-in-classname-prop.ts"],"names":[],"mappings":";;;AAAA,oDAAiF;AACjF,iEAAmE;AAEnE,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CAAC,6FAA6F,IAAI,KAAK,CAC/G,CAAC;AAKF;;;;;;;;;;;GAWG;AACU,QAAA,4BAA4B,GAAG,UAAU,CAAsB;IAC1E,IAAI,EAAE,uCAAuC;IAC7C,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,8FAA8F;SAC5G;QACD,QAAQ,EAAE;YACR,yBAAyB,EACvB,+LAA+L;SAClM;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL;;;;;;eAMG;YACH,YAAY,CAAC,IAA2B;gBACtC,8DAA8D;gBAC9D,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,aAAa,IAAI,CAAC,IAAA,sCAAoB,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC7F,OAAO;gBACT,CAAC;gBAED,yEAAyE;gBACzE,IACE,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,sBAAc,CAAC,sBAAsB;oBAC1D,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,sBAAc,CAAC,eAAe,EAC7D,CAAC;oBACD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,2BAA2B,EAAE,CAAC,CAAC;gBACnE,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { AST_NODE_TYPES, ESLintUtils, TSESTree } from \"@typescript-eslint/utils\";\nimport { isClassnameAttribute } from \"../../utils/classname-utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}.ts`\n);\n\ntype MessageIds = \"templateStringInClassName\";\ntype Options = [];\n\n/**\n * ESLint rule to disallow template strings in className prop.\n *\n * @example\n * // Bad\n * <div className={`${dynamicClass} staticClass`}>Content</div>\n *\n * // Good\n * <div className={twMerge(dynamicClassName, \"staticClassName\")}>Content</div>\n * // or\n * <div className={yourCvaMergeFunction({ yourVariantProp, className: \"extraClassName\" })}>Content</div>\n */\nexport const noTemplateStringsInClassName = createRule<Options, MessageIds>({\n name: \"no-template-strings-in-classname-prop\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Disallow the use of template strings in className prop to encourage better class management.\",\n },\n messages: {\n templateStringInClassName:\n \"Do not use template strings in className prop. If you wish to merge classes from different sources, use twMerge() for simple inline merging or make a cvaMerge() function if it has variants.\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n /**\n * Handle JSXAttribute with className prop that uses template strings.\n *\n * @example\n * // Bad\n * <div className={`${dynamicClass} staticClass`}>Content</div>\n */\n JSXAttribute(node: TSESTree.JSXAttribute) {\n // Check if this is a classname attribute (className or class)\n if (node.name.type !== AST_NODE_TYPES.JSXIdentifier || !isClassnameAttribute(node.name.name)) {\n return;\n }\n\n // Check if the value is a template literal in a JSX expression container\n if (\n node.value?.type === AST_NODE_TYPES.JSXExpressionContainer &&\n node.value.expression.type === AST_NODE_TYPES.TemplateLiteral\n ) {\n context.report({ node, messageId: \"templateStringInClassName\" });\n }\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-typescript-assertion.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/no-typescript-assertion/no-typescript-assertion.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,oDAAiF;AAEjF,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CAAC,6FAA6F,IAAI,IAAI,IAAI,KAAK,CACvH,CAAC;AAKF,SAAS,sBAAsB,CAAC,cAAiC;IAC/D,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAc,CAAC,gBAAgB,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAc,CAAC,eAAe,EAAE,CAAC;QAC3D,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC;QACpC,IAAI,QAAQ,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC7E,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAEY,QAAA,qBAAqB,GAAG,UAAU,CAAsB;IACnE,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,qEAAqE;SACnF;QACD,QAAQ,EAAE;YACR,qBAAqB,EAAE,wEAAwE;YAC/F,WAAW,EAAE,2EAA2E;YACxF,gBAAgB,EAAE,iFAAiF;SACpG;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,eAAe,CAAC,IAA8B;gBAC5C,IAAI,sBAAsB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;oBAChD,OAAO;gBACT,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAAC;YAC/D,CAAC;YACD,cAAc,CAAC,IAA6B;gBAC1C,IAAI,sBAAsB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;oBAChD,OAAO;gBACT,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;YACrD,CAAC;YACD,mBAAmB,CAAC,IAAkC;gBACpD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAC1D,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["/**\n * ESLint rule to disallow type assertions in TypeScript.\n * Initial implementation based on eslint-plugin-no-type-assertion\n * https://github.com/Dremora/eslint-plugin-no-type-assertion/blob/master/lib/rules/no-type-assertion.js\n *\n * @example\n * // Bad - type assertions bypass type checking\n * const foo = <string> bar;\n * const baz = bar as string;\n * const qux = bar!;\n *\n * // Good - proper typing or const assertions\n * const foo = bar;\n * const options = [\"a\", \"b\"] as const;\n */\nimport { AST_NODE_TYPES, ESLintUtils, TSESTree } from \"@typescript-eslint/utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`\n);\n\ntype MessageIds = \"angleBracketAssertion\" | \"asAssertion\" | \"nonNullAssertion\";\ntype Options = [];\n\nfunction isAllowedTypeAssertion(typeAnnotation: TSESTree.TypeNode): boolean {\n if (typeAnnotation.type === AST_NODE_TYPES.TSUnknownKeyword) {\n return true;\n }\n if (typeAnnotation.type === AST_NODE_TYPES.TSTypeReference) {\n const { typeName } = typeAnnotation;\n if (typeName.type === AST_NODE_TYPES.Identifier && typeName.name === \"const\") {\n return true;\n }\n }\n return false;\n}\n\nexport const noTypescriptAssertion = createRule<Options, MessageIds>({\n name: \"no-typescript-assertion\",\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"Prevent the use of type assertions to encourage better type safety.\",\n },\n messages: {\n angleBracketAssertion: \"Avoid using angle bracket for type casting. It bypasses type checking.\",\n asAssertion: \"Avoid using the `as` keyword for type casting. It bypasses type checking.\",\n nonNullAssertion: \"Avoid using the non-null assertion operator (!). It can lead to runtime errors.\",\n },\n schema: [],\n },\n defaultOptions: [],\n create(context) {\n return {\n TSTypeAssertion(node: TSESTree.TSTypeAssertion) {\n if (isAllowedTypeAssertion(node.typeAnnotation)) {\n return;\n }\n context.report({ node, messageId: \"angleBracketAssertion\" });\n },\n TSAsExpression(node: TSESTree.TSAsExpression) {\n if (isAllowedTypeAssertion(node.typeAnnotation)) {\n return;\n }\n context.report({ node, messageId: \"asAssertion\" });\n },\n TSNonNullExpression(node: TSESTree.TSNonNullExpression) {\n context.report({ node, messageId: \"nonNullAssertion\" });\n },\n };\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"one-component-per-file.js","sourceRoot":"","sources":["../../../../../../../../libs/eslint/plugin-trackunit/src/lib/rules/one-component-per-file/one-component-per-file.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,oDAAuD;AACvD,iEAAyE;AAEzE,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,IAAI,CAAC,EAAE,CAAC,6FAA6F,IAAI,IAAI,IAAI,KAAK,CACvH,CAAC;AAMW,QAAA,mBAAmB,GAAG,UAAU,CAAsB;IACjE,IAAI,EAA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YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["/**\n * ESLint rule: one-component-per-file\n *\n * Enforces that each file contains at most one React component.\n *\n * Default mode (`exportedOnly: true`): only one exported component is allowed.\n * Internal/private components are fine.\n *\n * Strict mode (`exportedOnly: false`): only one component total, regardless of\n * whether it is exported.\n *\n * @example\n * // Bad (default) β€” two exported components\n * export function Foo() { return <div />; }\n * export function Bar() { return <span />; }\n *\n * // Good (default) β€” one exported, one internal\n * function InternalHelper() { return <span />; }\n * export function Foo() { return <div><InternalHelper /></div>; }\n */\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { createComponentFileTracker } from \"../../utils/component-utils\";\n\nconst createRule = ESLintUtils.RuleCreator(\n name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}/${name}.ts`\n);\n\ntype MessageIds = \"tooManyExported\" | \"tooManyComponents\";\n\ntype Options = [{ exportedOnly?: boolean }];\n\nexport const oneComponentPerFile = createRule<Options, MessageIds>({\n name: \"one-component-per-file\",\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Enforce that each file contains at most one React component. \" +\n \"Use exportedOnly: false to also disallow multiple non-exported components.\",\n },\n messages: {\n tooManyExported: \"Only one component should be exported per file. Move this component to its own file.\",\n tooManyComponents: \"Only one component is allowed per file. Move this component to its own file.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n exportedOnly: {\n type: \"boolean\",\n description:\n \"When true (default), only exported components are counted. \" +\n \"When false, all components in the file count toward the limit.\",\n },\n },\n additionalProperties: false,\n },\n ],\n },\n defaultOptions: [{ exportedOnly: true }],\n create(context, [{ exportedOnly = true }]) {\n const tracker = createComponentFileTracker();\n\n return {\n FunctionDeclaration: tracker.onFunctionDeclaration,\n VariableDeclarator: tracker.onVariableDeclarator,\n ExportNamedDeclaration: tracker.onExportNamedDeclaration,\n ExportDefaultDeclaration: tracker.onExportDefaultDeclaration,\n\n \"Program:exit\"() {\n const components = exportedOnly ? tracker.getExportedComponents() : tracker.getAllComponents();\n\n if (components.length <= 1) return;\n\n const messageId: MessageIds = exportedOnly ? \"tooManyExported\" : \"tooManyComponents\";\n\n for (const { node } of components.slice(1)) {\n context.report({ node, messageId });\n }\n },\n };\n },\n});\n"]}