@luxass/eslint-config 4.2.15 → 4.3.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 +14 -14
- package/dist/index.cjs +43 -20
- package/dist/index.d.cts +11754 -58
- package/dist/index.d.ts +11754 -58
- package/dist/index.js +42 -19
- package/package.json +29 -36
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __export = (target, all) => {
|
|
3
|
-
for (var
|
|
4
|
-
__defProp(target,
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/factory.ts
|
|
8
8
|
import process3 from "node:process";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import { isPackageExists as isPackageExists4 } from "local-pkg";
|
|
11
|
+
import { FlatConfigPipeline } from "eslint-flat-config-utils";
|
|
11
12
|
|
|
12
13
|
// src/configs/comments.ts
|
|
13
14
|
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
@@ -733,6 +734,26 @@ async function javascript(options = {}) {
|
|
|
733
734
|
// src/utils.ts
|
|
734
735
|
import process from "node:process";
|
|
735
736
|
import { isPackageExists } from "local-pkg";
|
|
737
|
+
var parserPlain = {
|
|
738
|
+
meta: {
|
|
739
|
+
name: "parser-plain"
|
|
740
|
+
},
|
|
741
|
+
parseForESLint: (code) => ({
|
|
742
|
+
ast: {
|
|
743
|
+
body: [],
|
|
744
|
+
comments: [],
|
|
745
|
+
loc: { end: code.length, start: 0 },
|
|
746
|
+
range: [0, code.length],
|
|
747
|
+
tokens: [],
|
|
748
|
+
type: "Program"
|
|
749
|
+
},
|
|
750
|
+
scopeManager: null,
|
|
751
|
+
services: { isPlain: true },
|
|
752
|
+
visitorKeys: {
|
|
753
|
+
Program: []
|
|
754
|
+
}
|
|
755
|
+
})
|
|
756
|
+
};
|
|
736
757
|
async function combine(...configs) {
|
|
737
758
|
const resolved = await Promise.all(configs);
|
|
738
759
|
return resolved.flat();
|
|
@@ -900,18 +921,11 @@ async function jsonc(options = {}) {
|
|
|
900
921
|
];
|
|
901
922
|
}
|
|
902
923
|
|
|
903
|
-
// node_modules/.pnpm/eslint-parser-plain@0.1.
|
|
924
|
+
// node_modules/.pnpm/eslint-parser-plain@0.1.0/node_modules/eslint-parser-plain/dist/index.mjs
|
|
904
925
|
var dist_exports = {};
|
|
905
926
|
__export(dist_exports, {
|
|
906
|
-
meta: () => meta,
|
|
907
927
|
parseForESLint: () => parseForESLint
|
|
908
928
|
});
|
|
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
929
|
var parseForESLint = (code) => ({
|
|
916
930
|
ast: {
|
|
917
931
|
type: "Program",
|
|
@@ -927,10 +941,6 @@ var parseForESLint = (code) => ({
|
|
|
927
941
|
Program: []
|
|
928
942
|
}
|
|
929
943
|
});
|
|
930
|
-
var meta = {
|
|
931
|
-
name,
|
|
932
|
-
version
|
|
933
|
-
};
|
|
934
944
|
|
|
935
945
|
// src/configs/markdown.ts
|
|
936
946
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
@@ -1979,7 +1989,7 @@ async function react(options = {}) {
|
|
|
1979
1989
|
}
|
|
1980
1990
|
|
|
1981
1991
|
// src/configs/astro.ts
|
|
1982
|
-
async function astro(options) {
|
|
1992
|
+
async function astro(options = {}) {
|
|
1983
1993
|
const {
|
|
1984
1994
|
files = [GLOB_ASTRO],
|
|
1985
1995
|
overrides = {},
|
|
@@ -2462,9 +2472,18 @@ var VuePackages = [
|
|
|
2462
2472
|
"vitepress",
|
|
2463
2473
|
"@slidev/cli"
|
|
2464
2474
|
];
|
|
2465
|
-
|
|
2475
|
+
var defaultPluginRenaming = {
|
|
2476
|
+
"@stylistic": "style",
|
|
2477
|
+
"@typescript-eslint": "ts",
|
|
2478
|
+
"import-x": "import",
|
|
2479
|
+
"n": "node",
|
|
2480
|
+
"vitest": "test",
|
|
2481
|
+
"yml": "yaml"
|
|
2482
|
+
};
|
|
2483
|
+
function luxass(options = {}, ...userConfigs) {
|
|
2466
2484
|
const {
|
|
2467
2485
|
astro: enableAstro = false,
|
|
2486
|
+
autoRenamePlugins = true,
|
|
2468
2487
|
editor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
|
|
2469
2488
|
exts = [],
|
|
2470
2489
|
gitignore: enableGitignore = true,
|
|
@@ -2627,11 +2646,15 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2627
2646
|
if (Object.keys(fusedConfig).length) {
|
|
2628
2647
|
configs.push([fusedConfig]);
|
|
2629
2648
|
}
|
|
2630
|
-
|
|
2649
|
+
let pipeline = new FlatConfigPipeline();
|
|
2650
|
+
pipeline = pipeline.append(
|
|
2631
2651
|
...configs,
|
|
2632
2652
|
...userConfigs
|
|
2633
2653
|
);
|
|
2634
|
-
|
|
2654
|
+
if (autoRenamePlugins) {
|
|
2655
|
+
pipeline = pipeline.renamePlugins(defaultPluginRenaming);
|
|
2656
|
+
}
|
|
2657
|
+
return pipeline;
|
|
2635
2658
|
}
|
|
2636
2659
|
|
|
2637
2660
|
// src/index.ts
|
|
@@ -2677,10 +2700,10 @@ export {
|
|
|
2677
2700
|
javascript,
|
|
2678
2701
|
jsdoc,
|
|
2679
2702
|
jsonc,
|
|
2680
|
-
luxass,
|
|
2681
2703
|
markdown,
|
|
2682
2704
|
nextjs,
|
|
2683
2705
|
node,
|
|
2706
|
+
parserPlain,
|
|
2684
2707
|
react,
|
|
2685
2708
|
renameRules,
|
|
2686
2709
|
resolveSubOptions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
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"
|