@kazupon/eslint-config 0.19.0 → 0.21.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/README.md +5 -2
- package/dist/index.d.ts +247 -213
- package/dist/index.js +31 -2
- package/package.json +57 -41
- package/dist/index.cjs +0 -659
- package/dist/index.d.cts +0 -14216
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
2
2
|
import { interopDefault } from "@kazupon/jts-utils/module";
|
|
3
|
+
import { isObject } from "@kazupon/jts-utils/object";
|
|
3
4
|
import globals from "globals";
|
|
4
5
|
|
|
5
6
|
//#region src/config.ts
|
|
@@ -22,6 +23,7 @@ const GLOB_TOML = "**/*.toml";
|
|
|
22
23
|
const GLOB_VUE = "**/*.vue";
|
|
23
24
|
const GLOB_SVELTE = "**/*.svelte";
|
|
24
25
|
const GLOB_MARKDOWN = "**/*.md";
|
|
26
|
+
const GLOB_CSS = "**/*.css";
|
|
25
27
|
const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
26
28
|
const GLOB_TESTS = [
|
|
27
29
|
`**/test/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -72,6 +74,33 @@ async function comments(options = {}) {
|
|
|
72
74
|
}];
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/configs/css.ts
|
|
79
|
+
async function css(options = {}) {
|
|
80
|
+
const { rules: overrideRules = {} } = options;
|
|
81
|
+
const tolerant = !!options.tolerant;
|
|
82
|
+
const customSyntax = !!options.customSyntax;
|
|
83
|
+
const css$1 = await loadPlugin("@eslint/css");
|
|
84
|
+
const core = {
|
|
85
|
+
files: [GLOB_CSS],
|
|
86
|
+
language: "css/css",
|
|
87
|
+
...css$1.configs["recommended"]
|
|
88
|
+
};
|
|
89
|
+
if (tolerant) core.languageOptions = { tolerant };
|
|
90
|
+
if (customSyntax) {
|
|
91
|
+
core.languageOptions = core.languageOptions || {};
|
|
92
|
+
if (typeof customSyntax === "string" && customSyntax === "tailwind") {
|
|
93
|
+
const { tailwindSyntax } = await loadPlugin("@eslint/css/syntax");
|
|
94
|
+
core.languageOptions.customSyntax = tailwindSyntax;
|
|
95
|
+
} else if (isObject(customSyntax)) core.languageOptions.customSyntax = customSyntax;
|
|
96
|
+
}
|
|
97
|
+
return [core, {
|
|
98
|
+
name: "@kazupon/css",
|
|
99
|
+
files: [GLOB_CSS],
|
|
100
|
+
rules: { ...overrideRules }
|
|
101
|
+
}];
|
|
102
|
+
}
|
|
103
|
+
|
|
75
104
|
//#endregion
|
|
76
105
|
//#region src/configs/imports.ts
|
|
77
106
|
const IMPORTS_FILES = [
|
|
@@ -489,7 +518,7 @@ async function unicorn(options = {}) {
|
|
|
489
518
|
const unicorn$1 = await loadPlugin("eslint-plugin-unicorn");
|
|
490
519
|
return [{
|
|
491
520
|
files: getGlobSourceFiles(useTypeScript),
|
|
492
|
-
...unicorn$1.configs["
|
|
521
|
+
...unicorn$1.configs["recommended"]
|
|
493
522
|
}, {
|
|
494
523
|
name: "@kazupon/unicorn",
|
|
495
524
|
files: getGlobSourceFiles(useTypeScript),
|
|
@@ -613,4 +642,4 @@ async function yml(options = {}) {
|
|
|
613
642
|
const yaml = yml;
|
|
614
643
|
|
|
615
644
|
//#endregion
|
|
616
|
-
export { comments, defineConfig, imports, javascript, jsdoc, jsonc, markdown, md, prettier, promise, react, regexp, svelte, toml, typescript, unicorn, vitest, vue, yaml, yml };
|
|
645
|
+
export { comments, css, defineConfig, imports, javascript, jsdoc, jsonc, markdown, md, prettier, promise, react, regexp, svelte, toml, typescript, unicorn, vitest, vue, yaml, yml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kazupon/eslint-config",
|
|
3
3
|
"description": "ESLint config for @kazupon",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "kawakazu80@gmail.com",
|
|
7
7
|
"name": "kazuya kawaguchi"
|
|
@@ -30,23 +30,33 @@
|
|
|
30
30
|
"files": [
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
|
-
"main": "./dist/index.cjs",
|
|
34
33
|
"module": "./dist/index.js",
|
|
35
34
|
"exports": {
|
|
36
35
|
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
37
|
"import": "./dist/index.js",
|
|
38
|
-
"
|
|
39
|
-
}
|
|
38
|
+
"default": "./dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./package.json": "./package.json"
|
|
40
41
|
},
|
|
41
42
|
"types": "./dist/index.d.ts",
|
|
43
|
+
"typesVersions": {
|
|
44
|
+
"*": {
|
|
45
|
+
"*": [
|
|
46
|
+
"./dist/*",
|
|
47
|
+
"./*"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
42
51
|
"dependencies": {
|
|
43
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
44
|
-
"@eslint/js": "^9.
|
|
45
|
-
"@kazupon/jts-utils": "^0.
|
|
46
|
-
"eslint-flat-config-utils": "^2.0.
|
|
47
|
-
"globals": "^
|
|
52
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
53
|
+
"@eslint/js": "^9.21.0",
|
|
54
|
+
"@kazupon/jts-utils": "^0.5.0",
|
|
55
|
+
"eslint-flat-config-utils": "^2.0.1",
|
|
56
|
+
"globals": "^16.0.0"
|
|
48
57
|
},
|
|
49
58
|
"peerDependencies": {
|
|
59
|
+
"@eslint/css": ">=0.4.0",
|
|
50
60
|
"@eslint/markdown": ">=6.1.0",
|
|
51
61
|
"@vitest/eslint-plugin": ">=1.0.0",
|
|
52
62
|
"eslint": ">=8.56.0 || >=9.0.0",
|
|
@@ -62,7 +72,7 @@
|
|
|
62
72
|
"eslint-plugin-regexp": ">=2.6.0",
|
|
63
73
|
"eslint-plugin-svelte": ">=2.43.0",
|
|
64
74
|
"eslint-plugin-toml": ">=0.11.0",
|
|
65
|
-
"eslint-plugin-unicorn": ">=
|
|
75
|
+
"eslint-plugin-unicorn": ">=57.0.0",
|
|
66
76
|
"eslint-plugin-unused-imports": ">=4.1.0",
|
|
67
77
|
"eslint-plugin-vue": ">=9.24.0",
|
|
68
78
|
"eslint-plugin-vue-composable": ">=1.0.0",
|
|
@@ -73,6 +83,9 @@
|
|
|
73
83
|
"typescript-eslint": ">=7.0.0"
|
|
74
84
|
},
|
|
75
85
|
"peerDependenciesMeta": {
|
|
86
|
+
"@eslint/css": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
76
89
|
"@eslint/markdown": {
|
|
77
90
|
"optional": true
|
|
78
91
|
},
|
|
@@ -144,43 +157,44 @@
|
|
|
144
157
|
}
|
|
145
158
|
},
|
|
146
159
|
"devDependencies": {
|
|
147
|
-
"@eslint/
|
|
160
|
+
"@eslint/css": "^0.4.0",
|
|
161
|
+
"@eslint/markdown": "^6.2.2",
|
|
148
162
|
"@kazupon/prettier-config": "^0.1.1",
|
|
149
163
|
"@types/eslint": "^9.6.1",
|
|
150
|
-
"@types/node": "^22.5
|
|
151
|
-
"@vitest/eslint-plugin": "^1.
|
|
152
|
-
"bumpp": "^10.0.
|
|
153
|
-
"eslint": "^9.
|
|
164
|
+
"@types/node": "^22.13.5",
|
|
165
|
+
"@vitest/eslint-plugin": "^1.1.31",
|
|
166
|
+
"bumpp": "^10.0.3",
|
|
167
|
+
"eslint": "^9.21.0",
|
|
154
168
|
"eslint-config-prettier": "^10.0.1",
|
|
155
|
-
"eslint-import-resolver-typescript": "^3.
|
|
169
|
+
"eslint-import-resolver-typescript": "^3.8.3",
|
|
156
170
|
"eslint-plugin-import": "^2.31.0",
|
|
157
|
-
"eslint-plugin-jsdoc": "^50.
|
|
158
|
-
"eslint-plugin-jsonc": "^2.
|
|
159
|
-
"eslint-plugin-promise": "^7.
|
|
160
|
-
"eslint-plugin-react": "^7.
|
|
171
|
+
"eslint-plugin-jsdoc": "^50.6.3",
|
|
172
|
+
"eslint-plugin-jsonc": "^2.19.1",
|
|
173
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
174
|
+
"eslint-plugin-react": "^7.37.4",
|
|
161
175
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
162
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
163
|
-
"eslint-plugin-regexp": "^2.
|
|
164
|
-
"eslint-plugin-svelte": "^2.
|
|
176
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
177
|
+
"eslint-plugin-regexp": "^2.7.0",
|
|
178
|
+
"eslint-plugin-svelte": "^2.46.1",
|
|
165
179
|
"eslint-plugin-toml": "^0.12.0",
|
|
166
|
-
"eslint-plugin-unicorn": "^
|
|
167
|
-
"eslint-plugin-unused-imports": "^4.1.
|
|
168
|
-
"eslint-plugin-vue": "^9.
|
|
180
|
+
"eslint-plugin-unicorn": "^57.0.0",
|
|
181
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
182
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
169
183
|
"eslint-plugin-vue-composable": "^1.0.0",
|
|
170
|
-
"eslint-plugin-vue-scoped-css": "^2.
|
|
184
|
+
"eslint-plugin-vue-scoped-css": "^2.9.0",
|
|
171
185
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
172
|
-
"eslint-plugin-yml": "^1.
|
|
173
|
-
"eslint-typegen": "^
|
|
186
|
+
"eslint-plugin-yml": "^1.17.0",
|
|
187
|
+
"eslint-typegen": "^2.0.0",
|
|
174
188
|
"gh-changelogen": "^0.2.8",
|
|
175
|
-
"jiti": "^2.
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"prettier": "^3.
|
|
179
|
-
"svelte": "^4.2.
|
|
180
|
-
"tsdown": "^0.
|
|
181
|
-
"typescript": "^5.
|
|
182
|
-
"typescript-eslint": "^8.1
|
|
183
|
-
"vitest": "^3.0.
|
|
189
|
+
"jiti": "^2.4.2",
|
|
190
|
+
"knip": "^5.44.4",
|
|
191
|
+
"lint-staged": "^15.4.3",
|
|
192
|
+
"prettier": "^3.5.2",
|
|
193
|
+
"svelte": "^4.2.19",
|
|
194
|
+
"tsdown": "^0.6.0",
|
|
195
|
+
"typescript": "^5.7.3",
|
|
196
|
+
"typescript-eslint": "^8.24.1",
|
|
197
|
+
"vitest": "^3.0.6"
|
|
184
198
|
},
|
|
185
199
|
"prettier": "@kazupon/prettier-config",
|
|
186
200
|
"lint-staged": {
|
|
@@ -201,14 +215,16 @@
|
|
|
201
215
|
"build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
|
|
202
216
|
"changelog": "gh-changelogen --repo=kazupon/eslint-config",
|
|
203
217
|
"dev": "pnpx @eslint/config-inspector --config eslint.config.ts",
|
|
204
|
-
"fix": "run
|
|
218
|
+
"fix": "pnpm run --parallel --color \"/^fix:/\"",
|
|
205
219
|
"fix:eslint": "eslint . --fix",
|
|
220
|
+
"fix:knip": "knip --fix --no-exit-code",
|
|
206
221
|
"fix:prettier": "prettier . --write",
|
|
207
|
-
"lint": "run
|
|
222
|
+
"lint": "pnpm run --parallel --color \"/^lint:/\"",
|
|
208
223
|
"lint:eslint": "eslint .",
|
|
224
|
+
"lint:knip": "knip",
|
|
209
225
|
"lint:prettier": "prettier . --check",
|
|
210
226
|
"release": "bumpp --commit \"release: v%s\" --all --push --tag",
|
|
211
|
-
"test": "vitest --typecheck",
|
|
227
|
+
"test": "vitest run --typecheck",
|
|
212
228
|
"typecheck": "tsc -p .",
|
|
213
229
|
"typegen": "pnpx jiti scripts/typegen.ts"
|
|
214
230
|
}
|