@comet/eslint-config 9.0.0-canary-20251211112608 → 9.0.0-canary-20251222112948
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 +8 -2
- package/future/nestjs.js +25 -0
- package/future/nextjs.js +26 -0
- package/future/react.js +1 -0
- package/nextjs.js +13 -11
- package/package.json +8 -2
- package/react.js +41 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @comet/eslint-config
|
|
2
2
|
|
|
3
|
-
## 9.0.0-canary-
|
|
3
|
+
## 9.0.0-canary-20251222112948
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
@@ -10,11 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
### Minor Changes
|
|
12
12
|
|
|
13
|
+
- e5427a0: Future: Ban `node-cache` because it's unmaintained
|
|
14
|
+
|
|
15
|
+
Introduce a new rule in `future/nestjs` and `future/nextjs` that bans importing `node-cache` and recommends `cache-manager` / `@cacheable/node-cache` / `@nestjs/cache-manager` instead.
|
|
16
|
+
|
|
17
|
+
This rule is now in the future configs and will be enforced generally in v9.
|
|
18
|
+
|
|
13
19
|
- 9d5e331: Enable `@typescript-eslint/consistent-type-exports` in `@comet/eslint-config/future/react.js`
|
|
14
20
|
|
|
15
21
|
### Patch Changes
|
|
16
22
|
|
|
17
|
-
- @comet/eslint-plugin@9.0.0-canary-
|
|
23
|
+
- @comet/eslint-plugin@9.0.0-canary-20251222112948
|
|
18
24
|
|
|
19
25
|
## 8.10.0
|
|
20
26
|
|
package/future/nestjs.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import nestjsConfig from "../nestjs.js";
|
|
2
|
+
|
|
3
|
+
export const restrictedImportPaths = [
|
|
4
|
+
{
|
|
5
|
+
name: "node-cache",
|
|
6
|
+
message: "node-cache is abandonware. Use @nestjs/cache-manager instead",
|
|
7
|
+
},
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
/** @type {import('eslint')} */
|
|
11
|
+
const config = [
|
|
12
|
+
...nestjsConfig,
|
|
13
|
+
{
|
|
14
|
+
rules: {
|
|
15
|
+
"no-restricted-imports": [
|
|
16
|
+
"error",
|
|
17
|
+
{
|
|
18
|
+
paths: restrictedImportPaths,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export default config;
|
package/future/nextjs.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import nextjsConfig, { restrictedImportPaths as baseRestrictedImportPaths } from "../nextjs.js";
|
|
2
|
+
|
|
3
|
+
export const restrictedImportPaths = [
|
|
4
|
+
...baseRestrictedImportPaths,
|
|
5
|
+
{
|
|
6
|
+
name: "node-cache",
|
|
7
|
+
message: "node-cache is abandonware. Use cache-manager or @cacheable/node-cache instead",
|
|
8
|
+
},
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
/** @type {import('eslint')} */
|
|
12
|
+
const config = [
|
|
13
|
+
...nextjsConfig,
|
|
14
|
+
{
|
|
15
|
+
rules: {
|
|
16
|
+
"no-restricted-imports": [
|
|
17
|
+
"error",
|
|
18
|
+
{
|
|
19
|
+
paths: restrictedImportPaths,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export default config;
|
package/future/react.js
CHANGED
package/nextjs.js
CHANGED
|
@@ -3,6 +3,18 @@ import react from "eslint-plugin-react";
|
|
|
3
3
|
import globals from "globals";
|
|
4
4
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
5
5
|
|
|
6
|
+
export const restrictedImportPaths = [
|
|
7
|
+
{
|
|
8
|
+
name: "react",
|
|
9
|
+
importNames: ["default"],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "next/image",
|
|
13
|
+
importNames: ["default"],
|
|
14
|
+
message: "Please use Image from @comet/site-nextjs instead",
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
|
|
6
18
|
/** @type {import('eslint')} */
|
|
7
19
|
const config = [
|
|
8
20
|
...coreConfig,
|
|
@@ -16,17 +28,7 @@ const config = [
|
|
|
16
28
|
"no-restricted-imports": [
|
|
17
29
|
"error",
|
|
18
30
|
{
|
|
19
|
-
paths:
|
|
20
|
-
{
|
|
21
|
-
name: "react",
|
|
22
|
-
importNames: ["default"],
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "next/image",
|
|
26
|
-
importNames: ["default"],
|
|
27
|
-
message: "Please use Image from @comet/site-nextjs instead",
|
|
28
|
-
},
|
|
29
|
-
],
|
|
31
|
+
paths: restrictedImportPaths,
|
|
30
32
|
},
|
|
31
33
|
],
|
|
32
34
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/eslint-config",
|
|
3
|
-
"version": "9.0.0-canary-
|
|
3
|
+
"version": "9.0.0-canary-20251222112948",
|
|
4
4
|
"description": "A set of ESLint configurations for Comet projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/eslint-config",
|
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
"./core.js": {
|
|
14
14
|
"import": "./core.js"
|
|
15
15
|
},
|
|
16
|
+
"./future/nestjs.js": {
|
|
17
|
+
"import": "./future/nestjs.js"
|
|
18
|
+
},
|
|
19
|
+
"./future/nextjs.js": {
|
|
20
|
+
"import": "./future/nextjs.js"
|
|
21
|
+
},
|
|
16
22
|
"./future/react.js": {
|
|
17
23
|
"import": "./future/react.js"
|
|
18
24
|
},
|
|
@@ -44,7 +50,7 @@
|
|
|
44
50
|
"globals": "^15.15.0",
|
|
45
51
|
"npm-run-all2": "^8.0.0",
|
|
46
52
|
"typescript-eslint": "^8.24.1",
|
|
47
|
-
"@comet/eslint-plugin": "9.0.0-canary-
|
|
53
|
+
"@comet/eslint-plugin": "9.0.0-canary-20251222112948"
|
|
48
54
|
},
|
|
49
55
|
"devDependencies": {
|
|
50
56
|
"eslint": "^9.30.1",
|
package/react.js
CHANGED
|
@@ -8,6 +8,46 @@ import reactHooks from "eslint-plugin-react-hooks";
|
|
|
8
8
|
|
|
9
9
|
const cometAdminImportsRestrictedFromMuiMaterial = ["Alert", "Button", "Dialog", "Tooltip"];
|
|
10
10
|
|
|
11
|
+
export const restrictedImportPaths = [
|
|
12
|
+
...cometAdminImportsRestrictedFromMuiMaterial.map((name) => ({
|
|
13
|
+
name: "@mui/material",
|
|
14
|
+
importNames: [name],
|
|
15
|
+
message: `Please use ${name} from @comet/admin instead`,
|
|
16
|
+
})),
|
|
17
|
+
...cometAdminImportsRestrictedFromMuiMaterial.map((name) => ({
|
|
18
|
+
name: `@mui/material/${name}`,
|
|
19
|
+
message: `Please use ${name} from @comet/admin instead`,
|
|
20
|
+
})),
|
|
21
|
+
{
|
|
22
|
+
name: "react",
|
|
23
|
+
importNames: ["default"],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "@mui/material",
|
|
27
|
+
importNames: ["styled"],
|
|
28
|
+
message: "Please use styled from @mui/material/styles instead.",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "@mui/icons-material",
|
|
32
|
+
message: "Please use @comet/admin-icons instead",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "@mui/x-data-grid",
|
|
36
|
+
importNames: ["GridColDef"],
|
|
37
|
+
message: "Please use GridColDef from @comet/admin instead",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "@mui/x-data-grid-pro",
|
|
41
|
+
importNames: ["GridColDef"],
|
|
42
|
+
message: "Please use GridColDef from @comet/admin instead",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "@mui/x-data-grid-premium",
|
|
46
|
+
importNames: ["GridColDef"],
|
|
47
|
+
message: "Please use GridColDef from @comet/admin instead",
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
11
51
|
/** @type {import('eslint')} */
|
|
12
52
|
const config = [
|
|
13
53
|
...coreConfig,
|
|
@@ -70,45 +110,7 @@ const config = [
|
|
|
70
110
|
"no-restricted-imports": [
|
|
71
111
|
"error",
|
|
72
112
|
{
|
|
73
|
-
paths:
|
|
74
|
-
...cometAdminImportsRestrictedFromMuiMaterial.map((name) => ({
|
|
75
|
-
name: "@mui/material",
|
|
76
|
-
importNames: [name],
|
|
77
|
-
message: `Please use ${name} from @comet/admin instead`,
|
|
78
|
-
})),
|
|
79
|
-
...cometAdminImportsRestrictedFromMuiMaterial.map((name) => ({
|
|
80
|
-
name: `@mui/material/${name}`,
|
|
81
|
-
message: `Please use ${name} from @comet/admin instead`,
|
|
82
|
-
})),
|
|
83
|
-
{
|
|
84
|
-
name: "react",
|
|
85
|
-
importNames: ["default"],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: "@mui/material",
|
|
89
|
-
importNames: ["styled"],
|
|
90
|
-
message: "Please use styled from @mui/material/styles instead.",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "@mui/icons-material",
|
|
94
|
-
message: "Please use @comet/admin-icons instead",
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: "@mui/x-data-grid",
|
|
98
|
-
importNames: ["GridColDef"],
|
|
99
|
-
message: "Please use GridColDef from @comet/admin instead",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: "@mui/x-data-grid-pro",
|
|
103
|
-
importNames: ["GridColDef"],
|
|
104
|
-
message: "Please use GridColDef from @comet/admin instead",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: "@mui/x-data-grid-premium",
|
|
108
|
-
importNames: ["GridColDef"],
|
|
109
|
-
message: "Please use GridColDef from @comet/admin instead",
|
|
110
|
-
},
|
|
111
|
-
],
|
|
113
|
+
paths: restrictedImportPaths,
|
|
112
114
|
},
|
|
113
115
|
],
|
|
114
116
|
},
|