@trackunit/eslint-plugin-trackunit 0.6.185-alpha-07efa4379b2.0 β†’ 0.6.188

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,45 @@
1
+ ## 0.6.188 (2026-10-26)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated css-classname-utils to 0.0.89
6
+ - Updated shared-utils to 1.22.8
7
+
8
+ ## 0.6.187 (2026-10-26)
9
+
10
+ ### πŸš€ Features
11
+
12
+ - ⚠️ **react-components:** add @trackunit/react-router-components and move router-coupled code into it [DS-254] ([#26433](https://github.com/Trackunit/manager/pull/26433), [#26290](https://github.com/Trackunit/manager/issues/26290), [#26292](https://github.com/Trackunit/manager/issues/26292), [#26452](https://github.com/Trackunit/manager/issues/26452), [#26458](https://github.com/Trackunit/manager/issues/26458), [#26487](https://github.com/Trackunit/manager/issues/26487), [#26601](https://github.com/Trackunit/manager/issues/26601), [#26363](https://github.com/Trackunit/manager/issues/26363))
13
+
14
+ ### ⚠️ Breaking Changes
15
+
16
+ - **react-components:** add @trackunit/react-router-components and move router-coupled code into it [DS-254] ([#26433](https://github.com/Trackunit/manager/pull/26433), [#26290](https://github.com/Trackunit/manager/issues/26290), [#26292](https://github.com/Trackunit/manager/issues/26292), [#26452](https://github.com/Trackunit/manager/issues/26452), [#26458](https://github.com/Trackunit/manager/issues/26458), [#26487](https://github.com/Trackunit/manager/issues/26487), [#26601](https://github.com/Trackunit/manager/issues/26601), [#26363](https://github.com/Trackunit/manager/issues/26363))
17
+
18
+ ### 🧱 Updated Dependencies
19
+
20
+ - Updated css-classname-utils to 0.0.88
21
+ - Updated shared-utils to 1.22.7
22
+
23
+ ### ❀️ Thank You
24
+
25
+ - Claude
26
+ - Cursor @cursoragent
27
+ - Michael Buss RΓΈnne @man-trackunit
28
+
29
+ ## 0.6.186 (2026-10-26)
30
+
31
+ ### 🧱 Updated Dependencies
32
+
33
+ - Updated css-classname-utils to 0.0.87
34
+ - Updated shared-utils to 1.22.6
35
+
36
+ ## 0.6.185 (2026-10-25)
37
+
38
+ ### 🧱 Updated Dependencies
39
+
40
+ - Updated css-classname-utils to 0.0.86
41
+ - Updated shared-utils to 1.22.5
42
+
1
43
  ## 0.6.184 (2026-10-23)
2
44
 
3
45
  ### 🧱 Updated Dependencies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/eslint-plugin-trackunit",
3
- "version": "0.6.185-alpha-07efa4379b2.0",
3
+ "version": "0.6.188",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "repository": "https://github.com/Trackunit/manager",
6
6
  "engines": {
@@ -8,9 +8,9 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@nx/eslint-plugin": "23.1.0",
11
- "@trackunit/css-classname-utils": "0.0.86-alpha-07efa4379b2.0",
12
- "@typescript-eslint/eslint-plugin": "8.71.1",
13
- "@typescript-eslint/utils": "8.71.1",
11
+ "@trackunit/css-classname-utils": "0.0.89",
12
+ "@typescript-eslint/eslint-plugin": "8.71.2",
13
+ "@typescript-eslint/utils": "8.71.2",
14
14
  "eslint-config-prettier": "^10.1.8",
15
15
  "eslint-plugin-import": "2.32.0",
16
16
  "eslint-plugin-jest": "^29.15.2",
package/src/index.d.ts CHANGED
@@ -5,6 +5,6 @@ export { createSkipWhen } from "./lib/config-helpers/create-skip-when";
5
5
  export { findMonorepoRoot } from "./lib/config/utils";
6
6
  export type { MatchCriteria, ProjectMetadata } from "./lib/utils/nx-utils";
7
7
  export { strictJsdocRules } from "./lib/config/fragments/jsdoc-rules";
8
- export { restrictedImportRules } from "./lib/config/fragments/restricted-imports";
8
+ export { publishedLibRestrictedImports, restrictedImportRules } from "./lib/config/fragments/restricted-imports";
9
9
  export { storyFileGlobs, storyRelaxations } from "./lib/config/fragments/story-relaxations";
10
10
  export { globals, jsdoc, localRulesPlugin, nx, reactHooks, storybookPlugin, tsParser } from "./lib/config/plugins";
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tsParser = exports.storybookPlugin = exports.reactHooks = exports.nx = exports.localRulesPlugin = exports.jsdoc = exports.globals = exports.storyRelaxations = exports.storyFileGlobs = exports.restrictedImportRules = exports.strictJsdocRules = exports.findMonorepoRoot = exports.createSkipWhen = exports.configs = void 0;
3
+ exports.tsParser = exports.storybookPlugin = exports.reactHooks = exports.nx = exports.localRulesPlugin = exports.jsdoc = exports.globals = exports.storyRelaxations = exports.storyFileGlobs = exports.restrictedImportRules = exports.publishedLibRestrictedImports = exports.strictJsdocRules = exports.findMonorepoRoot = exports.createSkipWhen = exports.configs = void 0;
4
4
  const rules_map_1 = require("./lib/rules-map");
5
5
  exports.default = rules_map_1.rulesMap;
6
6
  var config_1 = require("./lib/config");
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "findMonorepoRoot", { enumerable: true, get: func
12
12
  var jsdoc_rules_1 = require("./lib/config/fragments/jsdoc-rules");
13
13
  Object.defineProperty(exports, "strictJsdocRules", { enumerable: true, get: function () { return jsdoc_rules_1.strictJsdocRules; } });
14
14
  var restricted_imports_1 = require("./lib/config/fragments/restricted-imports");
15
+ Object.defineProperty(exports, "publishedLibRestrictedImports", { enumerable: true, get: function () { return restricted_imports_1.publishedLibRestrictedImports; } });
15
16
  Object.defineProperty(exports, "restrictedImportRules", { enumerable: true, get: function () { return restricted_imports_1.restrictedImportRules; } });
16
17
  var story_relaxations_1 = require("./lib/config/fragments/story-relaxations");
17
18
  Object.defineProperty(exports, "storyFileGlobs", { enumerable: true, get: function () { return story_relaxations_1.storyFileGlobs; } });
@@ -1,2 +1,12 @@
1
1
  import type { Linter } from "eslint";
2
2
  export declare const restrictedImportRules: Linter.RulesRecord;
3
+ /**
4
+ * `no-restricted-imports` for `publish:npm` libs: the repo-wide restrictions plus a ban on direct
5
+ * `@tanstack/react-router` imports. ESLint replaces rule options rather than merging them, so the
6
+ * router entry is composed into the same option list instead of being a second rule entry.
7
+ *
8
+ * To exempt a lib (or some of its files), add a later per-lib override that re-applies
9
+ * `restrictedImportRules`, which keeps every other restriction:
10
+ * `{ files: [...], rules: restrictedImportRules }`.
11
+ */
12
+ export declare const publishedLibRestrictedImports: Linter.Config;
@@ -1,75 +1,110 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.restrictedImportRules = void 0;
3
+ exports.publishedLibRestrictedImports = exports.restrictedImportRules = void 0;
4
+ const restrictedImportPaths = [
5
+ {
6
+ name: "react-dom/test-utils",
7
+ message: "Please use 'act' from the @testing-library/react instead.",
8
+ },
9
+ {
10
+ name: "react-i18next",
11
+ importNames: ["useTranslation"],
12
+ message: "Please import useTranslation from @trackunit/i18n-manager-translation instead.",
13
+ },
14
+ {
15
+ name: "react-i18next",
16
+ importNames: ["Trans"],
17
+ message: "Please import Trans from @trackunit/i18n-manager-translation instead.",
18
+ },
19
+ {
20
+ name: "@apollo/client",
21
+ importNames: ["useQuery", "useLazyQuery"],
22
+ message: "Please import the same from @trackunit/react-graphql-hooks instead, to ensure loading state is handled correctly.",
23
+ },
24
+ {
25
+ name: "@nx/plugin/testing",
26
+ message: "Please import it from @trackunit/nx-utils instead or expose it from that lib.",
27
+ },
28
+ {
29
+ name: "vite-tsconfig-paths",
30
+ message: "Import workspace path helpers from workspace-vite-config instead.",
31
+ },
32
+ {
33
+ name: "@nx/vite/plugins/nx-tsconfig-paths.plugin",
34
+ message: "Deprecated β€” import workspace path helpers from workspace-vite-config instead.",
35
+ },
36
+ {
37
+ name: "@nx/vite",
38
+ importNames: ["nxViteTsPaths"],
39
+ message: "Deprecated β€” import workspace path helpers from workspace-vite-config instead.",
40
+ },
41
+ {
42
+ name: "@heroicons/react/20/solid",
43
+ message: "Please use the Icon component from react-components instead.",
44
+ },
45
+ {
46
+ name: "@heroicons/react/24/outline",
47
+ message: "Please use the Icon component from react-components instead.",
48
+ },
49
+ {
50
+ name: "cva",
51
+ message: "Import cva/cx from @trackunit/css-class-variance-utilities instead. Ours are bound to a config whose onComplete hook runs every generated class string through tailwind-merge; the raw ones only concatenate, so conflicting utilities would both survive.",
52
+ },
53
+ {
54
+ name: "class-variance-authority",
55
+ message: "Removed β€” import cva/cx from @trackunit/css-class-variance-utilities instead. The old package is no longer a dependency.",
56
+ },
57
+ ];
58
+ const restrictedImportPatterns = [
59
+ {
60
+ group: ["date-fns*"],
61
+ message: "Please use @trackunit/date-and-time-utils or @trackunit/date-and-time-hooks instead.",
62
+ },
63
+ {
64
+ group: ["date-fns-tz*"],
65
+ message: "Please use @trackunit/date-and-time-utils or @trackunit/date-and-time-hooks instead.",
66
+ },
67
+ ];
4
68
  exports.restrictedImportRules = {
5
- "no-restricted-imports": [
6
- "error",
7
- {
8
- paths: [
9
- {
10
- name: "react-dom/test-utils",
11
- message: "Please use 'act' from the @testing-library/react instead.",
12
- },
13
- {
14
- name: "react-i18next",
15
- importNames: ["useTranslation"],
16
- message: "Please import useTranslation from @trackunit/i18n-manager-translation instead.",
17
- },
18
- {
19
- name: "react-i18next",
20
- importNames: ["Trans"],
21
- message: "Please import Trans from @trackunit/i18n-manager-translation instead.",
22
- },
23
- {
24
- name: "@apollo/client",
25
- importNames: ["useQuery", "useLazyQuery"],
26
- message: "Please import the same from @trackunit/react-graphql-hooks instead, to ensure loading state is handled correctly.",
27
- },
28
- {
29
- name: "@nx/plugin/testing",
30
- message: "Please import it from @trackunit/nx-utils instead or expose it from that lib.",
31
- },
32
- {
33
- name: "vite-tsconfig-paths",
34
- message: "Import workspace path helpers from workspace-vite-config instead.",
35
- },
36
- {
37
- name: "@nx/vite/plugins/nx-tsconfig-paths.plugin",
38
- message: "Deprecated β€” import workspace path helpers from workspace-vite-config instead.",
39
- },
40
- {
41
- name: "@nx/vite",
42
- importNames: ["nxViteTsPaths"],
43
- message: "Deprecated β€” import workspace path helpers from workspace-vite-config instead.",
44
- },
45
- {
46
- name: "@heroicons/react/20/solid",
47
- message: "Please use the Icon component from react-components instead.",
48
- },
49
- {
50
- name: "@heroicons/react/24/outline",
51
- message: "Please use the Icon component from react-components instead.",
52
- },
53
- {
54
- name: "cva",
55
- message: "Import cva/cx from @trackunit/css-class-variance-utilities instead. Ours are bound to a config whose onComplete hook runs every generated class string through tailwind-merge; the raw ones only concatenate, so conflicting utilities would both survive.",
56
- },
57
- {
58
- name: "class-variance-authority",
59
- message: "Removed β€” import cva/cx from @trackunit/css-class-variance-utilities instead. The old package is no longer a dependency.",
60
- },
61
- ],
62
- patterns: [
63
- {
64
- group: ["date-fns*"],
65
- message: "Please use @trackunit/date-and-time-utils or @trackunit/date-and-time-hooks instead.",
66
- },
67
- {
68
- group: ["date-fns-tz*"],
69
- message: "Please use @trackunit/date-and-time-utils or @trackunit/date-and-time-hooks instead.",
70
- },
71
- ],
72
- },
73
- ],
69
+ "no-restricted-imports": ["error", { paths: restrictedImportPaths, patterns: restrictedImportPatterns }],
70
+ };
71
+ // No `importNames`: the core rule then also reports `import type`, which would otherwise leak
72
+ // router types into the published `.d.ts`.
73
+ const routerRestrictedImportPath = {
74
+ name: "@tanstack/react-router",
75
+ message: "Direct @tanstack/react-router imports (including type-only imports) are not allowed in published libs. Use or add the hook/component in @trackunit/react-router-components instead.",
76
+ };
77
+ /**
78
+ * Files that published libs exclude from their build (`tsconfig.lib.json`), so a router import
79
+ * there never reaches consumers.
80
+ */
81
+ const nonShippedFileGlobs = [
82
+ "**/*.spec.*",
83
+ "**/*.test.*",
84
+ "**/*.stories.*",
85
+ "**/*.demo.*",
86
+ "**/test/**",
87
+ "**/__tests__/**",
88
+ "**/__mocks__/**",
89
+ "**/.storybook/**",
90
+ ];
91
+ /**
92
+ * `no-restricted-imports` for `publish:npm` libs: the repo-wide restrictions plus a ban on direct
93
+ * `@tanstack/react-router` imports. ESLint replaces rule options rather than merging them, so the
94
+ * router entry is composed into the same option list instead of being a second rule entry.
95
+ *
96
+ * To exempt a lib (or some of its files), add a later per-lib override that re-applies
97
+ * `restrictedImportRules`, which keeps every other restriction:
98
+ * `{ files: [...], rules: restrictedImportRules }`.
99
+ */
100
+ exports.publishedLibRestrictedImports = {
101
+ files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
102
+ ignores: nonShippedFileGlobs,
103
+ rules: {
104
+ "no-restricted-imports": [
105
+ "error",
106
+ { paths: [...restrictedImportPaths, routerRestrictedImportPath], patterns: restrictedImportPatterns },
107
+ ],
108
+ },
74
109
  };
75
110
  //# sourceMappingURL=restricted-imports.js.map