@antfu/eslint-config 2.27.2 → 3.0.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.d.ts CHANGED
@@ -756,228 +756,233 @@ interface RuleOptions {
756
756
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
757
757
  /**
758
758
  * Enforce or ban the use of inline type-only markers for named imports.
759
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/consistent-type-specifier-style.md
759
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/consistent-type-specifier-style.md
760
760
  */
761
761
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
762
762
  /**
763
763
  * Ensure a default export is present, given a default import.
764
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/default.md
764
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/default.md
765
765
  */
766
766
  'import/default'?: Linter.RuleEntry<[]>
767
767
  /**
768
768
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
769
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/dynamic-import-chunkname.md
769
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/dynamic-import-chunkname.md
770
770
  */
771
771
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
772
772
  /**
773
773
  * Forbid any invalid exports, i.e. re-export of the same name.
774
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/export.md
774
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/export.md
775
775
  */
776
776
  'import/export'?: Linter.RuleEntry<[]>
777
777
  /**
778
778
  * Ensure all exports appear after other statements.
779
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/exports-last.md
779
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/exports-last.md
780
780
  */
781
781
  'import/exports-last'?: Linter.RuleEntry<[]>
782
782
  /**
783
783
  * Ensure consistent use of file extension within the import path.
784
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/extensions.md
784
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/extensions.md
785
785
  */
786
786
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
787
787
  /**
788
788
  * Ensure all imports appear before other statements.
789
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/first.md
789
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/first.md
790
790
  */
791
791
  'import/first'?: Linter.RuleEntry<ImportFirst>
792
792
  /**
793
793
  * Prefer named exports to be grouped together in a single export declaration.
794
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/group-exports.md
794
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/group-exports.md
795
795
  */
796
796
  'import/group-exports'?: Linter.RuleEntry<[]>
797
797
  /**
798
798
  * Replaced by `import-x/first`.
799
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/imports-first.md
799
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/imports-first.md
800
800
  * @deprecated
801
801
  */
802
802
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
803
803
  /**
804
804
  * Enforce the maximum number of dependencies a module can have.
805
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/max-dependencies.md
805
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/max-dependencies.md
806
806
  */
807
807
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
808
808
  /**
809
809
  * Ensure named imports correspond to a named export in the remote file.
810
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/named.md
810
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/named.md
811
811
  */
812
812
  'import/named'?: Linter.RuleEntry<ImportNamed>
813
813
  /**
814
814
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
815
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/namespace.md
815
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/namespace.md
816
816
  */
817
817
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
818
818
  /**
819
819
  * Enforce a newline after import statements.
820
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/newline-after-import.md
820
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/newline-after-import.md
821
821
  */
822
822
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
823
823
  /**
824
824
  * Forbid import of modules using absolute paths.
825
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-absolute-path.md
825
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-absolute-path.md
826
826
  */
827
827
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
828
828
  /**
829
829
  * Forbid AMD `require` and `define` calls.
830
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-amd.md
830
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-amd.md
831
831
  */
832
832
  'import/no-amd'?: Linter.RuleEntry<[]>
833
833
  /**
834
834
  * Forbid anonymous values as default exports.
835
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-anonymous-default-export.md
835
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-anonymous-default-export.md
836
836
  */
837
837
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
838
838
  /**
839
839
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
840
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-commonjs.md
840
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-commonjs.md
841
841
  */
842
842
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
843
843
  /**
844
844
  * Forbid a module from importing a module with a dependency path back to itself.
845
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-cycle.md
845
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-cycle.md
846
846
  */
847
847
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
848
848
  /**
849
849
  * Forbid default exports.
850
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-default-export.md
850
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-default-export.md
851
851
  */
852
852
  'import/no-default-export'?: Linter.RuleEntry<[]>
853
853
  /**
854
854
  * Forbid imported names marked with `@deprecated` documentation tag.
855
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-deprecated.md
855
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-deprecated.md
856
856
  */
857
857
  'import/no-deprecated'?: Linter.RuleEntry<[]>
858
858
  /**
859
859
  * Forbid repeated import of the same module in multiple places.
860
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-duplicates.md
860
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-duplicates.md
861
861
  */
862
862
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
863
863
  /**
864
864
  * Forbid `require()` calls with expressions.
865
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-dynamic-require.md
865
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-dynamic-require.md
866
866
  */
867
867
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
868
868
  /**
869
869
  * Forbid empty named import blocks.
870
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-empty-named-blocks.md
870
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-empty-named-blocks.md
871
871
  */
872
872
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
873
873
  /**
874
874
  * Forbid the use of extraneous packages.
875
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-extraneous-dependencies.md
875
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-extraneous-dependencies.md
876
876
  */
877
877
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
878
878
  /**
879
879
  * Forbid import statements with CommonJS module.exports.
880
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-import-module-exports.md
880
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-import-module-exports.md
881
881
  */
882
882
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
883
883
  /**
884
884
  * Forbid importing the submodules of other modules.
885
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-internal-modules.md
885
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-internal-modules.md
886
886
  */
887
887
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
888
888
  /**
889
889
  * Forbid the use of mutable exports with `var` or `let`.
890
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-mutable-exports.md
890
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-mutable-exports.md
891
891
  */
892
892
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
893
893
  /**
894
894
  * Forbid use of exported name as identifier of default export.
895
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-named-as-default.md
895
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-named-as-default.md
896
896
  */
897
897
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
898
898
  /**
899
899
  * Forbid use of exported name as property of default export.
900
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-named-as-default-member.md
900
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-named-as-default-member.md
901
901
  */
902
902
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
903
903
  /**
904
904
  * Forbid named default exports.
905
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-named-default.md
905
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-named-default.md
906
906
  */
907
907
  'import/no-named-default'?: Linter.RuleEntry<[]>
908
908
  /**
909
909
  * Forbid named exports.
910
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-named-export.md
910
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-named-export.md
911
911
  */
912
912
  'import/no-named-export'?: Linter.RuleEntry<[]>
913
913
  /**
914
914
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
915
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-namespace.md
915
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-namespace.md
916
916
  */
917
917
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
918
918
  /**
919
919
  * Forbid Node.js builtin modules.
920
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-nodejs-modules.md
920
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-nodejs-modules.md
921
921
  */
922
922
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
923
923
  /**
924
924
  * Forbid importing packages through relative paths.
925
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-relative-packages.md
925
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-relative-packages.md
926
926
  */
927
927
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
928
928
  /**
929
929
  * Forbid importing modules from parent directories.
930
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-relative-parent-imports.md
930
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-relative-parent-imports.md
931
931
  */
932
932
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
933
+ /**
934
+ * Forbid importing a default export by a different name.
935
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-rename-default.md
936
+ */
937
+ 'import/no-rename-default'?: Linter.RuleEntry<ImportNoRenameDefault>
933
938
  /**
934
939
  * Enforce which files can be imported in a given folder.
935
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-restricted-paths.md
940
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-restricted-paths.md
936
941
  */
937
942
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
938
943
  /**
939
944
  * Forbid a module from importing itself.
940
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-self-import.md
945
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-self-import.md
941
946
  */
942
947
  'import/no-self-import'?: Linter.RuleEntry<[]>
943
948
  /**
944
949
  * Forbid unassigned imports.
945
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-unassigned-import.md
950
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-unassigned-import.md
946
951
  */
947
952
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
948
953
  /**
949
954
  * Ensure imports point to a file/module that can be resolved.
950
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-unresolved.md
955
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-unresolved.md
951
956
  */
952
957
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
953
958
  /**
954
959
  * Forbid modules without exports, or exports without matching import in another module.
955
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-unused-modules.md
960
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-unused-modules.md
956
961
  */
957
962
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
958
963
  /**
959
964
  * Forbid unnecessary path segments in import and require statements.
960
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-useless-path-segments.md
965
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-useless-path-segments.md
961
966
  */
962
967
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
963
968
  /**
964
969
  * Forbid webpack loader syntax in imports.
965
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/no-webpack-loader-syntax.md
970
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/no-webpack-loader-syntax.md
966
971
  */
967
972
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
968
973
  /**
969
974
  * Enforce a convention in module import order.
970
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/order.md
975
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/order.md
971
976
  */
972
977
  'import/order'?: Linter.RuleEntry<ImportOrder>
973
978
  /**
974
979
  * Prefer a default export if module exports a single name or multiple names.
975
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/prefer-default-export.md
980
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/prefer-default-export.md
976
981
  */
977
982
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
978
983
  /**
979
984
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
980
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0-1/docs/rules/unambiguous.md
985
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.1.0/docs/rules/unambiguous.md
981
986
  */
982
987
  'import/unambiguous'?: Linter.RuleEntry<[]>
983
988
  /**
@@ -4677,11 +4682,6 @@ interface RuleOptions {
4677
4682
  * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
4678
4683
  */
4679
4684
  'test/expect-expect'?: Linter.RuleEntry<TestExpectExpect>
4680
- /**
4681
- * Enforce padding around afterAll blocks
4682
- * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/index.md
4683
- */
4684
- 'test/index'?: Linter.RuleEntry<[]>
4685
4685
  /**
4686
4686
  * enforce a maximum number of expect per test
4687
4687
  * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
@@ -4798,6 +4798,46 @@ interface RuleOptions {
4798
4798
  * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
4799
4799
  */
4800
4800
  'test/no-test-return-statement'?: Linter.RuleEntry<[]>
4801
+ /**
4802
+ * Enforce padding around `afterAll` blocks
4803
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
4804
+ */
4805
+ 'test/padding-around-after-all-blocks'?: Linter.RuleEntry<[]>
4806
+ /**
4807
+ * Enforce padding around `afterEach` blocks
4808
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-each-blocks.md
4809
+ */
4810
+ 'test/padding-around-after-each-blocks'?: Linter.RuleEntry<[]>
4811
+ /**
4812
+ * Enforce padding around vitest functions
4813
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-all.md
4814
+ */
4815
+ 'test/padding-around-all'?: Linter.RuleEntry<[]>
4816
+ /**
4817
+ * Enforce padding around `beforeAll` blocks
4818
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-all-blocks.md
4819
+ */
4820
+ 'test/padding-around-before-all-blocks'?: Linter.RuleEntry<[]>
4821
+ /**
4822
+ * Enforce padding around `beforeEach` blocks
4823
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-each-blocks.md
4824
+ */
4825
+ 'test/padding-around-before-each-blocks'?: Linter.RuleEntry<[]>
4826
+ /**
4827
+ * Enforce padding around `describe` blocks
4828
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
4829
+ */
4830
+ 'test/padding-around-describe-blocks'?: Linter.RuleEntry<[]>
4831
+ /**
4832
+ * Enforce padding around `expect` groups
4833
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-expect-groups.md
4834
+ */
4835
+ 'test/padding-around-expect-groups'?: Linter.RuleEntry<[]>
4836
+ /**
4837
+ * Enforce padding around afterAll blocks
4838
+ * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
4839
+ */
4840
+ 'test/padding-around-test-blocks'?: Linter.RuleEntry<[]>
4801
4841
  /**
4802
4842
  * enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
4803
4843
  * @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
@@ -5189,6 +5229,11 @@ interface RuleOptions {
5189
5229
  * @see https://typescript-eslint.io/rules/no-confusing-void-expression
5190
5230
  */
5191
5231
  'ts/no-confusing-void-expression'?: Linter.RuleEntry<TsNoConfusingVoidExpression>
5232
+ /**
5233
+ * Disallow using code marked as `@deprecated`
5234
+ * @see https://typescript-eslint.io/rules/no-deprecated
5235
+ */
5236
+ 'ts/no-deprecated'?: Linter.RuleEntry<[]>
5192
5237
  /**
5193
5238
  * Disallow duplicate class members
5194
5239
  * @see https://typescript-eslint.io/rules/no-dupe-class-members
@@ -8224,6 +8269,11 @@ type ImportNoRelativeParentImports = []|[{
8224
8269
 
8225
8270
  ignore?: [string, ...(string)[]]
8226
8271
  }]
8272
+ // ----- import/no-rename-default -----
8273
+ type ImportNoRenameDefault = []|[{
8274
+ commonjs?: boolean
8275
+ preventRenamingBindings?: boolean
8276
+ }]
8227
8277
  // ----- import/no-restricted-paths -----
8228
8278
  type ImportNoRestrictedPaths = []|[{
8229
8279
 
@@ -11940,6 +11990,7 @@ type StyleTypeAnnotationSpacing = []|[{
11940
11990
  parameter?: _StyleTypeAnnotationSpacing_SpacingConfig
11941
11991
  property?: _StyleTypeAnnotationSpacing_SpacingConfig
11942
11992
  returnType?: _StyleTypeAnnotationSpacing_SpacingConfig
11993
+ operator?: _StyleTypeAnnotationSpacing_SpacingConfig
11943
11994
  }
11944
11995
  }]
11945
11996
  interface _StyleTypeAnnotationSpacing_SpacingConfig {
@@ -15039,6 +15090,14 @@ interface OptionsComponentExts {
15039
15090
  */
15040
15091
  componentExts?: string[];
15041
15092
  }
15093
+ interface OptionsUnicorn {
15094
+ /**
15095
+ * Include all rules recommended by `eslint-plugin-unicorn`, instead of only ones picked by Anthony.
15096
+ *
15097
+ * @default false
15098
+ */
15099
+ allRecommended?: boolean;
15100
+ }
15042
15101
  interface OptionsTypeScriptParserOptions {
15043
15102
  /**
15044
15103
  * Additional parser options for TypeScript.
@@ -15146,6 +15205,12 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
15146
15205
  * @default true
15147
15206
  */
15148
15207
  jsx?: boolean;
15208
+ /**
15209
+ * Options for eslint-plugin-unicorn.
15210
+ *
15211
+ * @default true
15212
+ */
15213
+ unicorn?: boolean | OptionsUnicorn;
15149
15214
  /**
15150
15215
  * Enable test support.
15151
15216
  *
@@ -15312,7 +15377,7 @@ declare const defaultPluginRenaming: {
15312
15377
  * @returns {Promise<TypedFlatConfigItem[]>}
15313
15378
  * The merged ESLint configurations.
15314
15379
  */
15315
- declare function antfu(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
15380
+ declare function antfu(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
15316
15381
  type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
15317
15382
  declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
15318
15383
  declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): Partial<Linter.RulesRecord & RuleOptions>;
@@ -15325,7 +15390,7 @@ declare function comments(): Promise<TypedFlatConfigItem[]>;
15325
15390
 
15326
15391
  declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
15327
15392
 
15328
- declare function ignores(): Promise<TypedFlatConfigItem[]>;
15393
+ declare function ignores(userIgnores?: string[]): Promise<TypedFlatConfigItem[]>;
15329
15394
 
15330
15395
  declare function imports(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
15331
15396
 
@@ -15379,7 +15444,7 @@ declare function toml(options?: OptionsOverrides & OptionsStylistic & OptionsFil
15379
15444
 
15380
15445
  declare function typescript(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsProjectType): Promise<TypedFlatConfigItem[]>;
15381
15446
 
15382
- declare function unicorn(): Promise<TypedFlatConfigItem[]>;
15447
+ declare function unicorn(options?: OptionsUnicorn): Promise<TypedFlatConfigItem[]>;
15383
15448
 
15384
15449
  declare function unocss(options?: OptionsUnoCSS): Promise<TypedFlatConfigItem[]>;
15385
15450
 
@@ -15492,4 +15557,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
15492
15557
  declare function isInEditorEnv(): boolean;
15493
15558
  declare function isInGitHooksOrLintStaged(): boolean;
15494
15559
 
15495
- export { type Awaitable, type ConfigNames, 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, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsProjectType, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnoCSS, type OptionsVue, type ResolvedOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, type StylisticOptions, type TypedFlatConfigItem, antfu, astro, combine, command, comments, antfu as default, defaultPluginRenaming, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
15560
+ export { type Awaitable, type ConfigNames, 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, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsProjectType, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type OptionsVue, type ResolvedOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, type StylisticOptions, type TypedFlatConfigItem, antfu, astro, combine, command, comments, antfu as default, defaultPluginRenaming, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -611,10 +611,14 @@ async function formatters(options = {}, stylistic2 = {}) {
611
611
  }
612
612
 
613
613
  // src/configs/ignores.ts
614
- async function ignores() {
614
+ async function ignores(userIgnores = []) {
615
615
  return [
616
616
  {
617
- ignores: GLOB_EXCLUDE
617
+ ignores: [
618
+ ...GLOB_EXCLUDE,
619
+ ...userIgnores
620
+ ],
621
+ name: "antfu/ignores"
618
622
  }
619
623
  ];
620
624
  }
@@ -770,9 +774,6 @@ async function javascript(options = {}) {
770
774
  ],
771
775
  "no-restricted-syntax": [
772
776
  "error",
773
- "DebuggerStatement",
774
- "LabeledStatement",
775
- "WithStatement",
776
777
  "TSEnumDeclaration[const=true]",
777
778
  "TSExportAssignment"
778
779
  ],
@@ -1970,7 +1971,7 @@ async function typescript(options = {}) {
1970
1971
  }
1971
1972
 
1972
1973
  // src/configs/unicorn.ts
1973
- async function unicorn() {
1974
+ async function unicorn(options = {}) {
1974
1975
  return [
1975
1976
  {
1976
1977
  name: "antfu/unicorn/rules",
@@ -1978,32 +1979,24 @@ async function unicorn() {
1978
1979
  unicorn: default5
1979
1980
  },
1980
1981
  rules: {
1981
- // Pass error message when throwing errors
1982
- "unicorn/error-message": "error",
1983
- // Uppercase regex escapes
1984
- "unicorn/escape-case": "error",
1985
- // Array.isArray instead of instanceof
1986
- "unicorn/no-instanceof-array": "error",
1987
- // Ban `new Array` as `Array` constructor's params are ambiguous
1988
- "unicorn/no-new-array": "error",
1989
- // Prevent deprecated `new Buffer()`
1990
- "unicorn/no-new-buffer": "error",
1991
- // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
1992
- "unicorn/number-literal-case": "error",
1993
- // textContent instead of innerText
1994
- "unicorn/prefer-dom-node-text-content": "error",
1995
- // includes over indexOf when checking for existence
1996
- "unicorn/prefer-includes": "error",
1997
- // Prefer using the node: protocol
1998
- "unicorn/prefer-node-protocol": "error",
1999
- // Prefer using number properties like `Number.isNaN` rather than `isNaN`
2000
- "unicorn/prefer-number-properties": "error",
2001
- // String methods startsWith/endsWith instead of more complicated stuff
2002
- "unicorn/prefer-string-starts-ends-with": "error",
2003
- // Enforce throwing type error when throwing error while checking typeof
2004
- "unicorn/prefer-type-error": "error",
2005
- // Use new when throwing error
2006
- "unicorn/throw-new-error": "error"
1982
+ ...options.allRecommended ? default5.configs["flat/recommended"].rules : {
1983
+ "unicorn/consistent-empty-array-spread": "error",
1984
+ "unicorn/consistent-function-scoping": "error",
1985
+ "unicorn/error-message": "error",
1986
+ "unicorn/escape-case": "error",
1987
+ "unicorn/new-for-builtins": "error",
1988
+ "unicorn/no-instanceof-array": "error",
1989
+ "unicorn/no-new-array": "error",
1990
+ "unicorn/no-new-buffer": "error",
1991
+ "unicorn/number-literal-case": "error",
1992
+ "unicorn/prefer-dom-node-text-content": "error",
1993
+ "unicorn/prefer-includes": "error",
1994
+ "unicorn/prefer-node-protocol": "error",
1995
+ "unicorn/prefer-number-properties": "error",
1996
+ "unicorn/prefer-string-starts-ends-with": "error",
1997
+ "unicorn/prefer-type-error": "error",
1998
+ "unicorn/throw-new-error": "error"
1999
+ }
2007
2000
  }
2008
2001
  }
2009
2002
  ];
@@ -2296,8 +2289,6 @@ async function regexp(options = {}) {
2296
2289
  // src/factory.ts
2297
2290
  var flatConfigProps = [
2298
2291
  "name",
2299
- "files",
2300
- "ignores",
2301
2292
  "languageOptions",
2302
2293
  "linterOptions",
2303
2294
  "processor",
@@ -2335,6 +2326,7 @@ function antfu(options = {}, ...userConfigs) {
2335
2326
  solid: enableSolid = false,
2336
2327
  svelte: enableSvelte = false,
2337
2328
  typescript: enableTypeScript = isPackageExists4("typescript"),
2329
+ unicorn: enableUnicorn = true,
2338
2330
  unocss: enableUnoCSS = false,
2339
2331
  vue: enableVue = VuePackages.some((i) => isPackageExists4(i))
2340
2332
  } = options;
@@ -2350,15 +2342,21 @@ function antfu(options = {}, ...userConfigs) {
2350
2342
  const configs2 = [];
2351
2343
  if (enableGitignore) {
2352
2344
  if (typeof enableGitignore !== "boolean") {
2353
- configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
2345
+ configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
2346
+ name: "antfu/gitignore",
2347
+ ...enableGitignore
2348
+ })]));
2354
2349
  } else {
2355
- configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({ strict: false })]));
2350
+ configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
2351
+ name: "antfu/gitignore",
2352
+ strict: false
2353
+ })]));
2356
2354
  }
