@luxass/eslint-config 4.2.15 → 4.3.1
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 +14 -14
- package/dist/index.cjs +50 -48
- package/dist/index.d.cts +11754 -58
- package/dist/index.d.ts +11754 -58
- package/dist/index.js +47 -51
- package/package.json +29 -36
package/dist/index.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name2 in all)
|
|
4
|
-
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
// src/factory.ts
|
|
8
2
|
import process3 from "node:process";
|
|
9
3
|
import { existsSync } from "node:fs";
|
|
10
4
|
import { isPackageExists as isPackageExists4 } from "local-pkg";
|
|
5
|
+
import { FlatConfigPipeline } from "eslint-flat-config-utils";
|
|
11
6
|
|
|
12
7
|
// src/configs/comments.ts
|
|
13
8
|
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
@@ -733,6 +728,26 @@ async function javascript(options = {}) {
|
|
|
733
728
|
// src/utils.ts
|
|
734
729
|
import process from "node:process";
|
|
735
730
|
import { isPackageExists } from "local-pkg";
|
|
731
|
+
var parserPlain = {
|
|
732
|
+
meta: {
|
|
733
|
+
name: "parser-plain"
|
|
734
|
+
},
|
|
735
|
+
parseForESLint: (code) => ({
|
|
736
|
+
ast: {
|
|
737
|
+
body: [],
|
|
738
|
+
comments: [],
|
|
739
|
+
loc: { end: code.length, start: 0 },
|
|
740
|
+
range: [0, code.length],
|
|
741
|
+
tokens: [],
|
|
742
|
+
type: "Program"
|
|
743
|
+
},
|
|
744
|
+
scopeManager: null,
|
|
745
|
+
services: { isPlain: true },
|
|
746
|
+
visitorKeys: {
|
|
747
|
+
Program: []
|
|
748
|
+
}
|
|
749
|
+
})
|
|
750
|
+
};
|
|
736
751
|
async function combine(...configs) {
|
|
737
752
|
const resolved = await Promise.all(configs);
|
|
738
753
|
return resolved.flat();
|
|
@@ -900,38 +915,6 @@ async function jsonc(options = {}) {
|
|
|
900
915
|
];
|
|
901
916
|
}
|
|
902
917
|
|
|
903
|
-
// node_modules/.pnpm/eslint-parser-plain@0.1.0_patch_hash=2wwjuy7bj3rwnupmtdrepccgsy/node_modules/eslint-parser-plain/dist/index.mjs
|
|
904
|
-
var dist_exports = {};
|
|
905
|
-
__export(dist_exports, {
|
|
906
|
-
meta: () => meta,
|
|
907
|
-
parseForESLint: () => parseForESLint
|
|
908
|
-
});
|
|
909
|
-
|
|
910
|
-
// node_modules/.pnpm/eslint-parser-plain@0.1.0_patch_hash=2wwjuy7bj3rwnupmtdrepccgsy/node_modules/eslint-parser-plain/package.json
|
|
911
|
-
var name = "eslint-parser-plain";
|
|
912
|
-
var version = "0.1.0";
|
|
913
|
-
|
|
914
|
-
// node_modules/.pnpm/eslint-parser-plain@0.1.0_patch_hash=2wwjuy7bj3rwnupmtdrepccgsy/node_modules/eslint-parser-plain/dist/index.mjs
|
|
915
|
-
var parseForESLint = (code) => ({
|
|
916
|
-
ast: {
|
|
917
|
-
type: "Program",
|
|
918
|
-
loc: { start: 0, end: code.length },
|
|
919
|
-
range: [0, code.length],
|
|
920
|
-
body: [],
|
|
921
|
-
comments: [],
|
|
922
|
-
tokens: []
|
|
923
|
-
},
|
|
924
|
-
services: { isPlain: true },
|
|
925
|
-
scopeManager: null,
|
|
926
|
-
visitorKeys: {
|
|
927
|
-
Program: []
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
|
-
var meta = {
|
|
931
|
-
name,
|
|
932
|
-
version
|
|
933
|
-
};
|
|
934
|
-
|
|
935
918
|
// src/configs/markdown.ts
|
|
936
919
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
937
920
|
async function markdown(options = {}) {
|
|
@@ -964,7 +947,7 @@ async function markdown(options = {}) {
|
|
|
964
947
|
name: "luxass:markdown:parser",
|
|
965
948
|
files,
|
|
966
949
|
languageOptions: {
|
|
967
|
-
parser:
|
|
950
|
+
parser: parserPlain
|
|
968
951
|
}
|
|
969
952
|
},
|
|
970
953
|
{
|
|
@@ -1979,7 +1962,7 @@ async function react(options = {}) {
|
|
|
1979
1962
|
}
|
|
1980
1963
|
|
|
1981
1964
|
// src/configs/astro.ts
|
|
1982
|
-
async function astro(options) {
|
|
1965
|
+
async function astro(options = {}) {
|
|
1983
1966
|
const {
|
|
1984
1967
|
files = [GLOB_ASTRO],
|
|
1985
1968
|
overrides = {},
|
|
@@ -2181,7 +2164,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2181
2164
|
name: "luxass:formatter:css",
|
|
2182
2165
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
2183
2166
|
languageOptions: {
|
|
2184
|
-
parser:
|
|
2167
|
+
parser: parserPlain
|
|
2185
2168
|
},
|
|
2186
2169
|
rules: {
|
|
2187
2170
|
"format/prettier": [
|
|
@@ -2197,7 +2180,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2197
2180
|
name: "luxass:formatter:scss",
|
|
2198
2181
|
files: [GLOB_SCSS],
|
|
2199
2182
|
languageOptions: {
|
|
2200
|
-
parser:
|
|
2183
|
+
parser: parserPlain
|
|
2201
2184
|
},
|
|
2202
2185
|
rules: {
|
|
2203
2186
|
"format/prettier": [
|
|
@@ -2213,7 +2196,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2213
2196
|
name: "luxass:formatter:less",
|
|
2214
2197
|
files: [GLOB_LESS],
|
|
2215
2198
|
languageOptions: {
|
|
2216
|
-
parser:
|
|
2199
|
+
parser: parserPlain
|
|
2217
2200
|
},
|
|
2218
2201
|
rules: {
|
|
2219
2202
|
"format/prettier": [
|
|
@@ -2232,7 +2215,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2232
2215
|
name: "luxass:formatter:html",
|
|
2233
2216
|
files: ["**/*.html"],
|
|
2234
2217
|
languageOptions: {
|
|
2235
|
-
parser:
|
|
2218
|
+
parser: parserPlain
|
|
2236
2219
|
},
|
|
2237
2220
|
rules: {
|
|
2238
2221
|
"format/prettier": [
|
|
@@ -2251,7 +2234,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2251
2234
|
name: "luxass:formatter:markdown",
|
|
2252
2235
|
files: [GLOB_MARKDOWN],
|
|
2253
2236
|
languageOptions: {
|
|
2254
|
-
parser:
|
|
2237
|
+
parser: parserPlain
|
|
2255
2238
|
},
|
|
2256
2239
|
rules: {
|
|
2257
2240
|
[`format/${formater}`]: [
|
|
@@ -2274,7 +2257,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2274
2257
|
name: "luxass:formatter:astro",
|
|
2275
2258
|
files: [GLOB_ASTRO],
|
|
2276
2259
|
languageOptions: {
|
|
2277
|
-
parser:
|
|
2260
|
+
parser: parserPlain
|
|
2278
2261
|
},
|
|
2279
2262
|
rules: {
|
|
2280
2263
|
"format/prettier": [
|
|
@@ -2295,7 +2278,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2295
2278
|
name: "luxass:formatter:graphql",
|
|
2296
2279
|
files: [GLOB_GRAPHQL],
|
|
2297
2280
|
languageOptions: {
|
|
2298
|
-
parser:
|
|
2281
|
+
parser: parserPlain
|
|
2299
2282
|
},
|
|
2300
2283
|
rules: {
|
|
2301
2284
|
"format/prettier": [
|
|
@@ -2462,9 +2445,18 @@ var VuePackages = [
|
|
|
2462
2445
|
"vitepress",
|
|
2463
2446
|
"@slidev/cli"
|
|
2464
2447
|
];
|
|
2465
|
-
|
|
2448
|
+
var defaultPluginRenaming = {
|
|
2449
|
+
"@stylistic": "style",
|
|
2450
|
+
"@typescript-eslint": "ts",
|
|
2451
|
+
"import-x": "import",
|
|
2452
|
+
"n": "node",
|
|
2453
|
+
"vitest": "test",
|
|
2454
|
+
"yml": "yaml"
|
|
2455
|
+
};
|
|
2456
|
+
function luxass(options = {}, ...userConfigs) {
|
|
2466
2457
|
const {
|
|
2467
2458
|
astro: enableAstro = false,
|
|
2459
|
+
autoRenamePlugins = true,
|
|
2468
2460
|
editor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
|
|
2469
2461
|
exts = [],
|
|
2470
2462
|
gitignore: enableGitignore = true,
|
|
@@ -2627,11 +2619,15 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2627
2619
|
if (Object.keys(fusedConfig).length) {
|
|
2628
2620
|
configs.push([fusedConfig]);
|
|
2629
2621
|
}
|
|
2630
|
-
|
|
2622
|
+
let pipeline = new FlatConfigPipeline();
|
|
2623
|
+
pipeline = pipeline.append(
|
|
2631
2624
|
...configs,
|
|
2632
2625
|
...userConfigs
|
|
2633
2626
|
);
|
|
2634
|
-
|
|
2627
|
+
if (autoRenamePlugins) {
|
|
2628
|
+
pipeline = pipeline.renamePlugins(defaultPluginRenaming);
|
|
2629
|
+
}
|
|
2630
|
+
return pipeline;
|
|
2635
2631
|
}
|
|
2636
2632
|
|
|
2637
2633
|
// src/index.ts
|
|
@@ -2677,10 +2673,10 @@ export {
|
|
|
2677
2673
|
javascript,
|
|
2678
2674
|
jsdoc,
|
|
2679
2675
|
jsonc,
|
|
2680
|
-
luxass,
|
|
2681
2676
|
markdown,
|
|
2682
2677
|
nextjs,
|
|
2683
2678
|
node,
|
|
2679
|
+
parserPlain,
|
|
2684
2680
|
react,
|
|
2685
2681
|
renameRules,
|
|
2686
2682
|
resolveSubOptions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"description": "ESLint config for @luxass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
"node": ">=20"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "tsup --format esm,cjs --clean --dts",
|
|
40
|
+
"build": "pnpm typegen && tsup --format esm,cjs --clean --dts",
|
|
41
41
|
"dev": "tsup --watch",
|
|
42
|
-
"lint": "eslint . --report-unused-disable-directives",
|
|
43
42
|
"test": "vitest --run",
|
|
43
|
+
"typegen": "pnpx tsx ./scripts/typegen.ts",
|
|
44
44
|
"test:watch": "vitest",
|
|
45
|
+
"lint": "eslint . --report-unused-disable-directives",
|
|
45
46
|
"typecheck": "tsc --noEmit"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
@@ -94,23 +95,19 @@
|
|
|
94
95
|
}
|
|
95
96
|
},
|
|
96
97
|
"dependencies": {
|
|
97
|
-
"@antfu/
|
|
98
|
-
"@antfu/install-pkg": "^0.3.1",
|
|
98
|
+
"@antfu/install-pkg": "^0.3.2",
|
|
99
99
|
"@clack/prompts": "^0.7.0",
|
|
100
100
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.1.0",
|
|
101
|
-
"@eslint-
|
|
102
|
-
"@eslint
|
|
103
|
-
"@eslint
|
|
104
|
-
"@stylistic/eslint-plugin": "^1.6.3",
|
|
105
|
-
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
106
|
-
"@typescript-eslint/parser": "^7.2.0",
|
|
101
|
+
"@stylistic/eslint-plugin": "^1.7.0",
|
|
102
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
103
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
107
104
|
"eslint-config-flat-gitignore": "^0.1.3",
|
|
105
|
+
"eslint-flat-config-utils": "^0.1.2",
|
|
108
106
|
"eslint-merge-processors": "^0.1.0",
|
|
109
|
-
"eslint-parser-plain": "^0.1.0",
|
|
110
107
|
"eslint-plugin-antfu": "^2.1.2",
|
|
111
|
-
"eslint-plugin-import-x": "^0.4.
|
|
112
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
113
|
-
"eslint-plugin-jsonc": "^2.
|
|
108
|
+
"eslint-plugin-import-x": "^0.4.4",
|
|
109
|
+
"eslint-plugin-jsdoc": "^48.2.2",
|
|
110
|
+
"eslint-plugin-jsonc": "^2.14.1",
|
|
114
111
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
115
112
|
"eslint-plugin-markdown": "^4.0.1",
|
|
116
113
|
"eslint-plugin-n": "^16.6.2",
|
|
@@ -118,11 +115,11 @@
|
|
|
118
115
|
"eslint-plugin-toml": "^0.10.0",
|
|
119
116
|
"eslint-plugin-unicorn": "^51.0.1",
|
|
120
117
|
"eslint-plugin-unused-imports": "^3.1.0",
|
|
121
|
-
"eslint-plugin-vitest": "^0.
|
|
122
|
-
"eslint-plugin-vue": "^9.
|
|
123
|
-
"eslint-plugin-yml": "^1.
|
|
118
|
+
"eslint-plugin-vitest": "^0.4.0",
|
|
119
|
+
"eslint-plugin-vue": "^9.24.0",
|
|
120
|
+
"eslint-plugin-yml": "^1.13.2",
|
|
124
121
|
"eslint-processor-vue-blocks": "^0.1.1",
|
|
125
|
-
"globals": "^
|
|
122
|
+
"globals": "^15.0.0",
|
|
126
123
|
"jsonc-eslint-parser": "^2.4.0",
|
|
127
124
|
"local-pkg": "^0.5.0",
|
|
128
125
|
"parse-gitignore": "^2.0.0",
|
|
@@ -132,34 +129,30 @@
|
|
|
132
129
|
},
|
|
133
130
|
"devDependencies": {
|
|
134
131
|
"@antfu/eslint-plugin-prettier": "^5.0.1-1",
|
|
135
|
-
"@next/eslint-plugin-next": "^14.1.
|
|
136
|
-
"@stylistic/eslint-plugin-migrate": "^1.
|
|
137
|
-
"@types/eslint": "^8.56.
|
|
132
|
+
"@next/eslint-plugin-next": "^14.1.4",
|
|
133
|
+
"@stylistic/eslint-plugin-migrate": "^1.7.0",
|
|
134
|
+
"@types/eslint": "^8.56.6",
|
|
138
135
|
"@types/estree": "^1.0.5",
|
|
139
136
|
"@types/node": "^18.17.19",
|
|
140
|
-
"@typescript-eslint/rule-tester": "^7.
|
|
141
|
-
"@unocss/eslint-plugin": "^0.58.
|
|
137
|
+
"@typescript-eslint/rule-tester": "^7.4.0",
|
|
138
|
+
"@unocss/eslint-plugin": "^0.58.7",
|
|
142
139
|
"astro-eslint-parser": "^0.16.3",
|
|
143
|
-
"eslint": "
|
|
144
|
-
"eslint-plugin-astro": "^0.
|
|
140
|
+
"eslint": "9.0.0-rc.0",
|
|
141
|
+
"eslint-plugin-astro": "^0.33.1",
|
|
145
142
|
"eslint-plugin-format": "^0.1.0",
|
|
146
|
-
"eslint-plugin-react": "^7.34.
|
|
143
|
+
"eslint-plugin-react": "^7.34.1",
|
|
147
144
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
148
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
145
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
149
146
|
"eslint-plugin-solid": "^0.13.2",
|
|
150
147
|
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
148
|
+
"eslint-typegen": "^0.1.6",
|
|
151
149
|
"jiti": "^1.21.0",
|
|
152
150
|
"lint-staged": "^15.2.2",
|
|
153
151
|
"prettier-plugin-astro": "^0.13.0",
|
|
154
|
-
"simple-git-hooks": "^2.
|
|
152
|
+
"simple-git-hooks": "^2.11.1",
|
|
155
153
|
"tsup": "^8.0.2",
|
|
156
|
-
"typescript": "^5.4.
|
|
157
|
-
"vitest": "^1.
|
|
158
|
-
},
|
|
159
|
-
"pnpm": {
|
|
160
|
-
"patchedDependencies": {
|
|
161
|
-
"eslint-parser-plain@0.1.0": "patches/eslint-parser-plain@0.1.0.patch"
|
|
162
|
-
}
|
|
154
|
+
"typescript": "^5.4.3",
|
|
155
|
+
"vitest": "^1.4.0"
|
|
163
156
|
},
|
|
164
157
|
"simple-git-hooks": {
|
|
165
158
|
"pre-commit": "pnpm lint-staged"
|