@liwo/eslint-config 0.0.1 → 0.0.3

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,5 @@
1
1
  import { FlatConfigComposer } from "eslint-flat-config-utils";
2
2
  import { isPackageExists } from "local-pkg";
3
- import process from "node:process";
4
- import { fileURLToPath } from "node:url";
5
3
  import createCommand from "eslint-plugin-command/config";
6
4
  import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
7
5
  import pluginAntfu from "eslint-plugin-antfu";
@@ -10,10 +8,36 @@ import pluginNode from "eslint-plugin-n";
10
8
  import pluginPerfectionist from "eslint-plugin-perfectionist";
11
9
  import pluginUnicorn from "eslint-plugin-unicorn";
12
10
  import pluginUnusedImports from "eslint-plugin-unused-imports";
11
+ import process from "node:process";
12
+ import { fileURLToPath } from "node:url";
13
13
  import globals from "globals";
14
14
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
15
15
  import { configs } from "eslint-plugin-regexp";
16
16
 
17
+ //#region src/configs/command.ts
18
+ async function command() {
19
+ return [{
20
+ ...createCommand(),
21
+ name: "liwo/command/rules"
22
+ }];
23
+ }
24
+
25
+ //#endregion
26
+ //#region src/configs/comments.ts
27
+ async function comments() {
28
+ return [{
29
+ name: "liwo/eslint-comments/rules",
30
+ plugins: { "eslint-comments": pluginComments },
31
+ rules: {
32
+ "eslint-comments/no-aggregating-enable": "error",
33
+ "eslint-comments/no-duplicate-disable": "error",
34
+ "eslint-comments/no-unlimited-disable": "error",
35
+ "eslint-comments/no-unused-enable": "error"
36
+ }
37
+ }];
38
+ }
39
+
40
+ //#endregion
17
41
  //#region src/globs.ts
18
42
  const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
19
43
  const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
@@ -31,15 +55,12 @@ const GLOB_JSON5 = "**/*.json5";
31
55
  const GLOB_JSONC = "**/*.jsonc";
32
56
  const GLOB_MARKDOWN = "**/*.md";
33
57
  const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
34
- const GLOB_SVELTE = "**/*.svelte?(.{js,ts})";
35
58
  const GLOB_VUE = "**/*.vue";
36
59
  const GLOB_YAML = "**/*.y?(a)ml";
37
60
  const GLOB_TOML = "**/*.toml";
38
61
  const GLOB_XML = "**/*.xml";
39
62
  const GLOB_SVG = "**/*.svg";
40
63
  const GLOB_HTML = "**/*.htm?(l)";
41
- const GLOB_ASTRO = "**/*.astro";
42
- const GLOB_ASTRO_TS = "**/*.astro/*.ts";
43
64
  const GLOB_GRAPHQL = "**/*.{g,graph}ql";
44
65
  const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