2357
2355
  }
2358
2356
  const typescriptOptions = resolveSubOptions(options, "typescript");
2359
2357
  const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
2360
2358
  configs2.push(
2361
- ignores(),
2359
+ ignores(options.ignores),
2362
2360
  javascript({
2363
2361
  isInEditor,
2364
2362
  overrides: getOverrides(options, "javascript")
@@ -2371,11 +2369,13 @@ function antfu(options = {}, ...userConfigs) {
2371
2369
  imports({
2372
2370
  stylistic: stylisticOptions
2373
2371
  }),
2374
- unicorn(),
2375
2372
  command(),
2376
2373
  // Optional plugins (installed but not enabled by default)
2377
2374
  perfectionist()
2378
2375
  );
2376
+ if (enableUnicorn) {
2377
+ configs2.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
2378
+ }
2379
2379
  if (enableVue) {
2380
2380
  componentExts.push("vue");
2381
2381
  }
@@ -2484,6 +2484,9 @@ function antfu(options = {}, ...userConfigs) {
2484
2484
  typeof stylisticOptions === "boolean" ? {} : stylisticOptions
2485
2485
  ));
2486
2486
  }
2487
+ if ("files" in options) {
2488
+ 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.');
2489
+ }
2487
2490
  const fusedConfig = flatConfigProps.reduce((acc, key) => {
2488
2491
  if (key in options)
2489
2492
  acc[key] = options[key];