@luxass/eslint-config 4.2.14 → 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/dist/index.js CHANGED
@@ -1,7 +1,14 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
1
7
  // src/factory.ts
2
8
  import process3 from "node:process";
3
9
  import { existsSync } from "node:fs";
4
10
  import { isPackageExists as isPackageExists4 } from "local-pkg";
11
+ import { FlatConfigPipeline } from "eslint-flat-config-utils";
5
12
 
6
13
  // src/configs/comments.ts
7
14
  import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
@@ -727,6 +734,26 @@ async function javascript(options = {}) {
727
734
  // src/utils.ts
728
735
  import process from "node:process";
729
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
+ };
730
757
  async function combine(...configs) {
731
758
  const resolved = await Promise.all(configs);
732
759
  return resolved.flat();
@@ -894,8 +921,28 @@ async function jsonc(options = {}) {
894
921
  ];
895
922
  }
896
923
 
924
+ // node_modules/.pnpm/eslint-parser-plain@0.1.0/node_modules/eslint-parser-plain/dist/index.mjs
925
+ var dist_exports = {};
926
+ __export(dist_exports, {
927
+ parseForESLint: () => parseForESLint
928
+ });
929
+ var parseForESLint = (code) => ({
930
+ ast: {
931
+ type: "Program",
932
+ loc: { start: 0, end: code.length },
933
+ range: [0, code.length],
934
+ body: [],
935
+ comments: [],
936
+ tokens: []
937
+ },
938
+ services: { isPlain: true },
939
+ scopeManager: null,
940
+ visitorKeys: {
941
+ Program: []
942
+ }
943
+ });
944
+
897
945
  // src/configs/markdown.ts