45
66
  const GLOB_TESTS = [
@@ -55,7 +76,6 @@ const GLOB_ALL_SRC = [
55
76
  GLOB_JSON,
56
77
  GLOB_JSON5,
57
78
  GLOB_MARKDOWN,
58
- GLOB_SVELTE,
59
79
  GLOB_VUE,
60
80
  GLOB_YAML,
61
81
  GLOB_XML,
@@ -95,10 +115,65 @@ const GLOB_EXCLUDE = [
95
115
  "**/components.d.ts"
96
116
  ];
97
117
 
118
+ //#endregion
119
+ //#region src/configs/disables.ts
120
+ async function disables() {
121
+ return [
122
+ {
123
+ files: [`**/scripts/${GLOB_SRC}`],
124
+ name: "liwo/disables/scripts",
125
+ rules: {
126
+ "antfu/no-top-level-await": "off",
127
+ "no-console": "off",
128
+ "ts/explicit-function-return-type": "off"
129
+ }
130
+ },
131
+ {
132
+ files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
133
+ name: "liwo/disables/cli",
134
+ rules: {
135
+ "antfu/no-top-level-await": "off",
136
+ "no-console": "off"
137
+ }
138
+ },
139
+ {
140
+ files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
141
+ name: "liwo/disables/bin",
142
+ rules: {
143
+ "antfu/no-import-dist": "off",
144
+ "antfu/no-import-node-modules-by-path": "off"
145
+ }
146
+ },
147
+ {
148
+ files: ["**/*.d.?([cm])ts"],
149
+ name: "liwo/disables/dts",
150
+ rules: {
151
+ "eslint-comments/no-unlimited-disable": "off",
152
+ "no-restricted-syntax": "off",
153
+ "unused-imports/no-unused-vars": "off"
154
+ }
155
+ },
156
+ {
157
+ files: ["**/*.js", "**/*.cjs"],
158
+ name: "liwo/disables/cjs",
159
+ rules: { "ts/no-require-imports": "off" }
160
+ },
161
+ {
162
+ files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
163
+ name: "liwo/disables/config-files",
164
+ rules: {
165
+ "antfu/no-top-level-await": "off",
166
+ "no-console": "off",
167
+ "ts/explicit-function-return-type": "off"
168
+ }
169
+ }
170
+ ];
171
+ }
172
+
98
173
  //#endregion
99
174
  //#region src/utils.ts
100
175
  const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
101
- const isCwdInScope = isPackageExists("@antfu/eslint-config");
176
+ const isCwdInScope = isPackageExists("@liwo/eslint-config");
102
177
  const parserPlain = {
103
178
  meta: { name: "parser-plain" },
104
179
  parseForESLint: (code) => ({
@@ -131,7 +206,7 @@ async function combine(...configs$1) {
131
206
  *
132
207
  * @example
133
208
  * ```ts
134
- * import { renameRules } from '@antfu/eslint-config'
209
+ * import { renameRules } from '@liwo/eslint-config'
135
210
  *
136
211
  * export default [{
137
212
  * rules: renameRules(
@@ -154,7 +229,7 @@ function renameRules(rules, map) {
154
229
  *
155
230
  * @example
156
231
  * ```ts
157
- * import { renamePluginInConfigs } from '@antfu/eslint-config'
232
+ * import { renamePluginInConfigs } from '@liwo/eslint-config'
158
233
  * import someConfigs from './some-configs'
159
234
  *
160
235
  * export default renamePluginInConfigs(someConfigs, {
@@ -201,133 +276,6 @@ function isInGitHooksOrLintStaged() {
201
276
  return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
202
277
  }
203
278
 
204
- //#endregion
205
- //#region src/configs/astro.ts
206
- async function astro(options = {}) {
207
- const { files = [GLOB_ASTRO], overrides = {}, stylistic: stylistic$1 = true } = options;
208
- const [pluginAstro, parserAstro, parserTs] = await Promise.all([
209
- interopDefault(import("eslint-plugin-astro")),
210
- interopDefault(import("astro-eslint-parser")),
211
- interopDefault(import("@typescript-eslint/parser"))
212
- ]);
213
- return [{
214
- name: "antfu/astro/setup",
215
- plugins: { astro: pluginAstro }
216
- }, {
217
- files,
218
- languageOptions: {
219
- globals: pluginAstro.environments.astro.globals,
220
- parser: parserAstro,
221
- parserOptions: {
222
- extraFileExtensions: [".astro"],
223
- parser: parserTs
224
- },
225
- sourceType: "module"
226
- },
227
- name: "antfu/astro/rules",
228
- processor: "astro/client-side-ts",
229
- rules: {
230
- "antfu/no-top-level-await": "off",
231
- "astro/missing-client-only-directive-value": "error",
232
- "astro/no-conflict-set-directives": "error",
233
- "astro/no-deprecated-astro-canonicalurl": "error",
234
- "astro/no-deprecated-astro-fetchcontent": "error",
235
- "astro/no-deprecated-astro-resolve": "error",
236
- "astro/no-deprecated-getentrybyslug": "error",
237
- "astro/no-set-html-directive": "off",
238
- "astro/no-unused-define-vars-in-style": "error",
239
- "astro/semi": "off",
240
- "astro/valid-compile": "error",
241
- ...stylistic$1 ? {
242
- "style/indent": "off",
243
- "style/jsx-closing-tag-location": "off",
244
- "style/jsx-one-expression-per-line": "off",
245
- "style/no-multiple-empty-lines": "off"
246
- } : {},
247
- ...overrides
248
- }
249
- }];
250
- }
251
-
252
- //#endregion
253
- //#region src/configs/command.ts
254
- async function command() {
255
- return [{
256
- ...createCommand(),
257
- name: "antfu/command/rules"
258
- }];
259
- }
260
-
261
- //#endregion
262
- //#region src/configs/comments.ts
263
- async function comments() {
264
- return [{
265
- name: "antfu/eslint-comments/rules",
266
- plugins: { "eslint-comments": pluginComments },
267
- rules: {
268
- "eslint-comments/no-aggregating-enable": "error",
269
- "eslint-comments/no-duplicate-disable": "error",
270
- "eslint-comments/no-unlimited-disable": "error",
271
- "eslint-comments/no-unused-enable": "error"
272
- }
273
- }];
274
- }
275
-
276
- //#endregion
277
- //#region src/configs/disables.ts
278
- async function disables() {
279
- return [
280
- {
281
- files: [`**/scripts/${GLOB_SRC}`],
282
- name: "antfu/disables/scripts",
283
- rules: {
284
- "antfu/no-top-level-await": "off",
285
- "no-console": "off",
286
- "ts/explicit-function-return-type": "off"
287
- }
288
- },
289
- {
290
- files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
291
- name: "antfu/disables/cli",
292
- rules: {
293
- "antfu/no-top-level-await": "off",
294
- "no-console": "off"
295
- }
296
- },
297
- {
298
- files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
299
- name: "antfu/disables/bin",
300
- rules: {
301
- "antfu/no-import-dist": "off",
302
- "antfu/no-import-node-modules-by-path": "off"
303
- }
304
- },
305
- {
306
- files: ["**/*.d.?([cm])ts"],
307
- name: "antfu/disables/dts",
308
- rules: {
309
- "eslint-comments/no-unlimited-disable": "off",
310
- "no-restricted-syntax": "off",
311
- "unused-imports/no-unused-vars": "off"
312
- }
313
- },
314
- {
315
- files: ["**/*.js", "**/*.cjs"],
316
- name: "antfu/disables/cjs",
317
- rules: { "ts/no-require-imports": "off" }
318
- },
319
- {
320
- files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
321
- name: "antfu/disables/config-files",
322
- rules: {
323
- "antfu/no-top-level-await": "off",
324
- "no-console": "off",
325
- "ts/explicit-function-return-type": "off"
326
- }
327
- }
328
- ];
329
- }
330
-
331
279
  //#endregion
332
280
  //#region src/configs/stylistic.ts
333
281
  const StylisticConfigDefaults = {
@@ -350,7 +298,7 @@ async function stylistic(options = {}) {
350
298
  semi
351
299
  });
352
300
  return [{
353
- name: "antfu/stylistic/rules",
301
+ name: "liwo/stylistic/rules",
354
302
  plugins: {
355
303
  antfu: pluginAntfu,
356
304
  style: pluginStylistic
@@ -390,7 +338,6 @@ async function formatters(options = {}, stylistic$1 = {}) {
390
338
  if (options === true) {
391
339
  const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
392
340
  options = {
393
- astro: isPackageInScope("prettier-plugin-astro"),
394
341
  css: true,
395
342
  graphql: true,
396
343
  html: true,
@@ -403,7 +350,6 @@ async function formatters(options = {}, stylistic$1 = {}) {
403
350
  await ensurePackages([
404
351
  "eslint-plugin-format",
405
352
  options.markdown && options.slidev ? "prettier-plugin-slidev" : void 0,
406
- options.astro ? "prettier-plugin-astro" : void 0,
407
353
  options.xml || options.svg ? "@prettier/plugin-xml" : void 0
408
354
  ]);
409
355
  if (options.slidev && options.markdown !== true && options.markdown !== "prettier") throw new Error("`slidev` option only works when `markdown` is enabled with `prettier`");
@@ -433,35 +379,35 @@ async function formatters(options = {}, stylistic$1 = {}) {
433
379
  }, options.dprintOptions || {});
434
380
  const pluginFormat = await interopDefault(import("eslint-plugin-format"));
435
381
  const configs$1 = [{
436
- name: "antfu/formatter/setup",
382
+ name: "liwo/formatter/setup",
437
383
  plugins: { format: pluginFormat }
438
384
  }];
439
385
  if (options.css) configs$1.push({
440
386
  files: [GLOB_CSS, GLOB_POSTCSS],
441
387
  languageOptions: { parser: parserPlain },
442
- name: "antfu/formatter/css",
388
+ name: "liwo/formatter/css",
443
389
  rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, { parser: "css" })] }
444
390
  }, {
445
391
  files: [GLOB_SCSS],
446
392
  languageOptions: { parser: parserPlain },
447
- name: "antfu/formatter/scss",
393
+ name: "liwo/formatter/scss",
448
394
  rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, { parser: "scss" })] }
449
395
  }, {
450
396
  files: [GLOB_LESS],
451
397
  languageOptions: { parser: parserPlain },
452
- name: "antfu/formatter/less",
398
+ name: "liwo/formatter/less",
453
399
  rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, { parser: "less" })] }
454
400
  });
455
401
  if (options.html) configs$1.push({
456
402
  files: [GLOB_HTML],
457
403
  languageOptions: { parser: parserPlain },
458
- name: "antfu/formatter/html",
404
+ name: "liwo/formatter/html",
459
405
  rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, { parser: "html" })] }
460
406
  });
461
407
  if (options.xml) configs$1.push({
462
408
  files: [GLOB_XML],
463
409
  languageOptions: { parser: parserPlain },
464
- name: "antfu/formatter/xml",
410
+ name: "liwo/formatter/xml",
465
411
  rules: { "format/prettier": ["error", mergePrettierOptions({
466
412
  ...prettierXmlOptions,
467
413
  ...prettierOptions
@@ -473,7 +419,7 @@ async function formatters(options = {}, stylistic$1 = {}) {
473
419
  if (options.svg) configs$1.push({
474
420
  files: [GLOB_SVG],
475
421
  languageOptions: { parser: parserPlain },
476
- name: "antfu/formatter/svg",
422
+ name: "liwo/formatter/svg",
477
423
  rules: { "format/prettier": ["error", mergePrettierOptions({
478
424
  ...prettierXmlOptions,
479
425
  ...prettierOptions
@@ -489,7 +435,7 @@ async function formatters(options = {}, stylistic$1 = {}) {
489
435
  files: [GLOB_MARKDOWN],
490
436
  ignores: GLOB_SLIDEV,
491
437
  languageOptions: { parser: parserPlain },
492
- name: "antfu/formatter/markdown",
438
+ name: "liwo/formatter/markdown",
493
439
  rules: { [`format/${formater}`]: ["error", formater === "prettier" ? mergePrettierOptions(prettierOptions, {
494
440
  embeddedLanguageFormatting: "off",
495
441
  parser: "markdown"
@@ -501,7 +447,7 @@ async function formatters(options = {}, stylistic$1 = {}) {
501
447
  if (options.slidev) configs$1.push({
502
448
  files: GLOB_SLIDEV,
503
449
  languageOptions: { parser: parserPlain },
504
- name: "antfu/formatter/slidev",
450
+ name: "liwo/formatter/slidev",
505
451
  rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, {
506
452
  embeddedLanguageFormatting: "off",
507
453
  parser: "slidev",
@@ -509,34 +455,10 @@ async function formatters(options = {}, stylistic$1 = {}) {
509
455
  })] }
510
456
  });
511
457
  }
512
- if (options.astro) {
513
- configs$1.push({
514
- files: [GLOB_ASTRO],
515
- languageOptions: { parser: parserPlain },
516
- name: "antfu/formatter/astro",
517
- rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, {
518
- parser: "astro",
519
- plugins: ["prettier-plugin-astro"]
520
- })] }
521
- });
522
- configs$1.push({
523
- files: [GLOB_ASTRO, GLOB_ASTRO_TS],
524
- name: "antfu/formatter/astro/disables",
525
- rules: {
526
- "style/arrow-parens": "off",
527
- "style/block-spacing": "off",
528
- "style/comma-dangle": "off",
529
- "style/indent": "off",
530
- "style/no-multi-spaces": "off",
531
- "style/quotes": "off",
532
- "style/semi": "off"
533
- }
534
- });
535
- }
536
458
  if (options.graphql) configs$1.push({
537
459
  files: [GLOB_GRAPHQL],
538
460
  languageOptions: { parser: parserPlain },
539
- name: "antfu/formatter/graphql",
461
+ name: "liwo/formatter/graphql",
540
462
  rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, { parser: "graphql" })] }
541
463
  });
542
464
  return configs$1;
@@ -547,7 +469,7 @@ async function formatters(options = {}, stylistic$1 = {}) {
547
469
  async function ignores(userIgnores = []) {
548
470
  return [{
549
471
  ignores: [...GLOB_EXCLUDE, ...userIgnores],
550
- name: "antfu/ignores"
472
+ name: "liwo/ignores"
551
473
  }];
552
474
  }
553
475
 
@@ -556,7 +478,7 @@ async function ignores(userIgnores = []) {
556
478
  async function imports(options = {}) {
557
479
  const { overrides = {}, stylistic: stylistic$1 = true } = options;
558
480
  return [{
559
- name: "antfu/imports/rules",
481
+ name: "liwo/imports/rules",
560
482
  plugins: {
561
483
  antfu: pluginAntfu,
562
484
  import: pluginImportLite
@@ -599,9 +521,9 @@ async function javascript(options = {}) {
599
521
  sourceType: "module"
600
522
  },
601
523
  linterOptions: { reportUnusedDisableDirectives: true },
602
- name: "antfu/javascript/setup"
524
+ name: "liwo/javascript/setup"
603
525
  }, {
604
- name: "antfu/javascript/rules",
526
+ name: "liwo/javascript/rules",
605
527
  plugins: {
606
528
  "antfu": pluginAntfu,
607
529
  "unused-imports": pluginUnusedImports
@@ -806,7 +728,7 @@ async function javascript(options = {}) {
806
728
  async function jsdoc(options = {}) {
807
729
  const { stylistic: stylistic$1 = true } = options;
808
730
  return [{
809
- name: "antfu/jsdoc/rules",
731
+ name: "liwo/jsdoc/rules",
810
732
  plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) },
811
733
  rules: {
812
734
  "jsdoc/check-access": "warn",
@@ -843,12 +765,12 @@ async function jsonc(options = {}) {
843
765
  const { indent = 2 } = typeof stylistic$1 === "boolean" ? {} : stylistic$1;
844
766
  const [pluginJsonc, parserJsonc] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
845
767
  return [{
846
- name: "antfu/jsonc/setup",
768
+ name: "liwo/jsonc/setup",
847
769
  plugins: { jsonc: pluginJsonc }
848
770
  }, {
849
771
  files,
850
772
  languageOptions: { parser: parserJsonc },
851
- name: "antfu/jsonc/rules",
773
+ name: "liwo/jsonc/rules",
852
774
  rules: {
853
775
  "jsonc/no-bigint-literals": "error",
854
776
  "jsonc/no-binary-expression": "error",
@@ -905,7 +827,7 @@ async function jsx() {
905
827
  return [{
906
828
  files: [GLOB_JSX, GLOB_TSX],
907
829
  languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
908
- name: "antfu/jsx/setup"
830
+ name: "liwo/jsx/setup"
909
831
  }];
910
832
  }
911
833
 
@@ -916,24 +838,24 @@ async function markdown(options = {}) {
916
838
  const markdown$1 = await interopDefault(import("@eslint/markdown"));
917
839
  return [
918
840
  {
919
- name: "antfu/markdown/setup",
841
+ name: "liwo/markdown/setup",
920
842
  plugins: { markdown: markdown$1 }
921
843
  },
922
844
  {
923
845
  files,
924
846
  ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
925
- name: "antfu/markdown/processor",
847
+ name: "liwo/markdown/processor",
926
848
  processor: mergeProcessors([markdown$1.processors.markdown, processorPassThrough])
927
849
  },
928
850
  {
929
851
  files,
930
852
  languageOptions: { parser: parserPlain },
931
- name: "antfu/markdown/parser"
853
+ name: "liwo/markdown/parser"
932
854
  },
933
855
  {
934
856
  files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
935
857
  languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
936
- name: "antfu/markdown/disables",
858
+ name: "liwo/markdown/disables",
937
859
  rules: {
938
860
  "antfu/no-top-level-await": "off",
939
861
  "no-alert": "off",
@@ -970,7 +892,7 @@ async function markdown(options = {}) {
970
892
  //#region src/configs/node.ts
971
893
  async function node() {
972
894
  return [{
973
- name: "antfu/node/rules",
895
+ name: "liwo/node/rules",
974
896
  plugins: { node: pluginNode },
975
897
  rules: {
976
898
  "node/handle-callback-err": ["error", "^(err|error)$"],
@@ -994,7 +916,7 @@ async function node() {
994
916
  */
995
917
  async function perfectionist() {
996
918
  return [{
997
- name: "antfu/perfectionist/setup",
919
+ name: "liwo/perfectionist/setup",
998
920
  plugins: { perfectionist: pluginPerfectionist },
999
921
  rules: {
1000
922
  "perfectionist/sort-exports": ["error", {
@@ -1049,17 +971,17 @@ async function pnpm() {
1049
971
  return [{
1050
972
  files: ["package.json", "**/package.json"],
1051
973
  languageOptions: { parser: jsoncParser },
1052
- name: "antfu/pnpm/package-json",
974
+ name: "liwo/pnpm/package-json",
1053
975
  plugins: { pnpm: pluginPnpm },
1054
976
  rules: {
1055
- "pnpm/json-enforce-catalog": "error",
1056
- "pnpm/json-prefer-workspace-settings": "error",
977
+ "pnpm/json-enforce-catalog": "off",
978
+ "pnpm/json-prefer-workspace-settings": "off",
1057
979
  "pnpm/json-valid-catalog": "error"
1058
980
  }
1059
981
  }, {
1060
982
  files: ["pnpm-workspace.yaml"],
1061
983
  languageOptions: { parser: yamlParser },
1062
- name: "antfu/pnpm/pnpm-workspace-yaml",
984
+ name: "liwo/pnpm/pnpm-workspace-yaml",
1063
985
  plugins: { pnpm: pluginPnpm },
1064
986
  rules: {
1065
987
  "pnpm/yaml-no-duplicate-catalog-item": "error",
@@ -1085,7 +1007,7 @@ const ReactRouterPackages = [
1085
1007
  ];
1086
1008
  const NextJsPackages = ["next"];
1087
1009
  async function react(options = {}) {
1088
- const { files = [GLOB_SRC], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS], overrides = {}, tsconfigPath } = options;
1010
+ const { files = [GLOB_SRC], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`], overrides = {}, tsconfigPath } = options;
1089
1011
  await ensurePackages([
1090
1012
  "@eslint-react/eslint-plugin",
1091
1013
  "eslint-plugin-react-hooks",
@@ -1105,7 +1027,7 @@ async function react(options = {}) {
1105
1027
  const plugins = pluginReact.configs.all.plugins;
1106
1028
  return [
1107
1029
  {
1108
- name: "antfu/react/setup",
1030
+ name: "liwo/react/setup",
1109
1031
  plugins: {
1110
1032
  "react": plugins["@eslint-react"],
1111
1033
  "react-dom": plugins["@eslint-react/dom"],
@@ -1122,7 +1044,7 @@ async function react(options = {}) {
1122
1044
  parserOptions: { ecmaFeatures: { jsx: true } },
1123
1045
  sourceType: "module"
1124
1046
  },
1125
- name: "antfu/react/rules",
1047
+ name: "liwo/react/rules",
1126
1048
  rules: {
1127
1049
  "react/jsx-no-duplicate-props": "warn",
1128
1050
  "react/jsx-uses-vars": "warn",
@@ -1220,7 +1142,7 @@ async function react(options = {}) {
1220
1142
  ...isTypeAware ? [{
1221
1143
  files: filesTypeAware,
1222
1144
  ignores: ignoresTypeAware,
1223
- name: "antfu/react/type-aware-rules",
1145
+ name: "liwo/react/type-aware-rules",
1224
1146
  rules: { ...typeAwareRules }
1225
1147
  }] : []
1226
1148
  ];
@@ -1236,7 +1158,7 @@ async function regexp(options = {}) {
1236
1158
  }
1237
1159
  return [{
1238
1160
  ...config,
1239
- name: "antfu/regexp/rules",
1161
+ name: "liwo/regexp/rules",
1240
1162
  rules: {
1241
1163
  ...rules,
1242
1164
  ...options.overrides
@@ -1254,7 +1176,7 @@ async function regexp(options = {}) {
1254
1176
  async function sortPackageJson() {
1255
1177
  return [{
1256
1178
  files: ["**/package.json"],
1257
- name: "antfu/sort/package-json",
1179
+ name: "liwo/sort/package-json",
1258
1180
  rules: {
1259
1181
  "jsonc/sort-array-values": ["error", {
1260
1182
  order: { type: "asc" },
@@ -1356,7 +1278,7 @@ async function sortPackageJson() {
1356
1278
  function sortTsconfig() {
1357
1279
  return [{
1358
1280
  files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
1359
- name: "antfu/sort/tsconfig-json",
1281
+ name: "liwo/sort/tsconfig-json",
1360
1282
  rules: { "jsonc/sort-keys": [
1361
1283
  "error",
1362
1284
  {
@@ -1484,11 +1406,11 @@ async function test(options = {}) {
1484
1406
  }
1485
1407
  };
1486
1408
  return [{
1487
- name: "antfu/test/setup",
1409
+ name: "liwo/test/setup",
1488
1410
  plugins: { test: _pluginTest }
1489
1411
  }, {
1490
1412
  files,
1491
- name: "antfu/test/rules",
1413
+ name: "liwo/test/rules",
1492
1414
  rules: {
1493
1415
  "test/consistent-test-it": ["error", {
1494
1416
  fn: "it",
@@ -1515,12 +1437,12 @@ async function toml(options = {}) {
1515
1437
  const { indent = 2 } = typeof stylistic$1 === "boolean" ? {} : stylistic$1;
1516
1438
  const [pluginToml, parserToml] = await Promise.all([interopDefault(import("eslint-plugin-toml")), interopDefault(import("toml-eslint-parser"))]);
1517
1439
  return [{
1518
- name: "antfu/toml/setup",
1440
+ name: "liwo/toml/setup",
1519
1441
  plugins: { toml: pluginToml }
1520
1442
  }, {
1521
1443
  files,
1522
1444
  languageOptions: { parser: parserToml },
1523
- name: "antfu/toml/rules",
1445
+ name: "liwo/toml/rules",
1524
1446
  rules: {
1525
1447
  "style/spaced-comment": "off",
1526
1448
  "toml/comma-style": "error",
@@ -1559,7 +1481,7 @@ async function typescript(options = {}) {
1559
1481
  ...componentExts.map((ext) => `**/*.${ext}`)
1560
1482
  ];
1561
1483
  const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
1562
- const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS];
1484
+ const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`];
1563
1485
  const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
1564
1486
  const isTypeAware = !!tsconfigPath;
1565
1487
  const typeAwareRules = {
@@ -1608,12 +1530,12 @@ async function typescript(options = {}) {
1608
1530
  ...parserOptions
1609
1531
  }
1610
1532
  },
1611
- name: `antfu/typescript/${typeAware ? "type-aware-parser" : "parser"}`
1533
+ name: `liwo/typescript/${typeAware ? "type-aware-parser" : "parser"}`
1612
1534
  };
1613
1535
  }
1614
1536
  return [
1615
1537
  {
1616
- name: "antfu/typescript/setup",
1538
+ name: "liwo/typescript/setup",
1617
1539
  plugins: {
1618
1540
  antfu: pluginAntfu,
1619
1541
  ts: pluginTs
@@ -1622,7 +1544,7 @@ async function typescript(options = {}) {
1622
1544
  ...isTypeAware ? [makeParser(false, files), makeParser(true, filesTypeAware, ignoresTypeAware)] : [makeParser(false, files)],
1623
1545
  {
1624
1546
  files,
1625
- name: "antfu/typescript/rules",
1547
+ name: "liwo/typescript/rules",
1626
1548
  rules: {
1627
1549
  ...renameRules(pluginTs.configs["eslint-recommended"].overrides[0].rules, { "@typescript-eslint": "ts" }),
1628
1550
  ...renameRules(pluginTs.configs.strict.rules, { "@typescript-eslint": "ts" }),
@@ -1674,7 +1596,7 @@ async function typescript(options = {}) {
1674
1596
  ...isTypeAware ? [{
1675
1597
  files: filesTypeAware,
1676
1598
  ignores: ignoresTypeAware,
1677
- name: "antfu/typescript/rules-type-aware",
1599
+ name: "liwo/typescript/rules-type-aware",
1678
1600
  rules: {
1679
1601
  ...typeAwareRules,
1680
1602
  ...overridesTypeAware
@@ -1688,7 +1610,7 @@ async function typescript(options = {}) {
1688
1610
  async function unicorn(options = {}) {
1689
1611
  const { allRecommended = false, overrides = {} } = options;
1690
1612
  return [{
1691
- name: "antfu/unicorn/rules",
1613
+ name: "liwo/unicorn/rules",
1692
1614
  plugins: { unicorn: pluginUnicorn },
1693
1615
  rules: {
1694
1616
  ...allRecommended ? pluginUnicorn.configs.recommended.rules : {
@@ -1720,7 +1642,7 @@ async function unocss(options = {}) {
1720
1642
  await ensurePackages(["@unocss/eslint-plugin"]);
1721
1643
  const [pluginUnoCSS] = await Promise.all([interopDefault(import("@unocss/eslint-plugin"))]);
1722
1644
  return [{
1723
- name: "antfu/unocss",
1645
+ name: "liwo/unocss",
1724
1646
  plugins: { unocss: pluginUnoCSS },
1725
1647
  rules: {
1726
1648
  "unocss/order": "warn",
@@ -1760,7 +1682,7 @@ async function vue(options = {}) {
1760
1682
  watch: "readonly",
1761
1683
  watchEffect: "readonly"
1762
1684
  } },
1763
- name: "antfu/vue/setup",
1685
+ name: "liwo/vue/setup",
1764
1686
  plugins: {
1765
1687
  vue: pluginVue,
1766
1688
  ...a11y ? { "vue-a11y": pluginVueA11y } : {}
@@ -1776,7 +1698,7 @@ async function vue(options = {}) {
1776
1698
  sourceType: "module"
1777
1699
  }
1778
1700
  },
1779
- name: "antfu/vue/rules",
1701
+ name: "liwo/vue/rules",
1780
1702
  processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors([pluginVue.processors[".vue"], processorVueBlocks({
1781
1703
  ...sfcBlocks,
1782
1704
  blocks: {
@@ -1944,13 +1866,13 @@ async function yaml(options = {}) {
1944
1866
  const [pluginYaml, parserYaml] = await Promise.all([interopDefault(import("eslint-plugin-yml")), interopDefault(import("yaml-eslint-parser"))]);
1945
1867
  return [
1946
1868
  {
1947
- name: "antfu/yaml/setup",
1869
+ name: "liwo/yaml/setup",
1948
1870
  plugins: { yaml: pluginYaml }
1949
1871
  },
1950
1872
  {
1951
1873
  files,
1952
1874
  languageOptions: { parser: parserYaml },
1953
- name: "antfu/yaml/rules",
1875
+ name: "liwo/yaml/rules",
1954
1876
  rules: {
1955
1877
  "style/spaced-comment": "off",
1956
1878
  "yaml/block-mapping": "error",
@@ -1981,7 +1903,7 @@ async function yaml(options = {}) {
1981
1903
  },
1982
1904
  {
1983
1905
  files: ["pnpm-workspace.yaml"],
1984
- name: "antfu/yaml/pnpm-workspace",
1906
+ name: "liwo/yaml/pnpm-workspace",
1985
1907
  rules: { "yaml/sort-keys": [
1986
1908
  "error",
1987
1909
  {
@@ -2054,22 +1976,22 @@ const defaultPluginRenaming = {
2054
1976
  * @returns {Promise<TypedFlatConfigItem[]>}
2055
1977
  * The merged ESLint configurations.
2056
1978
  */
2057
- function antfu(options = {}, ...userConfigs) {
2058
- const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
1979
+ function eslintConfig(options = {}, ...userConfigs) {
1980
+ const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = false, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2059
1981
  let isInEditor = options.isInEditor;
2060
1982
  if (isInEditor == null) {
2061
1983
  isInEditor = isInEditorEnv();
2062
- if (isInEditor) console.log("[@antfu/eslint-config] Detected running in editor, some rules are disabled.");
1984
+ if (isInEditor) console.log("[@liwo/eslint-config] Detected running in editor, some rules are disabled.");
2063
1985
  }
2064
1986
  const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
2065
1987
  if (stylisticOptions && !("jsx" in stylisticOptions)) stylisticOptions.jsx = enableJsx;
2066
1988
  const configs$1 = [];
2067
1989
  if (enableGitignore) if (typeof enableGitignore !== "boolean") configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
2068
- name: "antfu/gitignore",
1990
+ name: "liwo/gitignore",
2069
1991
  ...enableGitignore
2070
1992
  })]));
2071
1993
  else configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
2072
- name: "antfu/gitignore",
1994
+ name: "liwo/gitignore",
2073
1995
  strict: false
2074
1996
  })]));
2075
1997
  const typescriptOptions = resolveSubOptions(options, "typescript");
@@ -2116,10 +2038,6 @@ function antfu(options = {}, ...userConfigs) {
2116
2038
  ...resolveSubOptions(options, "unocss"),
2117
2039
  overrides: getOverrides(options, "unocss")
2118
2040
  }));
2119
- if (enableAstro) configs$1.push(astro({
2120
- overrides: getOverrides(options, "astro"),
2121
- stylistic: stylisticOptions
2122
- }));
2123
2041
  if (options.jsonc ?? true) configs$1.push(jsonc({
2124
2042
  overrides: getOverrides(options, "jsonc"),
2125
2043
  stylistic: stylisticOptions
@@ -2139,7 +2057,7 @@ function antfu(options = {}, ...userConfigs) {
2139
2057
  }));
2140
2058
  if (options.formatters) configs$1.push(formatters(options.formatters, typeof stylisticOptions === "boolean" ? {} : stylisticOptions));
2141
2059
  configs$1.push(disables());
2142
- if ("files" in options) throw new Error("[@antfu/eslint-config] The first argument should not contain the \"files\" property as the options are supposed to be global. Place it in the second or later config instead.");
2060
+ if ("files" in options) throw new Error("[@liwo/eslint-config] The first argument should not contain the \"files\" property as the options are supposed to be global. Place it in the second or later config instead.");
2143
2061
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
2144
2062
  if (key in options) acc[key] = options[key];
2145
2063
  return acc;
@@ -2165,7 +2083,7 @@ function getOverrides(options, key) {
2165
2083
 
2166
2084
  //#endregion
2167
2085
  //#region src/index.ts
2168
- var src_default = antfu;
2086
+ var src_default = eslintConfig;
2169
2087
 
2170
2088
  //#endregion
2171
- export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, antfu, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
2089
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, eslintConfig, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };