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