@july_cm/eslint-config 2.4.2 → 2.5.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/lib/index.cjs +31 -69
- package/lib/index.mjs +31 -69
- package/package.json +20 -23
package/lib/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const css$1 = require("@eslint/css");
|
|
|
5
5
|
const prettier = require("eslint-plugin-prettier");
|
|
6
6
|
const tailwindCsstree = require("tailwind-csstree");
|
|
7
7
|
const eslintJs = require("@eslint/js");
|
|
8
|
-
const
|
|
8
|
+
const simpleImportSort = require("eslint-plugin-simple-import-sort");
|
|
9
9
|
const recommended$1 = require("eslint-plugin-prettier/recommended");
|
|
10
10
|
const eslintPluginJsonc = require("eslint-plugin-jsonc");
|
|
11
11
|
const typescriptEslint = require("typescript-eslint");
|
|
@@ -55,38 +55,17 @@ const prettierConfig = [
|
|
|
55
55
|
}
|
|
56
56
|
];
|
|
57
57
|
const javascriptConfig = config.defineConfig({
|
|
58
|
-
extends: [eslintJs.configs.recommended,
|
|
58
|
+
extends: [eslintJs.configs.recommended, ...prettierConfig],
|
|
59
|
+
plugins: {
|
|
60
|
+
"simple-import-sort": simpleImportSort
|
|
61
|
+
},
|
|
59
62
|
files: ["**/*.{js,mjs,cjs,jsx}"],
|
|
60
63
|
languageOptions: {
|
|
61
64
|
ecmaVersion: "latest"
|
|
62
65
|
},
|
|
63
66
|
rules: {
|
|
64
|
-
"import/
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
groups: ["builtin", "external", "internal", ["parent", "sibling"], "object", "type", "index"],
|
|
68
|
-
"newlines-between": "always",
|
|
69
|
-
pathGroupsExcludedImportTypes: ["builtin"],
|
|
70
|
-
alphabetize: { order: "asc", caseInsensitive: true },
|
|
71
|
-
pathGroups: [
|
|
72
|
-
{
|
|
73
|
-
pattern: "react**",
|
|
74
|
-
group: "external",
|
|
75
|
-
position: "before"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
pattern: "{@/**,@**}",
|
|
79
|
-
group: "internal",
|
|
80
|
-
position: "before"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
pattern: "**/*.{scss,json,svg,css,less}",
|
|
84
|
-
group: "index",
|
|
85
|
-
position: "after"
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
]
|
|
67
|
+
"simple-import-sort/imports": "error",
|
|
68
|
+
"simple-import-sort/exports": "error"
|
|
90
69
|
},
|
|
91
70
|
settings: {
|
|
92
71
|
"import/resolver": {
|
|
@@ -108,16 +87,32 @@ const packageJsonConfig = config.defineConfig({
|
|
|
108
87
|
{
|
|
109
88
|
pathPattern: "^$",
|
|
110
89
|
order: [
|
|
90
|
+
// basic information
|
|
111
91
|
"name",
|
|
112
92
|
"version",
|
|
93
|
+
"description",
|
|
113
94
|
"author",
|
|
95
|
+
"keywords",
|
|
96
|
+
"homepage",
|
|
97
|
+
"repository",
|
|
98
|
+
"bugs",
|
|
99
|
+
"license",
|
|
100
|
+
// entries and environment
|
|
101
|
+
"type",
|
|
114
102
|
"exports",
|
|
115
103
|
"types",
|
|
116
104
|
"main",
|
|
117
|
-
"
|
|
105
|
+
"bin",
|
|
118
106
|
"scripts",
|
|
107
|
+
"packageManager",
|
|
108
|
+
// dependencies
|
|
119
109
|
"dependencies",
|
|
120
|
-
"devDependencies"
|
|
110
|
+
"devDependencies",
|
|
111
|
+
"peerDependencies",
|
|
112
|
+
"peerDependenciesMeta",
|
|
113
|
+
"optionalDependencies",
|
|
114
|
+
// config
|
|
115
|
+
"publishConfig"
|
|
121
116
|
]
|
|
122
117
|
},
|
|
123
118
|
{
|
|
@@ -133,52 +128,19 @@ const packageJsonConfig = config.defineConfig({
|
|
|
133
128
|
}
|
|
134
129
|
});
|
|
135
130
|
const typescriptConfig = config.defineConfig({
|
|
136
|
-
extends: [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
eslintPluginImport.flatConfigs.typescript,
|
|
141
|
-
prettierConfig
|
|
142
|
-
],
|
|
131
|
+
extends: [eslintJs.configs.recommended, typescriptEslint.configs.stylistic, prettierConfig],
|
|
132
|
+
plugins: {
|
|
133
|
+
"simple-import-sort": simpleImportSort
|
|
134
|
+
},
|
|
143
135
|
files: ["**/*.{ts,tsx}"],
|
|
144
136
|
rules: {
|
|
145
|
-
"import/
|
|
146
|
-
|
|
147
|
-
{
|
|
148
|
-
groups: ["builtin", "external", "internal", ["parent", "sibling"], "object", "type", "index"],
|
|
149
|
-
"newlines-between": "always",
|
|
150
|
-
pathGroupsExcludedImportTypes: ["builtin"],
|
|
151
|
-
alphabetize: { order: "asc", caseInsensitive: true },
|
|
152
|
-
pathGroups: [
|
|
153
|
-
{
|
|
154
|
-
pattern: "react**",
|
|
155
|
-
group: "external",
|
|
156
|
-
position: "before"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
pattern: "{@/**,@**}",
|
|
160
|
-
group: "internal",
|
|
161
|
-
position: "before"
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
pattern: "**/*.{scss,json,svg,css,less}",
|
|
165
|
-
group: "index",
|
|
166
|
-
position: "after"
|
|
167
|
-
}
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
],
|
|
137
|
+
"simple-import-sort/imports": "error",
|
|
138
|
+
"simple-import-sort/exports": "error",
|
|
171
139
|
"@typescript-eslint/consistent-type-imports": [
|
|
172
140
|
"error",
|
|
173
141
|
{ disallowTypeAnnotations: true, prefer: "type-imports" }
|
|
174
142
|
],
|
|
175
143
|
"@typescript-eslint/no-explicit-any": ["warn"]
|
|
176
|
-
},
|
|
177
|
-
settings: {
|
|
178
|
-
"import/resolver": {
|
|
179
|
-
node: true,
|
|
180
|
-
typescript: true
|
|
181
|
-
}
|
|
182
144
|
}
|
|
183
145
|
});
|
|
184
146
|
const recommended = config.defineConfig(javascriptConfig, typescriptConfig, packageJsonConfig, cssConfig);
|
package/lib/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import css$1 from "@eslint/css";
|
|
|
3
3
|
import prettier from "eslint-plugin-prettier";
|
|
4
4
|
import { tailwind4 } from "tailwind-csstree";
|
|
5
5
|
import eslintJs from "@eslint/js";
|
|
6
|
-
import
|
|
6
|
+
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
|
7
7
|
import recommended$1 from "eslint-plugin-prettier/recommended";
|
|
8
8
|
import eslintPluginJsonc from "eslint-plugin-jsonc";
|
|
9
9
|
import { configs } from "typescript-eslint";
|
|
@@ -53,38 +53,17 @@ const prettierConfig = [
|
|
|
53
53
|
}
|
|
54
54
|
];
|
|
55
55
|
const javascriptConfig = defineConfig({
|
|
56
|
-
extends: [eslintJs.configs.recommended,
|
|
56
|
+
extends: [eslintJs.configs.recommended, ...prettierConfig],
|
|
57
|
+
plugins: {
|
|
58
|
+
"simple-import-sort": simpleImportSort
|
|
59
|
+
},
|
|
57
60
|
files: ["**/*.{js,mjs,cjs,jsx}"],
|
|
58
61
|
languageOptions: {
|
|
59
62
|
ecmaVersion: "latest"
|
|
60
63
|
},
|
|
61
64
|
rules: {
|
|
62
|
-
"import/
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
groups: ["builtin", "external", "internal", ["parent", "sibling"], "object", "type", "index"],
|
|
66
|
-
"newlines-between": "always",
|
|
67
|
-
pathGroupsExcludedImportTypes: ["builtin"],
|
|
68
|
-
alphabetize: { order: "asc", caseInsensitive: true },
|
|
69
|
-
pathGroups: [
|
|
70
|
-
{
|
|
71
|
-
pattern: "react**",
|
|
72
|
-
group: "external",
|
|
73
|
-
position: "before"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
pattern: "{@/**,@**}",
|
|
77
|
-
group: "internal",
|
|
78
|
-
position: "before"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
pattern: "**/*.{scss,json,svg,css,less}",
|
|
82
|
-
group: "index",
|
|
83
|
-
position: "after"
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
]
|
|
65
|
+
"simple-import-sort/imports": "error",
|
|
66
|
+
"simple-import-sort/exports": "error"
|
|
88
67
|
},
|
|
89
68
|
settings: {
|
|
90
69
|
"import/resolver": {
|
|
@@ -106,16 +85,32 @@ const packageJsonConfig = defineConfig({
|
|
|
106
85
|
{
|
|
107
86
|
pathPattern: "^$",
|
|
108
87
|
order: [
|
|
88
|
+
// basic information
|
|
109
89
|
"name",
|
|
110
90
|
"version",
|
|
91
|
+
"description",
|
|
111
92
|
"author",
|
|
93
|
+
"keywords",
|
|
94
|
+
"homepage",
|
|
95
|
+
"repository",
|
|
96
|
+
"bugs",
|
|
97
|
+
"license",
|
|
98
|
+
// entries and environment
|
|
99
|
+
"type",
|
|
112
100
|
"exports",
|
|
113
101
|
"types",
|
|
114
102
|
"main",
|
|
115
|
-
"
|
|
103
|
+
"bin",
|
|
116
104
|
"scripts",
|
|
105
|
+
"packageManager",
|
|
106
|
+
// dependencies
|
|
117
107
|
"dependencies",
|
|
118
|
-
"devDependencies"
|
|
108
|
+
"devDependencies",
|
|
109
|
+
"peerDependencies",
|
|
110
|
+
"peerDependenciesMeta",
|
|
111
|
+
"optionalDependencies",
|
|
112
|
+
// config
|
|
113
|
+
"publishConfig"
|
|
119
114
|
]
|
|
120
115
|
},
|
|
121
116
|
{
|
|
@@ -131,52 +126,19 @@ const packageJsonConfig = defineConfig({
|
|
|
131
126
|
}
|
|
132
127
|
});
|
|
133
128
|
const typescriptConfig = defineConfig({
|
|
134
|
-
extends: [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
eslintPluginImport.flatConfigs.typescript,
|
|
139
|
-
prettierConfig
|
|
140
|
-
],
|
|
129
|
+
extends: [eslintJs.configs.recommended, configs.stylistic, prettierConfig],
|
|
130
|
+
plugins: {
|
|
131
|
+
"simple-import-sort": simpleImportSort
|
|
132
|
+
},
|
|
141
133
|
files: ["**/*.{ts,tsx}"],
|
|
142
134
|
rules: {
|
|
143
|
-
"import/
|
|
144
|
-
|
|
145
|
-
{
|
|
146
|
-
groups: ["builtin", "external", "internal", ["parent", "sibling"], "object", "type", "index"],
|
|
147
|
-
"newlines-between": "always",
|
|
148
|
-
pathGroupsExcludedImportTypes: ["builtin"],
|
|
149
|
-
alphabetize: { order: "asc", caseInsensitive: true },
|
|
150
|
-
pathGroups: [
|
|
151
|
-
{
|
|
152
|
-
pattern: "react**",
|
|
153
|
-
group: "external",
|
|
154
|
-
position: "before"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
pattern: "{@/**,@**}",
|
|
158
|
-
group: "internal",
|
|
159
|
-
position: "before"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
pattern: "**/*.{scss,json,svg,css,less}",
|
|
163
|
-
group: "index",
|
|
164
|
-
position: "after"
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
],
|
|
135
|
+
"simple-import-sort/imports": "error",
|
|
136
|
+
"simple-import-sort/exports": "error",
|
|
169
137
|
"@typescript-eslint/consistent-type-imports": [
|
|
170
138
|
"error",
|
|
171
139
|
{ disallowTypeAnnotations: true, prefer: "type-imports" }
|
|
172
140
|
],
|
|
173
141
|
"@typescript-eslint/no-explicit-any": ["warn"]
|
|
174
|
-
},
|
|
175
|
-
settings: {
|
|
176
|
-
"import/resolver": {
|
|
177
|
-
node: true,
|
|
178
|
-
typescript: true
|
|
179
|
-
}
|
|
180
142
|
}
|
|
181
143
|
});
|
|
182
144
|
const recommended = defineConfig(javascriptConfig, typescriptConfig, packageJsonConfig, cssConfig);
|
package/package.json
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@july_cm/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"author": "July",
|
|
5
|
+
"homepage": "https://github.com/JxJuly/eslint-config/blob/main/README.md",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/JxJuly/eslint-config.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/JxJuly/eslint-config/issues"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
5
14
|
"exports": {
|
|
6
15
|
".": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
16
|
+
"import": "./lib/index.mjs",
|
|
17
|
+
"require": "./lib/index.cjs"
|
|
9
18
|
}
|
|
10
19
|
},
|
|
11
20
|
"main": "./lib/index.cjs",
|
|
12
|
-
"type": "module",
|
|
13
21
|
"files": [
|
|
14
22
|
"README.md",
|
|
15
23
|
"lib",
|
|
@@ -18,41 +26,30 @@
|
|
|
18
26
|
"scripts": {
|
|
19
27
|
"build": "vite build",
|
|
20
28
|
"test": "vitest run",
|
|
21
|
-
"test:cov": "vitest run --coverage"
|
|
22
|
-
"release": "release-it -ci"
|
|
29
|
+
"test:cov": "vitest run --coverage"
|
|
23
30
|
},
|
|
24
31
|
"packageManager": "pnpm@10.26.1",
|
|
25
32
|
"dependencies": {
|
|
26
|
-
"@eslint/css": "^0.
|
|
27
|
-
"@eslint/js": "^
|
|
33
|
+
"@eslint/css": "^1.0.0",
|
|
34
|
+
"@eslint/js": "^10.0.1",
|
|
28
35
|
"eslint-config-prettier": "^10.1.8",
|
|
29
36
|
"eslint-import-resolver-node": "^0.3.9",
|
|
30
37
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
31
|
-
"eslint-plugin-import": "^2.32.0",
|
|
32
38
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
33
39
|
"eslint-plugin-prettier": "^5.5.4",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
40
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
41
|
+
"tailwind-csstree": "^0.3.0",
|
|
42
|
+
"typescript-eslint": "^8.57.2"
|
|
36
43
|
},
|
|
37
44
|
"devDependencies": {
|
|
38
|
-
"@release-it/conventional-changelog": "^10.0.3",
|
|
39
45
|
"@vitest/coverage-v8": "^4.0.15",
|
|
40
|
-
"eslint": "^
|
|
41
|
-
"release-it": "^19.1.0",
|
|
46
|
+
"eslint": "^10.1.0",
|
|
42
47
|
"typescript": "^5.9.3",
|
|
43
48
|
"vite": "^7.2.7",
|
|
44
49
|
"vitest": "^4.0.15"
|
|
45
50
|
},
|
|
46
51
|
"optionalPeerDependencies": {
|
|
47
|
-
"eslint": "^
|
|
52
|
+
"eslint": "^10",
|
|
48
53
|
"typescript": "^5"
|
|
49
|
-
},
|
|
50
|
-
"repository": {
|
|
51
|
-
"type": "git",
|
|
52
|
-
"url": "https://github.com/JxJuly/eslint-config.git"
|
|
53
|
-
},
|
|
54
|
-
"homepage": "https://github.com/JxJuly/eslint-config/blob/main/README.md",
|
|
55
|
-
"bugs": {
|
|
56
|
-
"url": "https://github.com/JxJuly/eslint-config/issues"
|
|
57
54
|
}
|
|
58
55
|
}
|