@lincy/eslint-config 5.2.6 → 5.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.cjs CHANGED
@@ -66,6 +66,7 @@ __export(src_exports, {
66
66
  disables: () => disables,
67
67
  ensurePackages: () => ensurePackages,
68
68
  formatters: () => formatters,
69
+ getOverrides: () => getOverrides,
69
70
  ignores: () => ignores,
70
71
  imports: () => imports,
71
72
  interopDefault: () => interopDefault,
@@ -85,6 +86,7 @@ __export(src_exports, {
85
86
  regexp: () => regexp,
86
87
  renamePluginInConfigs: () => renamePluginInConfigs,
87
88
  renameRules: () => renameRules,
89
+ resolveSubOptions: () => resolveSubOptions,
88
90
  sortPackageJson: () => sortPackageJson,
89
91
  sortTsconfig: () => sortTsconfig,
90
92
  stylistic: () => stylistic,
@@ -99,7 +101,7 @@ __export(src_exports, {
99
101
  });
100
102
  module.exports = __toCommonJS(src_exports);
101
103
 
102
- // node_modules/.pnpm/tsup@8.3.0_jiti@2.3.3_postcss@8.4.47_tsx@4.19.1_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
104
+ // node_modules/.pnpm/tsup@8.3.5_jiti@2.3.3_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
103
105
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
104
106
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
105
107
 
@@ -347,7 +349,8 @@ async function ensurePackages(packages) {
347
349
  return;
348
350
  const p = await import("@clack/prompts");
349
351
  const result = await p.confirm({
350
- message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
352
+ // message: `${nonExistingPackages.length === 1 ? 'Package is' : 'Packages are'} required for this config: ${nonExistingPackages.join(', ')}. Do you want to install them?`,
353
+ message: `\u6B64\u914D\u7F6E\u9700\u8981\u8F6F\u4EF6\u5305: ${nonExistingPackages.join(", ")}. \u4F60\u60F3\u5B89\u88C5\u5B83\u4EEC\u5417?`
351
354
  });
352
355
  if (result)
353
356
  await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
@@ -412,7 +415,6 @@ async function stylistic(options = {}) {
412
415
  },
413
416
  // 覆盖`stylistic`默认规则
414
417
  "style/brace-style": ["error", "stroustrup"],
415
- "style/member-delimiter-style": ["error", { multiline: { delimiter: "none" } }],
416
418
  "style/multiline-ternary": ["error", "never"],
417
419
  ...overrides
418
420
  }
@@ -433,13 +435,23 @@ function mergePrettierOptions(options, overrides = {}) {
433
435
  }
434
436
  async function formatters(options = {}, stylistic2 = {}) {
435
437
  const defaultIndent = 4;
438
+ const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
436
439
  if (options === true) {
437
- const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
440
+ const isPrettierPluginXmlInScope2 = isPackageInScope("@prettier/plugin-xml");
438
441
  options = {
439
442
  css: false,
440
443
  graphql: true,
441
444
  html: true,
442
445
  markdown: true,
446
+ svg: isPrettierPluginXmlInScope2,
447
+ xml: isPrettierPluginXmlInScope2
448
+ };
449
+ } else {
450
+ options = {
451
+ css: options.css ?? false,
452
+ graphql: options.graphql ?? true,
453
+ html: options.html ?? true,
454
+ markdown: options.markdown ?? true,
443
455
  svg: isPrettierPluginXmlInScope,
444
456
  xml: isPrettierPluginXmlInScope
445
457
  };
@@ -485,7 +497,7 @@ async function formatters(options = {}, stylistic2 = {}) {
485
497
  const pluginFormat = await interopDefault(import("eslint-plugin-format"));
486
498
  const configs2 = [
487
499
  {
488
- name: "eslint/formatters/setup",
500
+ name: "eslint/formatter/setup",
489
501
  plugins: {
490
502
  format: pluginFormat
491
503
  }
@@ -498,12 +510,11 @@ async function formatters(options = {}, stylistic2 = {}) {
498
510
  languageOptions: {
499
511
  parser: parserPlain
500
512
  },
501
- name: "eslint/formatters/css",
513
+ name: "eslint/formatter/css",
502
514
  rules: {
503
515
  "format/prettier": [
504
516
  "error",
505
517
  mergePrettierOptions(prettierOptions, {
506
- ...prettierOptions,
507
518
  parser: "css"
508
519
  })
509
520
  ]
@@ -514,12 +525,11 @@ async function formatters(options = {}, stylistic2 = {}) {
514
525
  languageOptions: {
515
526
  parser: parserPlain
516
527
  },
517
- name: "eslint/formatters/scss",
528
+ name: "eslint/formatter/scss",
518
529
  rules: {
519
530
  "format/prettier": [
520
531
  "error",
521
532
  mergePrettierOptions(prettierOptions, {
522
- ...prettierOptions,
523
533
  parser: "scss"
524
534
  })
525
535
  ]
@@ -530,12 +540,11 @@ async function formatters(options = {}, stylistic2 = {}) {
530
540
  languageOptions: {
531
541
  parser: parserPlain
532
542
  },
533
- name: "eslint/formatters/less",
543
+ name: "eslint/formatter/less",
534
544
  rules: {
535
545
  "format/prettier": [
536
546
  "error",
537
547
  mergePrettierOptions(prettierOptions, {
538
- ...prettierOptions,
539
548
  parser: "less"
540
549
  })
541
550
  ]
@@ -549,12 +558,11 @@ async function formatters(options = {}, stylistic2 = {}) {
549
558
  languageOptions: {
550
559
  parser: parserPlain
551
560
  },
552
- name: "eslint/formatters/html",
561
+ name: "eslint/formatter/html",
553
562
  rules: {
554
563
  "format/prettier": [
555
564
  "error",
556
565
  mergePrettierOptions(prettierOptions, {
557
- ...prettierOptions,
558
566
  parser: "html"
559
567
  })
560
568
  ]
@@ -587,7 +595,7 @@ async function formatters(options = {}, stylistic2 = {}) {
587
595
  languageOptions: {
588
596
  parser: parserPlain
589
597
  },
590
- name: "eslint/formatters/svg",
598
+ name: "eslint/formatter/svg",
591
599
  rules: {
592
600
  "format/prettier": [
593
601
  "error",
@@ -605,10 +613,11 @@ async function formatters(options = {}, stylistic2 = {}) {
605
613
  const formater = options.markdown === true ? "prettier" : options.markdown;
606
614
  configs2.push({
607
615
  files: [GLOB_MARKDOWN],
616
+ ignores: [],
608
617
  languageOptions: {
609
618
  parser: parserPlain
610
619
  },
611
- name: "eslint/formatters/markdown",
620
+ name: "eslint/formatter/markdown",
612
621
  rules: {
613
622
  [`format/${formater}`]: [
614
623
  "error",
@@ -629,7 +638,7 @@ async function formatters(options = {}, stylistic2 = {}) {
629
638
  languageOptions: {
630
639
  parser: parserPlain
631
640
  },
632
- name: "eslint/formatters/graphql",
641
+ name: "eslint/formatter/graphql",
633
642
  rules: {
634
643
  "format/prettier": [
635
644
  "error",
@@ -1173,7 +1182,7 @@ async function perfectionist(options = {}) {
1173
1182
  "object",
1174
1183
  "unknown"
1175
1184
  ],
1176
- internalPattern: ["~/**", "@/**"],
1185
+ internalPattern: ["^~/.*", "^@/.*"],
1177
1186
  newlinesBetween: "ignore",
1178
1187
  order: "asc",
1179
1188
  type: "natural"
@@ -1193,13 +1202,18 @@ var ReactRefreshAllowConstantExportPackages = [
1193
1202
  ];
1194
1203
  async function react(options = {}) {
1195
1204
  const {
1196
- files = [GLOB_JSX, GLOB_TSX],
1197
- jsx: jsx2 = true,
1205
+ files = [GLOB_SRC],
1206
+ filesTypeAware = [GLOB_TS, GLOB_TSX],
1207
+ ignoresTypeAware = [
1208
+ `${GLOB_MARKDOWN}/**`
1209
+ ],
1198
1210
  overrides = {},
1199
- version = "detect"
1211
+ tsconfigPath
1200
1212
  } = options;
1201
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1202
1213
  const isTypeAware = !!tsconfigPath;
1214
+ const typeAwareRules = {
1215
+ "react/no-leaked-conditional-rendering": "warn"
1216
+ };
1203
1217
  await ensurePackages([
1204
1218
  "@eslint-react/eslint-plugin",
1205
1219
  "eslint-plugin-react-hooks",
@@ -1208,15 +1222,13 @@ async function react(options = {}) {
1208
1222
  const [
1209
1223
  pluginReact,
1210
1224
  pluginReactHooks,
1211
- pluginReactRefresh,
1212
- parserTs
1225
+ pluginReactRefresh
1213
1226
  ] = await Promise.all([
1214
1227
  interopDefault(import("@eslint-react/eslint-plugin")),
1215
1228
  // @ts-expect-error missing types
1216
1229
  interopDefault(import("eslint-plugin-react-hooks")),
1217
1230
  // @ts-expect-error missing types
1218
- interopDefault(import("eslint-plugin-react-refresh")),
1219
- interopDefault(import("@typescript-eslint/parser"))
1231
+ interopDefault(import("eslint-plugin-react-refresh"))
1220
1232
  ]);
1221
1233
  const _isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
1222
1234
  (i) => (0, import_local_pkg2.isPackageExists)(i)
@@ -1237,13 +1249,12 @@ async function react(options = {}) {
1237
1249
  {
1238
1250
  files,
1239
1251
  languageOptions: {
1240
- parser: parserTs,
1241
1252
  parserOptions: {
1242
1253
  ecmaFeatures: {
1243
- jsx: jsx2
1244
- },
1245
- ...isTypeAware ? { project: tsconfigPath } : {}
1246
- }
1254
+ jsx: true
1255
+ }
1256
+ },
1257
+ sourceType: "module"
1247
1258
  },
1248
1259
  name: "eslint/react/rules",
1249
1260
  rules: {
@@ -1303,18 +1314,18 @@ async function react(options = {}) {
1303
1314
  "react/prefer-destructuring-assignment": "warn",
1304
1315
  "react/prefer-shorthand-boolean": "warn",
1305
1316
  "react/prefer-shorthand-fragment": "warn",
1306
- ...isTypeAware ? {
1307
- "react/no-leaked-conditional-rendering": "warn"
1308
- } : {},
1309
1317
  // overrides
1310
1318
  ...overrides
1311
- },
1312
- settings: {
1313
- react: {
1314
- version
1315
- }
1316
1319
  }
1317
- }
1320
+ },
1321
+ ...isTypeAware ? [{
1322
+ files: filesTypeAware,
1323
+ ignores: ignoresTypeAware,
1324
+ name: "eslint/react/type-aware-rules",
1325
+ rules: {
1326
+ ...typeAwareRules
1327
+ }
1328
+ }] : []
1318
1329
  ];
1319
1330
  }
1320
1331
 
@@ -1948,6 +1959,8 @@ async function vue(options = {}) {
1948
1959
  ]);
1949
1960
  return [
1950
1961
  {
1962
+ // This allows Vue plugin to work with auto imports
1963
+ // https://github.com/vuejs/eslint-plugin-vue/pull/2422
1951
1964
  languageOptions: {
1952
1965
  globals: {
1953
1966
  computed: "readonly",
@@ -1990,21 +2003,21 @@ async function vue(options = {}) {
1990
2003
  processorVueBlocks({
1991
2004
  ...sfcBlocks,
1992
2005
  blocks: {
1993
- ...sfcBlocks.blocks,
1994
- styles: true
2006
+ styles: true,
2007
+ ...sfcBlocks.blocks
1995
2008
  }
1996
2009
  })
1997
2010
  ]),
1998
2011
  rules: {
1999
2012
  ...pluginVue.configs.base.rules,
2000
- ...vueVersion === "3" ? {
2001
- ...pluginVue.configs["vue3-essential"].rules,
2002
- ...pluginVue.configs["vue3-strongly-recommended"].rules,
2003
- ...pluginVue.configs["vue3-recommended"].rules
2004
- } : {
2013
+ ...vueVersion === "2" ? {
2005
2014
  ...pluginVue.configs.essential.rules,
2006
2015
  ...pluginVue.configs["strongly-recommended"].rules,
2007
2016
  ...pluginVue.configs.recommended.rules
2017
+ } : {
2018
+ ...pluginVue.configs["vue3-essential"].rules,
2019
+ ...pluginVue.configs["vue3-strongly-recommended"].rules,
2020
+ ...pluginVue.configs["vue3-recommended"].rules
2008
2021
  },
2009
2022
  "antfu/no-top-level-await": "off",
2010
2023
  "node/prefer-global/process": "off",
@@ -2069,12 +2082,17 @@ async function vue(options = {}) {
2069
2082
  "vue/no-useless-v-bind": "error",
2070
2083
  "vue/no-v-html": "off",
2071
2084
  "vue/no-v-text-v-html-on-component": "off",
2072
- "vue/object-shorthand": ["error", "always", {
2073
- avoidQuotes: true,
2074
- ignoreConstructors: false
2075
- }],
2085
+ "vue/object-shorthand": [
2086
+ "error",
2087
+ "always",
2088
+ {
2089
+ avoidQuotes: true,
2090
+ ignoreConstructors: false
2091
+ }
2092
+ ],
2076
2093
  "vue/prefer-separate-static-class": "error",
2077
2094
  "vue/prefer-template": "error",
2095
+ "vue/prop-name-casing": ["error", "camelCase"],
2078
2096
  "vue/require-default-prop": "off",
2079
2097
  "vue/require-prop-types": "off",
2080
2098
  "vue/singleline-html-element-content-newline": "off",
@@ -2084,12 +2102,17 @@ async function vue(options = {}) {
2084
2102
  "vue/array-bracket-spacing": ["error", "never"],
2085
2103
  "vue/arrow-spacing": ["error", { after: true, before: true }],
2086
2104
  "vue/block-spacing": ["error", "always"],
2087
- "vue/block-tag-newline": ["error", { multiline: "always", singleline: "always" }],
2105
+ "vue/block-tag-newline": ["error", {
2106
+ multiline: "always",
2107
+ singleline: "always"
2108
+ }],
2088
2109
  "vue/brace-style": ["error", "stroustrup", { allowSingleLine: false }],
2089
2110
  "vue/comma-dangle": ["error", "always-multiline"],
2090
2111
  "vue/comma-spacing": ["error", { after: true, before: false }],
2091
2112
  "vue/comma-style": ["error", "last"],
2092
- "vue/html-comment-content-spacing": ["error", "always", { exceptions: ["-"] }],
2113
+ "vue/html-comment-content-spacing": ["error", "always", {
2114
+ exceptions: ["-"]
2115
+ }],
2093
2116
  "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
2094
2117
  "vue/keyword-spacing": ["error", { after: true, before: true }],
2095
2118
  "vue/object-curly-newline": "off",
@@ -2114,6 +2137,9 @@ async function yaml(options = {}) {
2114
2137
  overrides = {},
2115
2138
  stylistic: stylistic2 = true
2116
2139
  } = options;
2140
+ const {
2141
+ quotes = "single"
2142
+ } = typeof stylistic2 === "boolean" ? {} : stylistic2;
2117
2143
  const [
2118
2144
  pluginYaml,
2119
2145
  parserYaml
@@ -2153,7 +2179,7 @@ async function yaml(options = {}) {
2153
2179
  "yaml/indent": ["error", 2],
2154
2180
  "yaml/key-spacing": "error",
2155
2181
  "yaml/no-tab-indent": "error",
2156
- "yaml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
2182
+ "yaml/quotes": ["error", { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
2157
2183
  "yaml/spaced-comment": "error"
2158
2184
  } : {},
2159
2185
  ...overrides
@@ -2190,10 +2216,6 @@ var defaultPluginRenaming = {
2190
2216
  "vitest": "test",
2191
2217
  "yml": "yaml"
2192
2218
  };
2193
- var ReactPackages = [
2194
- "react",
2195
- "next"
2196
- ];
2197
2219
  function lincy(options = {}, ...userConfigs) {
2198
2220
  const {
2199
2221
  autoRenamePlugins = true,
@@ -2202,7 +2224,7 @@ function lincy(options = {}, ...userConfigs) {
2202
2224
  ignores: ignoresList = [],
2203
2225
  jsx: enableJsx = true,
2204
2226
  overrides = {},
2205
- react: enableReact = ReactPackages.some((i) => (0, import_local_pkg4.isPackageExists)(i)),
2227
+ react: enableReact = false,
2206
2228
  regexp: enableRegexp = true,
2207
2229
  typescript: enableTypeScript = (0, import_local_pkg4.isPackageExists)("typescript"),
2208
2230
  unicorn: enableUnicorn = true,
@@ -2216,12 +2238,8 @@ function lincy(options = {}, ...userConfigs) {
2216
2238
  console.log("[@lincy/eslint-config] Detected running in editor, some rules are disabled.");
2217
2239
  }
2218
2240
  const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
2219
- const tsconfigPath = typeof enableTypeScript !== "boolean" && "tsconfigPath" in enableTypeScript ? enableTypeScript.tsconfigPath : void 0;
2220
- if (stylisticOptions) {
2221
- if (!("jsx" in stylisticOptions)) {
2222
- stylisticOptions.jsx = enableJsx;
2223
- }
2224
- }
2241
+ if (stylisticOptions && !("jsx" in stylisticOptions))
2242
+ stylisticOptions.jsx = enableJsx;
2225
2243
  const configs2 = [];
2226
2244
  if (enableGitignore) {
2227
2245
  if (typeof enableGitignore !== "boolean") {
@@ -2236,6 +2254,8 @@ function lincy(options = {}, ...userConfigs) {
2236
2254
  })]));
2237
2255
  }
2238
2256
  }
2257
+ const typescriptOptions = resolveSubOptions(options, "typescript");
2258
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
2239
2259
  configs2.push(
2240
2260
  ignores({
2241
2261
  ignores: [
@@ -2245,7 +2265,7 @@ function lincy(options = {}, ...userConfigs) {
2245
2265
  }),
2246
2266
  javascript({
2247
2267
  isInEditor,
2248
- overrides: overrides.javascript
2268
+ overrides: getOverrides(options, "javascript")
2249
2269
  }),
2250
2270
  comments({
2251
2271
  overrides: overrides.comments
@@ -2275,63 +2295,64 @@ function lincy(options = {}, ...userConfigs) {
2275
2295
  if (enableVue) {
2276
2296
  componentExts.push("vue");
2277
2297
  }
2298
+ if (enableJsx) {
2299
+ configs2.push(jsx());
2300
+ }
2278
2301
  if (enableTypeScript) {
2279
2302
  configs2.push(typescript({
2280
- ...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
2303
+ ...typescriptOptions,
2281
2304
  componentExts,
2282
- overrides: overrides.typescript,
2305
+ overrides: getOverrides(options, "typescript"),
2283
2306
  tsconfigPath,
2284
2307
  type: options.type
2285
2308
  }));
2286
2309
  }
2287
- if (enableJsx) {
2288
- configs2.push(jsx());
2289
- }
2290
2310
  if (stylisticOptions) {
2291
2311
  configs2.push(stylistic({
2292
- overrides: overrides.stylistic,
2312
+ overrides: getOverrides(options, "stylistic"),
2293
2313
  stylistic: stylisticOptions
2294
2314
  }));
2295
2315
  }
2296
2316
  if (enableRegexp) {
2297
2317
  configs2.push(regexp({
2298
- ...typeof enableRegexp === "boolean" ? {} : enableRegexp,
2299
- overrides: overrides.regexp
2318
+ ...resolveSubOptions(options, "regexp"),
2319
+ ...getOverrides(options, "regexp")
2300
2320
  }));
2301
2321
  }
2302
2322
  if (options.test ?? true) {
2303
2323
  configs2.push(test({
2304
- ...typeof options.test !== "boolean" ? options.test : {},
2324
+ ...resolveSubOptions(options, "test"),
2305
2325
  isInEditor,
2306
- overrides: overrides.test
2326
+ overrides: getOverrides(options, "test")
2307
2327
  }));
2308
2328
  }
2309
2329
  if (enableVue) {
2310
2330
  configs2.push(vue({
2311
- ...typeof options.vue !== "boolean" ? options.vue : {},
2312
- overrides: overrides.vue,
2331
+ ...resolveSubOptions(options, "vue"),
2332
+ overrides: getOverrides(options, "vue"),
2313
2333
  stylistic: stylisticOptions,
2314
2334
  typescript: !!enableTypeScript
2315
2335
  }));
2316
2336
  }
2317
2337
  if (enableReact) {
2318
2338
  configs2.push(react({
2319
- tsconfigPath,
2320
- ...typeof enableReact !== "boolean" ? enableReact : {},
2321
- overrides: overrides.react
2339
+ ...typescriptOptions,
2340
+ ...resolveSubOptions(options, "react"),
2341
+ overrides: getOverrides(options, "react"),
2342
+ tsconfigPath
2322
2343
  }));
2323
2344
  }
2324
2345
  if (enableUnoCSS) {
2325
2346
  configs2.push(unocss({
2326
- ...typeof enableUnoCSS === "boolean" ? {} : enableUnoCSS,
2327
- overrides: overrides.unocss
2347
+ ...resolveSubOptions(options, "unocss"),
2348
+ overrides: getOverrides(options, "unocss")
2328
2349
  }));
2329
2350
  }
2330
2351
  if (options.jsonc ?? true) {
2331
2352
  configs2.push(
2332
2353
  jsonc({
2333
- ...typeof options.jsonc !== "boolean" ? options.jsonc : {},
2334
- overrides: overrides.jsonc,
2354
+ ...resolveSubOptions(options, "jsonc"),
2355
+ overrides: getOverrides(options, "jsonc"),
2335
2356
  stylistic: stylisticOptions
2336
2357
  }),
2337
2358
  sortPackageJson(),
@@ -2340,23 +2361,27 @@ function lincy(options = {}, ...userConfigs) {
2340
2361
  }
2341
2362
  if (options.yaml ?? true) {
2342
2363
  configs2.push(yaml({
2343
- ...typeof options.yaml !== "boolean" ? options.yaml : {},
2344
- overrides: overrides.yaml,
2364
+ ...resolveSubOptions(options, "yaml"),
2365
+ overrides: getOverrides(options, "yaml"),
2345
2366
  stylistic: stylisticOptions
2346
2367
  }));
2347
2368
  }
2348
- if (options.toml) {
2369
+ if (options.toml ?? true) {
2349
2370
  configs2.push(toml({
2350
- overrides: overrides.toml,
2371
+ overrides: getOverrides(options, "toml"),
2351
2372
  stylistic: stylisticOptions
2352
2373
  }));
2353
2374
  }
2354
2375
  if (options.markdown ?? true) {
2355
- configs2.push(markdown({
2356
- ...typeof options.markdown !== "boolean" ? options.markdown : {},
2357
- componentExts,
2358
- overrides: overrides.markdown
2359
- }));
2376
+ configs2.push(
2377
+ markdown(
2378
+ {
2379
+ ...resolveSubOptions(options, "markdown"),
2380
+ componentExts,
2381
+ overrides: getOverrides(options, "markdown")
2382
+ }
2383
+ )
2384
+ );
2360
2385
  }
2361
2386
  if (options.formatters) {
2362
2387
  configs2.push(formatters(
@@ -2371,14 +2396,12 @@ function lincy(options = {}, ...userConfigs) {
2371
2396
  throw new Error("[@lincy/eslint-config] \u7B2C\u4E00\u4E2A\u53C2\u6570\u4E0D\u5E94\u5305\u542B\u201Cfiles\u201D\u5C5E\u6027\uFF0C\u56E0\u4E3A\u9009\u9879\u5E94\u8BE5\u662F\u5168\u5C40\u7684\u3002\u8BF7\u5C06\u5176\u653E\u5728\u7B2C\u4E8C\u4E2A\u6216\u66F4\u540E\u9762\u7684\u914D\u7F6E\u4E2D\u3002");
2372
2397
  }
2373
2398
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
2374
- if (key in options) {
2399
+ if (key in options)
2375
2400
  acc[key] = options[key];
2376
- }
2377
2401
  return acc;
2378
2402
  }, {});
2379
- if (Object.keys(fusedConfig).length) {
2403
+ if (Object.keys(fusedConfig).length)
2380
2404
  configs2.push([fusedConfig]);
2381
- }
2382
2405
  let composer = new import_eslint_flat_config_utils.FlatConfigComposer();
2383
2406
  composer = composer.append(
2384
2407
  ...configs2,
@@ -2389,6 +2412,16 @@ function lincy(options = {}, ...userConfigs) {
2389
2412
  }
2390
2413
  return composer;
2391
2414
  }
2415
+ function resolveSubOptions(options, key) {
2416
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
2417
+ }
2418
+ function getOverrides(options, key) {
2419
+ const sub = resolveSubOptions(options, key);
2420
+ return {
2421
+ ...options.overrides?.[key],
2422
+ ..."overrides" in sub ? sub.overrides : {}
2423
+ };
2424
+ }
2392
2425
 
2393
2426
  // src/index.ts
2394
2427
  var src_default = lincy;
@@ -2429,6 +2462,7 @@ var src_default = lincy;
2429
2462
  disables,
2430
2463
  ensurePackages,
2431
2464
  formatters,
2465
+ getOverrides,
2432
2466
  ignores,
2433
2467
  imports,
2434
2468
  interopDefault,
@@ -2448,6 +2482,7 @@ var src_default = lincy;
2448
2482
  regexp,
2449
2483
  renamePluginInConfigs,
2450
2484
  renameRules,
2485
+ resolveSubOptions,
2451
2486
  sortPackageJson,
2452
2487
  sortTsconfig,
2453
2488
  stylistic,