@comet/eslint-config 8.17.1 → 9.0.0-beta.0

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,5 +1,26 @@
1
1
  # @comet/eslint-config
2
2
 
3
+ ## 9.0.0-beta.0
4
+
5
+ ### Major Changes
6
+
7
+ - db6b83a: Prevent lib imports from `@comet/` packages
8
+
9
+ Use `no-restricted-imports` to prevent importing private files from `@comet/*/lib`. For example, the following import would be forbidden:
10
+
11
+ ```ts
12
+ import { something } from "@comet/admin/lib/some/private/file";
13
+ ```
14
+
15
+ - 740dba8: Bump Next.js peer dependency to v16
16
+
17
+ 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.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [db6b83a]
22
+ - @comet/eslint-plugin@9.0.0-beta.0
23
+
3
24
  ## 8.17.1
4
25
 
5
26
  ### Patch Changes
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 globals from "globals";
4
4
  import nextPlugin from "@next/eslint-plugin-next";
@@ -29,6 +29,7 @@ const config = [
29
29
  "error",
30
30
  {
31
31
  paths: restrictedImportPaths,
32
+ patterns: restrictedImportPatterns,
32
33
  },
33
34
  ],
34
35
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/eslint-config",
3
- "version": "8.17.1",
3
+ "version": "9.0.0-beta.0",
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.17.1"
53
+ "@comet/eslint-plugin": "9.0.0-beta.0"
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
  },