@comet/eslint-config 8.20.2 → 9.0.0-beta.1

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,17 +1,32 @@
1
1
  # @comet/eslint-config
2
2
 
3
- ## 8.20.2
3
+ ## 9.0.0-beta.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - bd884f5: Fix missing Rules of React in `@comet/eslint-config/nextjs.js`
8
- - @comet/eslint-plugin@8.20.2
7
+ - 4b1d586: Fix missing Rules of React in `@comet/eslint-config/nextjs.js`
8
+ - @comet/eslint-plugin@9.0.0-beta.1
9
9
 
10
- ## 8.20.1
10
+ ## 9.0.0-beta.0
11
+
12
+ ### Major Changes
13
+
14
+ - db6b83a: Prevent lib imports from `@comet/` packages
15
+
16
+ Use `no-restricted-imports` to prevent importing private files from `@comet/*/lib`. For example, the following import would be forbidden:
17
+
18
+ ```ts
19
+ import { something } from "@comet/admin/lib/some/private/file";
20
+ ```
21
+
22
+ - 740dba8: Bump Next.js peer dependency to v16
23
+
24
+ Follow the official migration guides ([v15](https://nextjs.org/docs/app/guides/upgrading/version-15), [v16](https://nextjs.org/docs/app/guides/upgrading/version-16)) to upgrade.
11
25
 
12
26
  ### Patch Changes
13
27
 
14
- - @comet/eslint-plugin@8.20.1
28
+ - Updated dependencies [db6b83a]
29
+ - @comet/eslint-plugin@9.0.0-beta.0
15
30
 
16
31
  ## 8.20.0
17
32
 
package/core.js CHANGED
@@ -11,6 +11,13 @@ import importPlugin from "eslint-plugin-import";
11
11
  import js from "@eslint/js";
12
12
  import packageJson from "eslint-plugin-package-json";
13
13
 
14
+ export const restrictedImportPatterns = [
15
+ {
16
+ group: ["@comet/*/lib", "@comet/*/lib/**"],
17
+ message: "Don't import private files from @comet packages via /lib. Use the package root instead.",
18
+ },
19
+ ];
20
+
14
21
  /** @type {import('eslint')} */
15
22
  const config = [
16
23
  js.configs.recommended,
@@ -92,6 +99,12 @@ const config = [
92
99
  "prefer-template": "error",
93
100
  "no-console": ["error", { allow: ["warn", "error"] }],
94
101
  "no-return-await": "error",
102
+ "no-restricted-imports": [
103
+ "error",
104
+ {
105
+ patterns: restrictedImportPatterns,
106
+ },
107
+ ],
95
108
  "@typescript-eslint/no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }],
96
109
  "@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
97
110
  "@typescript-eslint/prefer-enum-initializers": "error",
package/future/nestjs.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import nestjsConfig from "../nestjs.js";
2
+ import { restrictedImportPatterns } from "../core.js";
2
3
 
3
4
  export const restrictedImportPaths = [
4
5
  {
@@ -16,6 +17,7 @@ const config = [
16
17
  "error",
17
18
  {
18
19
  paths: restrictedImportPaths,
20
+ patterns: restrictedImportPatterns,
19
21
  },
20
22
  ],
21
23
  },
package/future/nextjs.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import nextjsConfig, { restrictedImportPaths as baseRestrictedImportPaths } from "../nextjs.js";
2
+ import { restrictedImportPatterns } from "../core.js";
2
3
 
3
4
  export const restrictedImportPaths = [
4
5
  ...baseRestrictedImportPaths,
@@ -17,6 +18,7 @@ const config = [
17
18
  "error",
18
19
  {
19
20
  paths: restrictedImportPaths,
21
+ patterns: restrictedImportPatterns,
20
22
  },
21
23
  ],
22
24
  },
package/nextjs.js CHANGED
@@ -1,4 +1,4 @@
1
- import coreConfig from "./core.js";
1
+ import coreConfig, { restrictedImportPatterns } from "./core.js";
2
2
  import react from "eslint-plugin-react";
3
3
  import reactHooks from "eslint-plugin-react-hooks";
4
4
  import globals from "globals";
@@ -30,6 +30,7 @@ const config = [
30
30
  "error",
31
31
  {
32
32
  paths: restrictedImportPaths,
33
+ patterns: restrictedImportPatterns,
33
34
  },
34
35
  ],
35
36
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/eslint-config",
3
- "version": "8.20.2",
3
+ "version": "9.0.0-beta.1",
4
4
  "description": "A set of ESLint configurations for Comet projects",
5
5
  "repository": {
6
6
  "directory": "packages/eslint-config",
@@ -50,7 +50,7 @@
50
50
  "globals": "^15.15.0",
51
51
  "npm-run-all2": "^8.0.4",
52
52
  "typescript-eslint": "^8.53.0",
53
- "@comet/eslint-plugin": "8.20.2"
53
+ "@comet/eslint-plugin": "9.0.0-beta.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "eslint": "^9.39.2",
package/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import coreConfig from "./core.js";
1
+ import coreConfig, { restrictedImportPatterns } from "./core.js";
2
2
  import reactIntlFormatPlugin from "@calm/eslint-plugin-react-intl";
3
3
  import globals from "globals";
4
4
  import formatJs from "eslint-plugin-formatjs";
@@ -111,6 +111,7 @@ const config = [
111
111
  "error",
112
112
  {
113
113
  paths: restrictedImportPaths,
114
+ patterns: restrictedImportPatterns,
114
115
  },
115
116
  ],
116
117
  },