898
- import * as parserPlain from "eslint-parser-plain";
899
946
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
900
947
  async function markdown(options = {}) {
901
948
  const {
@@ -927,7 +974,7 @@ async function markdown(options = {}) {
927
974
  name: "luxass:markdown:parser",
928
975
  files,
929
976
  languageOptions: {
930
- parser: parserPlain
977
+ parser: dist_exports
931
978
  }
932
979
  },
933
980
  {
@@ -1942,7 +1989,7 @@ async function react(options = {}) {
1942
1989
  }
1943
1990
 
1944
1991
  // src/configs/astro.ts
1945
- async function astro(options) {
1992
+ async function astro(options = {}) {
1946
1993
  const {
1947
1994
  files = [GLOB_ASTRO],
1948
1995
  overrides = {},
@@ -2087,7 +2134,6 @@ async function tailwindcss(options = {}) {
2087
2134
  }
2088
2135
 
2089
2136
  // src/configs/formatters.ts
2090
- import * as parserPlain2 from "eslint-parser-plain";
2091
2137
  import { isPackageExists as isPackageExists3 } from "local-pkg";
2092
2138
  async function formatters(options = {}, stylistic2 = {}) {
2093
2139
  if (options === true) {
@@ -2145,7 +2191,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2145
2191
  name: "luxass:formatter:css",
2146
2192
  files: [GLOB_CSS, GLOB_POSTCSS],
2147
2193
  languageOptions: {
2148
- parser: parserPlain2
2194
+ parser: dist_exports
2149
2195
  },
2150
2196
  rules: {
2151
2197
  "format/prettier": [
@@ -2161,7 +2207,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2161
2207
  name: "luxass:formatter:scss",
2162
2208
  files: [GLOB_SCSS],
2163
2209
  languageOptions: {
2164
- parser: parserPlain2
2210
+ parser: dist_exports
2165
2211
  },
2166
2212
  rules: {
2167
2213
  "format/prettier": [
@@ -2177,7 +2223,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2177
2223
  name: "luxass:formatter:less",
2178
2224
  files: [GLOB_LESS],
2179
2225
  languageOptions: {
2180
- parser: parserPlain2
2226
+ parser: dist_exports
2181
2227
  },
2182
2228
  rules: {
2183
2229
  "format/prettier": [
@@ -2196,7 +2242,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2196
2242
  name: "luxass:formatter:html",
2197
2243
  files: ["**/*.html"],
2198
2244
  languageOptions: {
2199
- parser: parserPlain2
2245
+ parser: dist_exports
2200
2246
  },
2201
2247
  rules: {
2202
2248
  "format/prettier": [
@@ -2215,7 +2261,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2215
2261
  name: "luxass:formatter:markdown",
2216
2262
  files: [GLOB_MARKDOWN],
2217
2263
  languageOptions: {
2218
- parser: parserPlain2
2264
+ parser: dist_exports
2219
2265
  },
2220
2266
  rules: {
2221
2267
  [`format/${formater}`]: [
@@ -2238,7 +2284,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2238
2284
  name: "luxass:formatter:astro",
2239
2285
  files: [GLOB_ASTRO],
2240
2286
  languageOptions: {
2241
- parser: parserPlain2
2287
+ parser: dist_exports
2242
2288
  },
2243
2289
  rules: {
2244
2290
  "format/prettier": [
@@ -2259,7 +2305,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2259
2305
  name: "luxass:formatter:graphql",
2260
2306
  files: [GLOB_GRAPHQL],
2261
2307
  languageOptions: {
2262
- parser: parserPlain2
2308
+ parser: dist_exports
2263
2309
  },
2264
2310
  rules: {
2265
2311
  "format/prettier": [
@@ -2426,9 +2472,18 @@ var VuePackages = [
2426
2472
  "vitepress",
2427
2473
  "@slidev/cli"
2428
2474
  ];
2429
- async function luxass(options = {}, ...userConfigs) {
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) {
2430
2484
  const {
2431
2485
  astro: enableAstro = false,
2486
+ autoRenamePlugins = true,
2432
2487
  editor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
2433
2488
  exts = [],
2434
2489
  gitignore: enableGitignore = true,
@@ -2591,11 +2646,15 @@ async function luxass(options = {}, ...userConfigs) {
2591
2646
  if (Object.keys(fusedConfig).length) {
2592
2647
  configs.push([fusedConfig]);
2593
2648
  }
2594
- const merged = combine(
2649
+ let pipeline = new FlatConfigPipeline();
2650
+ pipeline = pipeline.append(
2595
2651
  ...configs,
2596
2652
  ...userConfigs
2597
2653
  );
2598
- return merged;
2654
+ if (autoRenamePlugins) {
2655
+ pipeline = pipeline.renamePlugins(defaultPluginRenaming);
2656
+ }
2657
+ return pipeline;
2599
2658
  }
2600
2659
 
2601
2660
  // src/index.ts
@@ -2641,10 +2700,10 @@ export {
2641
2700
  javascript,
2642
2701
  jsdoc,
2643
2702
  jsonc,
2644
- luxass,
2645
2703
  markdown,
2646
2704
  nextjs,
2647
2705
  node,
2706
+ parserPlain,
2648
2707
  react,
2649
2708
  renameRules,
2650
2709
  resolveSubOptions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "4.2.14",
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/eslint-define-config": "^1.23.0-2",
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-types/jsdoc": "^48.2.0",
102
- "@eslint-types/typescript-eslint": "^7.0.2",
103
- "@eslint-types/unicorn": "^51.0.1",
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.1",
112
- "eslint-plugin-jsdoc": "^48.2.1",
113
- "eslint-plugin-jsonc": "^2.13.0",
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.3.26",
122
- "eslint-plugin-vue": "^9.23.0",
123
- "eslint-plugin-yml": "^1.12.2",
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": "^14.0.0",
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.3",
136
- "@stylistic/eslint-plugin-migrate": "^1.6.3",
137
- "@types/eslint": "^8.56.5",
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.2.0",
141
- "@unocss/eslint-plugin": "^0.58.5",
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": "^8.57.0",
144
- "eslint-plugin-astro": "^0.32.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.0",
143
+ "eslint-plugin-react": "^7.34.1",
147
144
  "eslint-plugin-react-hooks": "^4.6.0",
148
- "eslint-plugin-react-refresh": "^0.4.5",
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.10.0",
152
+ "simple-git-hooks": "^2.11.1",
155
153
  "tsup": "^8.0.2",
156
- "typescript": "^5.4.2",
157
- "vitest": "^1.3.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"