@lincy/eslint-config 5.2.3 → 5.2.5

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 CHANGED
@@ -302,14 +302,12 @@ export default lincy({
302
302
 
303
303
  ```js
304
304
  // eslint.config.js
305
- import { readFile } from 'node:fs/promises'
305
+ import { readFileSync } from 'node:fs'
306
306
 
307
307
  import lincy from '@lincy/eslint-config'
308
308
  import plugin from '@unocss/eslint-plugin'
309
309
 
310
- const autoImport = JSON.parse(
311
- await readFile(new URL('./.eslintrc-auto-import.json', import.meta.url)),
312
- )
310
+ const autoImport = JSON.parse(readFileSync(new URL('./.eslintrc-auto-import.json', import.meta.url)))
313
311
 
314
312
  export default lincy(
315
313
  {
package/dist/index.cjs CHANGED
@@ -99,7 +99,7 @@ __export(src_exports, {
99
99
  });
100
100
  module.exports = __toCommonJS(src_exports);
101
101
 
102
- // node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.47_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/cjs_shims.js
102
+ // node_modules/.pnpm/tsup@8.3.0_jiti@1.21.6_postcss@8.4.47_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/cjs_shims.js
103
103
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
104
104
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
105
105
 
@@ -218,6 +218,7 @@ async function disables() {
218
218
  files: [`**/scripts/${GLOB_SRC}`],
219
219
  name: "eslint/disables/scripts",
220
220
  rules: {
221
+ "antfu/no-top-level-await": "off",
221
222
  "no-console": "off",
222
223
  "ts/explicit-function-return-type": "off"
223
224
  }
@@ -226,6 +227,7 @@ async function disables() {
226
227
  files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
227
228
  name: "eslint/disables/cli",
228
229
  rules: {
230
+ "antfu/no-top-level-await": "off",
229
231
  "no-console": "off"
230
232
  }
231
233
  },
@@ -260,6 +262,15 @@ async function disables() {
260
262
  rules: {
261
263
  "ts/no-require-imports": "off"
262
264
  }
265
+ },
266
+ {
267
+ files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
268
+ name: "antfu/disables/config-files",
269
+ rules: {
270
+ "antfu/no-top-level-await": "off",
271
+ "no-console": "off",
272
+ "ts/explicit-function-return-type": "off"
273
+ }
263
274
  }
264
275
  ];
265
276
  }
@@ -702,6 +713,7 @@ async function javascript(options = {}) {
702
713
  },
703
714
  rules: {
704
715
  "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
716
+ "antfu/no-top-level-await": "error",
705
717
  "array-callback-return": "error",
706
718
  "block-scoped-var": "error",
707
719
  "constructor-super": "error",
@@ -1776,12 +1788,24 @@ async function typescript(options = {}) {
1776
1788
  // allowTernary 设置为 true 将使你能够在表达式中使用三元运算符,类似于短路计算(默认值:false)
1777
1789
  allowTernary: true
1778
1790
  }],
1779
- "ts/no-unused-vars": "off",
1791
+ "ts/no-unused-vars": [
1792
+ "error",
1793
+ {
1794
+ args: "all",
1795
+ argsIgnorePattern: "^_",
1796
+ caughtErrors: "all",
1797
+ caughtErrorsIgnorePattern: "^_",
1798
+ destructuredArrayIgnorePattern: "^_",
1799
+ ignoreRestSiblings: true,
1800
+ varsIgnorePattern: "^_"
1801
+ }
1802
+ ],
1780
1803
  "ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
1781
1804
  "ts/no-useless-constructor": "off",
1782
1805
  "ts/no-wrapper-object-types": "error",
1783
1806
  "ts/triple-slash-reference": "off",
1784
1807
  "ts/unified-signatures": "off",
1808
+ "unused-imports/no-unused-vars": "off",
1785
1809
  ...type === "lib" ? {
1786
1810
  "ts/explicit-function-return-type": ["error", {
1787
1811
  allowExpressions: true,
@@ -1958,6 +1982,7 @@ async function vue(options = {}) {
1958
1982
  ...pluginVue.configs["strongly-recommended"].rules,
1959
1983
  ...pluginVue.configs.recommended.rules
1960
1984
  },
1985
+ "antfu/no-top-level-await": "off",
1961
1986
  "node/prefer-global/process": "off",
1962
1987
  "ts/explicit-function-return-type": "off",
1963
1988
  "vue/block-order": ["error", {
@@ -2142,6 +2167,7 @@ function lincy(options = {}, ...userConfigs) {
2142
2167
  autoRenamePlugins = true,
2143
2168
  componentExts = [],
2144
2169
  gitignore: enableGitignore = true,
2170
+ ignores: ignoresList = [],
2145
2171
  jsx: enableJsx = true,
2146
2172
  overrides = {},
2147
2173
  react: enableReact = ReactPackages.some((i) => (0, import_local_pkg4.isPackageExists)(i)),
@@ -2180,7 +2206,10 @@ function lincy(options = {}, ...userConfigs) {
2180
2206
  }
2181
2207
  configs2.push(
2182
2208
  ignores({
2183
- ignores: overrides.ignores
2209
+ ignores: [
2210
+ ...overrides.ignores || [],
2211
+ ...ignoresList
2212
+ ]
2184
2213
  }),
2185
2214
  javascript({
2186
2215
  isInEditor,
package/dist/index.d.cts CHANGED
@@ -154,6 +154,11 @@ interface RuleOptions {
154
154
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
155
155
  */
156
156
  'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>
157
+ /**
158
+ * Prevent using top-level await
159
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
160
+ */
161
+ 'antfu/no-top-level-await'?: Linter.RuleEntry<[]>
157
162
  /**
158
163
  * Do not use `exports =`
159
164
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
@@ -481,233 +486,233 @@ interface RuleOptions {
481
486
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
482
487
  /**
483
488
  * Enforce or ban the use of inline type-only markers for named imports.
484
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/consistent-type-specifier-style.md
489
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/consistent-type-specifier-style.md
485
490
  */
486
491
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
487
492
  /**
488
493
  * Ensure a default export is present, given a default import.
489
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/default.md
494
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/default.md
490
495
  */
491
496
  'import/default'?: Linter.RuleEntry<[]>
492
497
  /**
493
498
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
494
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/dynamic-import-chunkname.md
499
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/dynamic-import-chunkname.md
495
500
  */
496
501
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
497
502
  /**
498
503
  * Forbid any invalid exports, i.e. re-export of the same name.
499
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/export.md
504
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/export.md
500
505
  */
501
506
  'import/export'?: Linter.RuleEntry<[]>
502
507
  /**
503
508
  * Ensure all exports appear after other statements.
504
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/exports-last.md
509
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/exports-last.md
505
510
  */
506
511
  'import/exports-last'?: Linter.RuleEntry<[]>
507
512
  /**
508
513
  * Ensure consistent use of file extension within the import path.
509
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/extensions.md
514
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/extensions.md
510
515
  */
511
516
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
512
517
  /**
513
518
  * Ensure all imports appear before other statements.
514
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/first.md
519
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/first.md
515
520
  */
516
521
  'import/first'?: Linter.RuleEntry<ImportFirst>
517
522
  /**
518
523
  * Prefer named exports to be grouped together in a single export declaration.
519
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/group-exports.md
524
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/group-exports.md
520
525
  */
521
526
  'import/group-exports'?: Linter.RuleEntry<[]>
522
527
  /**
523
528
  * Replaced by `import-x/first`.
524
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/imports-first.md
529
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/imports-first.md
525
530
  * @deprecated
526
531
  */
527
532
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
528
533
  /**
529
534
  * Enforce the maximum number of dependencies a module can have.
530
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/max-dependencies.md
535
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/max-dependencies.md
531
536
  */
532
537
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
533
538
  /**
534
539
  * Ensure named imports correspond to a named export in the remote file.
535
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/named.md
540
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/named.md
536
541
  */
537
542
  'import/named'?: Linter.RuleEntry<ImportNamed>
538
543
  /**
539
544
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
540
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/namespace.md
545
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/namespace.md
541
546
  */
542
547
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
543
548
  /**
544
549
  * Enforce a newline after import statements.
545
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/newline-after-import.md
550
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/newline-after-import.md
546
551
  */
547
552
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
548
553
  /**
549
554
  * Forbid import of modules using absolute paths.
550
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-absolute-path.md
555
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-absolute-path.md
551
556
  */
552
557
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
553
558
  /**
554
559
  * Forbid AMD `require` and `define` calls.
555
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-amd.md
560
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-amd.md
556
561
  */
557
562
  'import/no-amd'?: Linter.RuleEntry<[]>
558
563
  /**
559
564
  * Forbid anonymous values as default exports.
560
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-anonymous-default-export.md
565
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-anonymous-default-export.md
561
566
  */
562
567
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
563
568
  /**
564
569
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
565
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-commonjs.md
570
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-commonjs.md
566
571
  */
567
572
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
568
573
  /**
569
574
  * Forbid a module from importing a module with a dependency path back to itself.
570
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-cycle.md
575
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-cycle.md
571
576
  */
572
577
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
573
578
  /**
574
579
  * Forbid default exports.
575
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-default-export.md
580
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-default-export.md
576
581
  */
577
582
  'import/no-default-export'?: Linter.RuleEntry<[]>
578
583
  /**
579
584
  * Forbid imported names marked with `@deprecated` documentation tag.
580
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-deprecated.md
585
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-deprecated.md
581
586
  */
582
587
  'import/no-deprecated'?: Linter.RuleEntry<[]>
583
588
  /**
584
589
  * Forbid repeated import of the same module in multiple places.
585
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-duplicates.md
590
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-duplicates.md
586
591
  */
587
592
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
588
593
  /**
589
594
  * Forbid `require()` calls with expressions.
590
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-dynamic-require.md
595
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-dynamic-require.md
591
596
  */
592
597
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
593
598
  /**
594
599
  * Forbid empty named import blocks.
595
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-empty-named-blocks.md
600
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-empty-named-blocks.md
596
601
  */
597
602
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
598
603
  /**
599
604
  * Forbid the use of extraneous packages.
600
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-extraneous-dependencies.md
605
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-extraneous-dependencies.md
601
606
  */
602
607
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
603
608
  /**
604
609
  * Forbid import statements with CommonJS module.exports.
605
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-import-module-exports.md
610
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-import-module-exports.md
606
611
  */
607
612
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
608
613
  /**
609
614
  * Forbid importing the submodules of other modules.
610
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-internal-modules.md
615
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-internal-modules.md
611
616
  */
612
617
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
613
618
  /**
614
619
  * Forbid the use of mutable exports with `var` or `let`.
615
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-mutable-exports.md
620
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-mutable-exports.md
616
621
  */
617
622
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
618
623
  /**
619
624
  * Forbid use of exported name as identifier of default export.
620
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-as-default.md
625
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-as-default.md
621
626
  */
622
627
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
623
628
  /**
624
629
  * Forbid use of exported name as property of default export.
625
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-as-default-member.md
630
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-as-default-member.md
626
631
  */
627
632
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
628
633
  /**
629
634
  * Forbid named default exports.
630
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-default.md
635
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-default.md
631
636
  */
632
637
  'import/no-named-default'?: Linter.RuleEntry<[]>
633
638
  /**
634
639
  * Forbid named exports.
635
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-export.md
640
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-export.md
636
641
  */
637
642
  'import/no-named-export'?: Linter.RuleEntry<[]>
638
643
  /**
639
644
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
640
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-namespace.md
645
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-namespace.md
641
646
  */
642
647
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
643
648
  /**
644
649
  * Forbid Node.js builtin modules.
645
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-nodejs-modules.md
650
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-nodejs-modules.md
646
651
  */
647
652
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
648
653
  /**
649
654
  * Forbid importing packages through relative paths.
650
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-relative-packages.md
655
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-relative-packages.md
651
656
  */
652
657
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
653
658
  /**
654
659
  * Forbid importing modules from parent directories.
655
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-relative-parent-imports.md
660
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-relative-parent-imports.md
656
661
  */
657
662
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
658
663
  /**
659
664
  * Forbid importing a default export by a different name.
660
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-rename-default.md
665
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-rename-default.md
661
666
  */
662
667
  'import/no-rename-default'?: Linter.RuleEntry<ImportNoRenameDefault>
663
668
  /**
664
669
  * Enforce which files can be imported in a given folder.
665
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-restricted-paths.md
670
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-restricted-paths.md
666
671
  */
667
672
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
668
673
  /**
669
674
  * Forbid a module from importing itself.
670
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-self-import.md
675
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-self-import.md
671
676
  */
672
677
  'import/no-self-import'?: Linter.RuleEntry<[]>
673
678
  /**
674
679
  * Forbid unassigned imports.
675
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-unassigned-import.md
680
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-unassigned-import.md
676
681
  */
677
682
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
678
683
  /**
679
684
  * Ensure imports point to a file/module that can be resolved.
680
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-unresolved.md
685
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-unresolved.md
681
686
  */
682
687
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
683
688
  /**
684
689
  * Forbid modules without exports, or exports without matching import in another module.
685
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-unused-modules.md
690
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-unused-modules.md
686
691
  */
687
692
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
688
693
  /**
689
694
  * Forbid unnecessary path segments in import and require statements.
690
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-useless-path-segments.md
695
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-useless-path-segments.md
691
696
  */
692
697
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
693
698
  /**
694
699
  * Forbid webpack loader syntax in imports.
695
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-webpack-loader-syntax.md
700
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-webpack-loader-syntax.md
696
701
  */
697
702
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
698
703
  /**
699
704
  * Enforce a convention in module import order.
700
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/order.md
705
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/order.md
701
706
  */
702
707
  'import/order'?: Linter.RuleEntry<ImportOrder>
703
708
  /**
704
709
  * Prefer a default export if module exports a single name or multiple names.
705
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/prefer-default-export.md
710
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/prefer-default-export.md
706
711
  */
707
712
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
708
713
  /**
709
714
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
710
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/unambiguous.md
715
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/unambiguous.md
711
716
  */
712
717
  'import/unambiguous'?: Linter.RuleEntry<[]>
713
718
  /**
@@ -9744,6 +9749,10 @@ type PerfectionistSortArrayIncludes = []|[{
9744
9749
  ignoreCase?: boolean
9745
9750
 
9746
9751
  groupKind?: ("mixed" | "literals-first" | "spreads-first")
9752
+
9753
+ partitionByComment?: (string[] | boolean | string)
9754
+
9755
+ partitionByNewLine?: boolean
9747
9756
  }]
9748
9757
  // ----- perfectionist/sort-astro-attributes -----
9749
9758
  type PerfectionistSortAstroAttributes = []|[{
@@ -9823,6 +9832,8 @@ type PerfectionistSortEnums = []|[{
9823
9832
  forceNumericSort?: boolean
9824
9833
 
9825
9834
  partitionByComment?: (string[] | boolean | string)
9835
+
9836
+ partitionByNewLine?: boolean
9826
9837
  }]
9827
9838
  // ----- perfectionist/sort-exports -----
9828
9839
  type PerfectionistSortExports = []|[{
@@ -9832,6 +9843,12 @@ type PerfectionistSortExports = []|[{
9832
9843
  order?: ("asc" | "desc")
9833
9844
 
9834
9845
  ignoreCase?: boolean
9846
+
9847
+ partitionByComment?: (string[] | boolean | string)
9848
+
9849
+ partitionByNewLine?: boolean
9850
+
9851
+ groupKind?: ("mixed" | "values-first" | "types-first")
9835
9852
  }]
9836
9853
  // ----- perfectionist/sort-imports -----
9837
9854
  type PerfectionistSortImports = []|[_PerfectionistSortImportsSortImports]
@@ -9882,6 +9899,8 @@ type PerfectionistSortInterfaces = []|[{
9882
9899
 
9883
9900
  ignorePattern?: string[]
9884
9901
 
9902
+ partitionByComment?: (boolean | string | string[])
9903
+
9885
9904
  partitionByNewLine?: boolean
9886
9905
 
9887
9906
  groupKind?: ("mixed" | "optional-first" | "required-first")
@@ -9902,6 +9921,10 @@ type PerfectionistSortIntersectionTypes = []|[{
9902
9921
  ignoreCase?: boolean
9903
9922
 
9904
9923
  groups?: (string | string[])[]
9924
+
9925
+ partitionByComment?: (string[] | boolean | string)
9926
+
9927
+ partitionByNewLine?: boolean
9905
9928
  }]
9906
9929
  // ----- perfectionist/sort-jsx-props -----
9907
9930
  type PerfectionistSortJsxProps = []|[{
@@ -9928,6 +9951,10 @@ type PerfectionistSortMaps = []|[{
9928
9951
  order?: ("asc" | "desc")
9929
9952
 
9930
9953
  ignoreCase?: boolean
9954
+
9955
+ partitionByComment?: (string[] | boolean | string)
9956
+
9957
+ partitionByNewLine?: boolean
9931
9958
  }]
9932
9959
  // ----- perfectionist/sort-named-exports -----
9933
9960
  type PerfectionistSortNamedExports = []|[{
@@ -9939,6 +9966,10 @@ type PerfectionistSortNamedExports = []|[{
9939
9966
  ignoreCase?: boolean
9940
9967
 
9941
9968
  groupKind?: ("mixed" | "values-first" | "types-first")
9969
+
9970
+ partitionByComment?: (string[] | boolean | string)
9971
+
9972
+ partitionByNewLine?: boolean
9942
9973
  }]
9943
9974
  // ----- perfectionist/sort-named-imports -----
9944
9975
  type PerfectionistSortNamedImports = []|[{
@@ -9952,6 +9983,10 @@ type PerfectionistSortNamedImports = []|[{
9952
9983
  ignoreAlias?: boolean
9953
9984
 
9954
9985
  groupKind?: ("mixed" | "values-first" | "types-first")
9986
+
9987
+ partitionByComment?: (string[] | boolean | string)
9988
+
9989
+ partitionByNewLine?: boolean
9955
9990
  }]
9956
9991
  // ----- perfectionist/sort-object-types -----
9957
9992
  type PerfectionistSortObjectTypes = []|[{
@@ -9962,6 +9997,8 @@ type PerfectionistSortObjectTypes = []|[{
9962
9997
 
9963
9998
  ignoreCase?: boolean
9964
9999
 
10000
+ partitionByComment?: (string[] | boolean | string)
10001
+
9965
10002
  partitionByNewLine?: boolean
9966
10003
 
9967
10004
  groupKind?: ("mixed" | "required-first" | "optional-first")
@@ -10007,6 +10044,10 @@ type PerfectionistSortSets = []|[{
10007
10044
  ignoreCase?: boolean
10008
10045
 
10009
10046
  groupKind?: ("mixed" | "literals-first" | "spreads-first")
10047
+
10048
+ partitionByComment?: (string[] | boolean | string)
10049
+
10050
+ partitionByNewLine?: boolean
10010
10051
  }]
10011
10052
  // ----- perfectionist/sort-svelte-attributes -----
10012
10053
  type PerfectionistSortSvelteAttributes = []|[{
@@ -10042,6 +10083,10 @@ type PerfectionistSortUnionTypes = []|[{
10042
10083
  ignoreCase?: boolean
10043
10084
 
10044
10085
  groups?: (string | string[])[]
10086
+
10087
+ partitionByComment?: (string[] | boolean | string)
10088
+
10089
+ partitionByNewLine?: boolean
10045
10090
  }]
10046
10091
  // ----- perfectionist/sort-variable-declarations -----
10047
10092
  type PerfectionistSortVariableDeclarations = []|[{
@@ -10051,6 +10096,10 @@ type PerfectionistSortVariableDeclarations = []|[{
10051
10096
  order?: ("asc" | "desc")
10052
10097
 
10053
10098
  ignoreCase?: boolean
10099
+
10100
+ partitionByComment?: (string[] | boolean | string)
10101
+
10102
+ partitionByNewLine?: boolean
10054
10103
  }]
10055
10104
  // ----- perfectionist/sort-vue-attributes -----
10056
10105
  type PerfectionistSortVueAttributes = []|[{
@@ -12598,6 +12647,19 @@ type TsRestrictTemplateExpressions = []|[{
12598
12647
  allowRegExp?: boolean
12599
12648
 
12600
12649
  allowNever?: boolean
12650
+
12651
+ allow?: (string | {
12652
+ from: "file"
12653
+ name: (string | [string, ...(string)[]])
12654
+ path?: string
12655
+ } | {
12656
+ from: "lib"
12657
+ name: (string | [string, ...(string)[]])
12658
+ } | {
12659
+ from: "package"
12660
+ name: (string | [string, ...(string)[]])
12661
+ package: string
12662
+ })[]
12601
12663
  }]
12602
12664
  // ----- ts/return-await -----
12603
12665
  type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
package/dist/index.d.ts CHANGED
@@ -154,6 +154,11 @@ interface RuleOptions {
154
154
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
155
155
  */
156
156
  'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>
157
+ /**
158
+ * Prevent using top-level await
159
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
160
+ */
161
+ 'antfu/no-top-level-await'?: Linter.RuleEntry<[]>
157
162
  /**
158
163
  * Do not use `exports =`
159
164
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
@@ -481,233 +486,233 @@ interface RuleOptions {
481
486
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
482
487
  /**
483
488
  * Enforce or ban the use of inline type-only markers for named imports.
484
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/consistent-type-specifier-style.md
489
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/consistent-type-specifier-style.md
485
490
  */
486
491
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
487
492
  /**
488
493
  * Ensure a default export is present, given a default import.
489
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/default.md
494
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/default.md
490
495
  */
491
496
  'import/default'?: Linter.RuleEntry<[]>
492
497
  /**
493
498
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
494
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/dynamic-import-chunkname.md
499
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/dynamic-import-chunkname.md
495
500
  */
496
501
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
497
502
  /**
498
503
  * Forbid any invalid exports, i.e. re-export of the same name.
499
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/export.md
504
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/export.md
500
505
  */
501
506
  'import/export'?: Linter.RuleEntry<[]>
502
507
  /**
503
508
  * Ensure all exports appear after other statements.
504
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/exports-last.md
509
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/exports-last.md
505
510
  */
506
511
  'import/exports-last'?: Linter.RuleEntry<[]>
507
512
  /**
508
513
  * Ensure consistent use of file extension within the import path.
509
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/extensions.md
514
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/extensions.md
510
515
  */
511
516
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
512
517
  /**
513
518
  * Ensure all imports appear before other statements.
514
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/first.md
519
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/first.md
515
520
  */
516
521
  'import/first'?: Linter.RuleEntry<ImportFirst>
517
522
  /**
518
523
  * Prefer named exports to be grouped together in a single export declaration.
519
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/group-exports.md
524
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/group-exports.md
520
525
  */
521
526
  'import/group-exports'?: Linter.RuleEntry<[]>
522
527
  /**
523
528
  * Replaced by `import-x/first`.
524
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/imports-first.md
529
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/imports-first.md
525
530
  * @deprecated
526
531
  */
527
532
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
528
533
  /**
529
534
  * Enforce the maximum number of dependencies a module can have.
530
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/max-dependencies.md
535
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/max-dependencies.md
531
536
  */
532
537
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
533
538
  /**
534
539
  * Ensure named imports correspond to a named export in the remote file.
535
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/named.md
540
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/named.md
536
541
  */
537
542
  'import/named'?: Linter.RuleEntry<ImportNamed>
538
543
  /**
539
544
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
540
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/namespace.md
545
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/namespace.md
541
546
  */
542
547
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
543
548
  /**
544
549
  * Enforce a newline after import statements.
545
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/newline-after-import.md
550
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/newline-after-import.md
546
551
  */
547
552
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
548
553
  /**
549
554
  * Forbid import of modules using absolute paths.
550
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-absolute-path.md
555
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-absolute-path.md
551
556
  */
552
557
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
553
558
  /**
554
559
  * Forbid AMD `require` and `define` calls.
555
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-amd.md
560
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-amd.md
556
561
  */
557
562
  'import/no-amd'?: Linter.RuleEntry<[]>
558
563
  /**
559
564
  * Forbid anonymous values as default exports.
560
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-anonymous-default-export.md
565
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-anonymous-default-export.md
561
566
  */
562
567
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
563
568
  /**
564
569
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
565
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-commonjs.md
570
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-commonjs.md
566
571
  */
567
572
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
568
573
  /**
569
574
  * Forbid a module from importing a module with a dependency path back to itself.
570
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-cycle.md
575
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-cycle.md
571
576
  */
572
577
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
573
578
  /**
574
579
  * Forbid default exports.
575
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-default-export.md
580
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-default-export.md
576
581
  */
577
582
  'import/no-default-export'?: Linter.RuleEntry<[]>
578
583
  /**
579
584
  * Forbid imported names marked with `@deprecated` documentation tag.
580
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-deprecated.md
585
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-deprecated.md
581
586
  */
582
587
  'import/no-deprecated'?: Linter.RuleEntry<[]>
583
588
  /**
584
589
  * Forbid repeated import of the same module in multiple places.
585
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-duplicates.md
590
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-duplicates.md
586
591
  */
587
592
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
588
593
  /**
589
594
  * Forbid `require()` calls with expressions.
590
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-dynamic-require.md
595
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-dynamic-require.md
591
596
  */
592
597
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
593
598
  /**
594
599
  * Forbid empty named import blocks.
595
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-empty-named-blocks.md
600
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-empty-named-blocks.md
596
601
  */
597
602
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
598
603
  /**
599
604
  * Forbid the use of extraneous packages.
600
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-extraneous-dependencies.md
605
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-extraneous-dependencies.md
601
606
  */
602
607
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
603
608
  /**
604
609
  * Forbid import statements with CommonJS module.exports.
605
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-import-module-exports.md
610
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-import-module-exports.md
606
611
  */
607
612
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
608
613
  /**
609
614
  * Forbid importing the submodules of other modules.
610
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-internal-modules.md
615
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-internal-modules.md
611
616
  */
612
617
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
613
618
  /**
614
619
  * Forbid the use of mutable exports with `var` or `let`.
615
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-mutable-exports.md
620
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-mutable-exports.md
616
621
  */
617
622
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
618
623
  /**
619
624
  * Forbid use of exported name as identifier of default export.
620
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-as-default.md
625
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-as-default.md
621
626
  */
622
627
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
623
628
  /**
624
629
  * Forbid use of exported name as property of default export.
625
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-as-default-member.md
630
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-as-default-member.md
626
631
  */
627
632
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
628
633
  /**
629
634
  * Forbid named default exports.
630
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-default.md
635
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-default.md
631
636
  */
632
637
  'import/no-named-default'?: Linter.RuleEntry<[]>
633
638
  /**
634
639
  * Forbid named exports.
635
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-named-export.md
640
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-named-export.md
636
641
  */
637
642
  'import/no-named-export'?: Linter.RuleEntry<[]>
638
643
  /**
639
644
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
640
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-namespace.md
645
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-namespace.md
641
646
  */
642
647
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
643
648
  /**
644
649
  * Forbid Node.js builtin modules.
645
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-nodejs-modules.md
650
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-nodejs-modules.md
646
651
  */
647
652
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
648
653
  /**
649
654
  * Forbid importing packages through relative paths.
650
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-relative-packages.md
655
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-relative-packages.md
651
656
  */
652
657
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
653
658
  /**
654
659
  * Forbid importing modules from parent directories.
655
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-relative-parent-imports.md
660
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-relative-parent-imports.md
656
661
  */
657
662
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
658
663
  /**
659
664
  * Forbid importing a default export by a different name.
660
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-rename-default.md
665
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-rename-default.md
661
666
  */
662
667
  'import/no-rename-default'?: Linter.RuleEntry<ImportNoRenameDefault>
663
668
  /**
664
669
  * Enforce which files can be imported in a given folder.
665
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-restricted-paths.md
670
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-restricted-paths.md
666
671
  */
667
672
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
668
673
  /**
669
674
  * Forbid a module from importing itself.
670
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-self-import.md
675
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-self-import.md
671
676
  */
672
677
  'import/no-self-import'?: Linter.RuleEntry<[]>
673
678
  /**
674
679
  * Forbid unassigned imports.
675
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-unassigned-import.md
680
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-unassigned-import.md
676
681
  */
677
682
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
678
683
  /**
679
684
  * Ensure imports point to a file/module that can be resolved.
680
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-unresolved.md
685
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-unresolved.md
681
686
  */
682
687
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
683
688
  /**
684
689
  * Forbid modules without exports, or exports without matching import in another module.
685
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-unused-modules.md
690
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-unused-modules.md
686
691
  */
687
692
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
688
693
  /**
689
694
  * Forbid unnecessary path segments in import and require statements.
690
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-useless-path-segments.md
695
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-useless-path-segments.md
691
696
  */
692
697
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
693
698
  /**
694
699
  * Forbid webpack loader syntax in imports.
695
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/no-webpack-loader-syntax.md
700
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/no-webpack-loader-syntax.md
696
701
  */
697
702
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
698
703
  /**
699
704
  * Enforce a convention in module import order.
700
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/order.md
705
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/order.md
701
706
  */
702
707
  'import/order'?: Linter.RuleEntry<ImportOrder>
703
708
  /**
704
709
  * Prefer a default export if module exports a single name or multiple names.
705
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/prefer-default-export.md
710
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/prefer-default-export.md
706
711
  */
707
712
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
708
713
  /**
709
714
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
710
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.2.1/docs/rules/unambiguous.md
715
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.3.0/docs/rules/unambiguous.md
711
716
  */
712
717
  'import/unambiguous'?: Linter.RuleEntry<[]>
713
718
  /**
@@ -9744,6 +9749,10 @@ type PerfectionistSortArrayIncludes = []|[{
9744
9749
  ignoreCase?: boolean
9745
9750
 
9746
9751
  groupKind?: ("mixed" | "literals-first" | "spreads-first")
9752
+
9753
+ partitionByComment?: (string[] | boolean | string)
9754
+
9755
+ partitionByNewLine?: boolean
9747
9756
  }]
9748
9757
  // ----- perfectionist/sort-astro-attributes -----
9749
9758
  type PerfectionistSortAstroAttributes = []|[{
@@ -9823,6 +9832,8 @@ type PerfectionistSortEnums = []|[{
9823
9832
  forceNumericSort?: boolean
9824
9833
 
9825
9834
  partitionByComment?: (string[] | boolean | string)
9835
+
9836
+ partitionByNewLine?: boolean
9826
9837
  }]
9827
9838
  // ----- perfectionist/sort-exports -----
9828
9839
  type PerfectionistSortExports = []|[{
@@ -9832,6 +9843,12 @@ type PerfectionistSortExports = []|[{
9832
9843
  order?: ("asc" | "desc")
9833
9844
 
9834
9845
  ignoreCase?: boolean
9846
+
9847
+ partitionByComment?: (string[] | boolean | string)
9848
+
9849
+ partitionByNewLine?: boolean
9850
+
9851
+ groupKind?: ("mixed" | "values-first" | "types-first")
9835
9852
  }]
9836
9853
  // ----- perfectionist/sort-imports -----
9837
9854
  type PerfectionistSortImports = []|[_PerfectionistSortImportsSortImports]
@@ -9882,6 +9899,8 @@ type PerfectionistSortInterfaces = []|[{
9882
9899
 
9883
9900
  ignorePattern?: string[]
9884
9901
 
9902
+ partitionByComment?: (boolean | string | string[])
9903
+
9885
9904
  partitionByNewLine?: boolean
9886
9905
 
9887
9906
  groupKind?: ("mixed" | "optional-first" | "required-first")
@@ -9902,6 +9921,10 @@ type PerfectionistSortIntersectionTypes = []|[{
9902
9921
  ignoreCase?: boolean
9903
9922
 
9904
9923
  groups?: (string | string[])[]
9924
+
9925
+ partitionByComment?: (string[] | boolean | string)
9926
+
9927
+ partitionByNewLine?: boolean
9905
9928
  }]
9906
9929
  // ----- perfectionist/sort-jsx-props -----
9907
9930
  type PerfectionistSortJsxProps = []|[{
@@ -9928,6 +9951,10 @@ type PerfectionistSortMaps = []|[{
9928
9951
  order?: ("asc" | "desc")
9929
9952
 
9930
9953
  ignoreCase?: boolean
9954
+
9955
+ partitionByComment?: (string[] | boolean | string)
9956
+
9957
+ partitionByNewLine?: boolean
9931
9958
  }]
9932
9959
  // ----- perfectionist/sort-named-exports -----
9933
9960
  type PerfectionistSortNamedExports = []|[{
@@ -9939,6 +9966,10 @@ type PerfectionistSortNamedExports = []|[{
9939
9966
  ignoreCase?: boolean
9940
9967
 
9941
9968
  groupKind?: ("mixed" | "values-first" | "types-first")
9969
+
9970
+ partitionByComment?: (string[] | boolean | string)
9971
+
9972
+ partitionByNewLine?: boolean
9942
9973
  }]
9943
9974
  // ----- perfectionist/sort-named-imports -----
9944
9975
  type PerfectionistSortNamedImports = []|[{
@@ -9952,6 +9983,10 @@ type PerfectionistSortNamedImports = []|[{
9952
9983
  ignoreAlias?: boolean
9953
9984
 
9954
9985
  groupKind?: ("mixed" | "values-first" | "types-first")
9986
+
9987
+ partitionByComment?: (string[] | boolean | string)
9988
+
9989
+ partitionByNewLine?: boolean
9955
9990
  }]
9956
9991
  // ----- perfectionist/sort-object-types -----
9957
9992
  type PerfectionistSortObjectTypes = []|[{
@@ -9962,6 +9997,8 @@ type PerfectionistSortObjectTypes = []|[{
9962
9997
 
9963
9998
  ignoreCase?: boolean
9964
9999
 
10000
+ partitionByComment?: (string[] | boolean | string)
10001
+
9965
10002
  partitionByNewLine?: boolean
9966
10003
 
9967
10004
  groupKind?: ("mixed" | "required-first" | "optional-first")
@@ -10007,6 +10044,10 @@ type PerfectionistSortSets = []|[{
10007
10044
  ignoreCase?: boolean
10008
10045
 
10009
10046
  groupKind?: ("mixed" | "literals-first" | "spreads-first")
10047
+
10048
+ partitionByComment?: (string[] | boolean | string)
10049
+
10050
+ partitionByNewLine?: boolean
10010
10051
  }]
10011
10052
  // ----- perfectionist/sort-svelte-attributes -----
10012
10053
  type PerfectionistSortSvelteAttributes = []|[{
@@ -10042,6 +10083,10 @@ type PerfectionistSortUnionTypes = []|[{
10042
10083
  ignoreCase?: boolean
10043
10084
 
10044
10085
  groups?: (string | string[])[]
10086
+
10087
+ partitionByComment?: (string[] | boolean | string)
10088
+
10089
+ partitionByNewLine?: boolean
10045
10090
  }]
10046
10091
  // ----- perfectionist/sort-variable-declarations -----
10047
10092
  type PerfectionistSortVariableDeclarations = []|[{
@@ -10051,6 +10096,10 @@ type PerfectionistSortVariableDeclarations = []|[{
10051
10096
  order?: ("asc" | "desc")
10052
10097
 
10053
10098
  ignoreCase?: boolean
10099
+
10100
+ partitionByComment?: (string[] | boolean | string)
10101
+
10102
+ partitionByNewLine?: boolean
10054
10103
  }]
10055
10104
  // ----- perfectionist/sort-vue-attributes -----
10056
10105
  type PerfectionistSortVueAttributes = []|[{
@@ -12598,6 +12647,19 @@ type TsRestrictTemplateExpressions = []|[{
12598
12647
  allowRegExp?: boolean
12599
12648
 
12600
12649
  allowNever?: boolean
12650
+
12651
+ allow?: (string | {
12652
+ from: "file"
12653
+ name: (string | [string, ...(string)[]])
12654
+ path?: string
12655
+ } | {
12656
+ from: "lib"
12657
+ name: (string | [string, ...(string)[]])
12658
+ } | {
12659
+ from: "package"
12660
+ name: (string | [string, ...(string)[]])
12661
+ package: string
12662
+ })[]
12601
12663
  }]
12602
12664
  // ----- ts/return-await -----
12603
12665
  type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
package/dist/index.js CHANGED
@@ -113,6 +113,7 @@ async function disables() {
113
113
  files: [`**/scripts/${GLOB_SRC}`],
114
114
  name: "eslint/disables/scripts",
115
115
  rules: {
116
+ "antfu/no-top-level-await": "off",
116
117
  "no-console": "off",
117
118
  "ts/explicit-function-return-type": "off"
118
119
  }
@@ -121,6 +122,7 @@ async function disables() {
121
122
  files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
122
123
  name: "eslint/disables/cli",
123
124
  rules: {
125
+ "antfu/no-top-level-await": "off",
124
126
  "no-console": "off"
125
127
  }
126
128
  },
@@ -155,6 +157,15 @@ async function disables() {
155
157
  rules: {
156
158
  "ts/no-require-imports": "off"
157
159
  }
160
+ },
161
+ {
162
+ files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
163
+ name: "antfu/disables/config-files",
164
+ rules: {
165
+ "antfu/no-top-level-await": "off",
166
+ "no-console": "off",
167
+ "ts/explicit-function-return-type": "off"
168
+ }
158
169
  }
159
170
  ];
160
171
  }
@@ -597,6 +608,7 @@ async function javascript(options = {}) {
597
608
  },
598
609
  rules: {
599
610
  "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
611
+ "antfu/no-top-level-await": "error",
600
612
  "array-callback-return": "error",
601
613
  "block-scoped-var": "error",
602
614
  "constructor-super": "error",
@@ -1671,12 +1683,24 @@ async function typescript(options = {}) {
1671
1683
  // allowTernary 设置为 true 将使你能够在表达式中使用三元运算符,类似于短路计算(默认值:false)
1672
1684
  allowTernary: true
1673
1685
  }],
1674
- "ts/no-unused-vars": "off",
1686
+ "ts/no-unused-vars": [
1687
+ "error",
1688
+ {
1689
+ args: "all",
1690
+ argsIgnorePattern: "^_",
1691
+ caughtErrors: "all",
1692
+ caughtErrorsIgnorePattern: "^_",
1693
+ destructuredArrayIgnorePattern: "^_",
1694
+ ignoreRestSiblings: true,
1695
+ varsIgnorePattern: "^_"
1696
+ }
1697
+ ],
1675
1698
  "ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
1676
1699
  "ts/no-useless-constructor": "off",
1677
1700
  "ts/no-wrapper-object-types": "error",
1678
1701
  "ts/triple-slash-reference": "off",
1679
1702
  "ts/unified-signatures": "off",
1703
+ "unused-imports/no-unused-vars": "off",
1680
1704
  ...type === "lib" ? {
1681
1705
  "ts/explicit-function-return-type": ["error", {
1682
1706
  allowExpressions: true,
@@ -1853,6 +1877,7 @@ async function vue(options = {}) {
1853
1877
  ...pluginVue.configs["strongly-recommended"].rules,
1854
1878
  ...pluginVue.configs.recommended.rules
1855
1879
  },
1880
+ "antfu/no-top-level-await": "off",
1856
1881
  "node/prefer-global/process": "off",
1857
1882
  "ts/explicit-function-return-type": "off",
1858
1883
  "vue/block-order": ["error", {
@@ -2037,6 +2062,7 @@ function lincy(options = {}, ...userConfigs) {
2037
2062
  autoRenamePlugins = true,
2038
2063
  componentExts = [],
2039
2064
  gitignore: enableGitignore = true,
2065
+ ignores: ignoresList = [],
2040
2066
  jsx: enableJsx = true,
2041
2067
  overrides = {},
2042
2068
  react: enableReact = ReactPackages.some((i) => isPackageExists3(i)),
@@ -2075,7 +2101,10 @@ function lincy(options = {}, ...userConfigs) {
2075
2101
  }
2076
2102
  configs2.push(
2077
2103
  ignores({
2078
- ignores: overrides.ignores
2104
+ ignores: [
2105
+ ...overrides.ignores || [],
2106
+ ...ignoresList
2107
+ ]
2079
2108
  }),
2080
2109
  javascript({
2081
2110
  isInEditor,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "5.2.3",
4
+ "version": "5.2.5",
5
5
  "packageManager": "pnpm@9.1.0",
6
6
  "description": "LinCenYing's ESLint config",
7
7
  "author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
@@ -72,20 +72,20 @@
72
72
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
73
73
  "@eslint/markdown": "^6.1.0",
74
74
  "@stylistic/eslint-plugin": "2.8.0",
75
- "@typescript-eslint/eslint-plugin": "8.5.0",
76
- "@typescript-eslint/parser": "8.5.0",
75
+ "@typescript-eslint/eslint-plugin": "8.7.0",
76
+ "@typescript-eslint/parser": "8.7.0",
77
77
  "@vitest/eslint-plugin": "^1.1.4",
78
78
  "eslint-config-flat-gitignore": "^0.3.0",
79
79
  "eslint-flat-config-utils": "^0.4.0",
80
80
  "eslint-merge-processors": "^0.1.0",
81
81
  "eslint-parser-plain": "^0.1.0",
82
- "eslint-plugin-antfu": "^2.6.0",
83
- "eslint-plugin-import-x": "^4.2.1",
84
- "eslint-plugin-jsdoc": "^50.2.3",
82
+ "eslint-plugin-antfu": "^2.7.0",
83
+ "eslint-plugin-import-x": "^4.3.0",
84
+ "eslint-plugin-jsdoc": "^50.2.4",
85
85
  "eslint-plugin-jsonc": "^2.16.0",
86
- "eslint-plugin-n": "^17.10.2",
86
+ "eslint-plugin-n": "^17.10.3",
87
87
  "eslint-plugin-no-only-tests": "^3.3.0",
88
- "eslint-plugin-perfectionist": "^3.6.0",
88
+ "eslint-plugin-perfectionist": "^3.7.0",
89
89
  "eslint-plugin-regexp": "^2.6.0",
90
90
  "eslint-plugin-toml": "^0.11.1",
91
91
  "eslint-plugin-unicorn": "^55.0.0",
@@ -103,7 +103,7 @@
103
103
  },
104
104
  "devDependencies": {
105
105
  "@antfu/ni": "^0.23.0",
106
- "@eslint-react/eslint-plugin": "^1.14.1",
106
+ "@eslint-react/eslint-plugin": "^1.14.2",
107
107
  "@eslint-types/jsdoc": "48.2.2",
108
108
  "@eslint-types/typescript-eslint": "^7.5.0",
109
109
  "@eslint-types/unicorn": "^52.0.0",
@@ -111,11 +111,11 @@
111
111
  "@lincy/eslint-config": "workspace:*",
112
112
  "@prettier/plugin-xml": "^3.4.1",
113
113
  "@stylistic/eslint-plugin-migrate": "^2.8.0",
114
- "@types/node": "^22.5.5",
114
+ "@types/node": "^22.7.0",
115
115
  "@types/prompts": "^2.4.9",
116
116
  "@unocss/eslint-plugin": "^0.62.4",
117
117
  "bumpp": "^9.5.2",
118
- "eslint": "^9.10.0",
118
+ "eslint": "^9.11.1",
119
119
  "eslint-plugin-format": "^0.1.2",
120
120
  "eslint-plugin-react-hooks": "^4.6.2",
121
121
  "eslint-plugin-react-refresh": "^0.4.12",
@@ -129,11 +129,11 @@
129
129
  "simple-git-hooks": "^2.11.1",
130
130
  "simple-open-url": "^3.0.1",
131
131
  "sucrase": "^3.35.0",
132
- "tsup": "^8.2.4",
132
+ "tsup": "^8.3.0",
133
133
  "typescript": "^5.6.2",
134
134
  "unbuild": "^2.0.0",
135
135
  "vitest": "^2.1.1",
136
- "vue": "^3.5.6"
136
+ "vue": "^3.5.8"
137
137
  },
138
138
  "pnpm": {
139
139
  "peerDependencyRules": {