@ncontiero/eslint-config 8.3.2 → 8.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1088 -284
- package/dist/index.mjs +5 -2
- package/package.json +18 -18
package/dist/index.d.mts
CHANGED
|
@@ -325,6 +325,14 @@ interface RuleOptions {
|
|
|
325
325
|
* Prefer the exponentiation operator ** over Math.pow()
|
|
326
326
|
*/
|
|
327
327
|
'e18e/prefer-exponentiation-operator'?: Linter.RuleEntry<[]>;
|
|
328
|
+
/**
|
|
329
|
+
* Prefer Array.prototype.flatMap() over .map(fn).flat() to avoid the intermediate array
|
|
330
|
+
*/
|
|
331
|
+
'e18e/prefer-flatmap-over-map-flat'?: Linter.RuleEntry<[]>;
|
|
332
|
+
/**
|
|
333
|
+
* Prefer `Map.prototype.getOrInsert()` over reading an entry with a default and writing it back
|
|
334
|
+
*/
|
|
335
|
+
'e18e/prefer-get-or-insert'?: Linter.RuleEntry<[]>;
|
|
328
336
|
/**
|
|
329
337
|
* Prefer .includes() over indexOf() comparisons for arrays and strings
|
|
330
338
|
*/
|
|
@@ -859,238 +867,238 @@ interface RuleOptions {
|
|
|
859
867
|
'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>;
|
|
860
868
|
/**
|
|
861
869
|
* Enforce or ban the use of inline type-only markers for named imports.
|
|
862
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
870
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/consistent-type-specifier-style.md
|
|
863
871
|
*/
|
|
864
872
|
'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>;
|
|
865
873
|
/**
|
|
866
874
|
* Ensure a default export is present, given a default import.
|
|
867
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
875
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/default.md
|
|
868
876
|
*/
|
|
869
877
|
'import/default'?: Linter.RuleEntry<[]>;
|
|
870
878
|
/**
|
|
871
879
|
* Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
872
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
880
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/dynamic-import-chunkname.md
|
|
873
881
|
*/
|
|
874
882
|
'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>;
|
|
875
883
|
/**
|
|
876
884
|
* Forbid any invalid exports, i.e. re-export of the same name.
|
|
877
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
885
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/export.md
|
|
878
886
|
*/
|
|
879
887
|
'import/export'?: Linter.RuleEntry<[]>;
|
|
880
888
|
/**
|
|
881
889
|
* Ensure all exports appear after other statements.
|
|
882
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
890
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/exports-last.md
|
|
883
891
|
*/
|
|
884
892
|
'import/exports-last'?: Linter.RuleEntry<[]>;
|
|
885
893
|
/**
|
|
886
894
|
* Ensure consistent use of file extension within the import path.
|
|
887
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
895
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/extensions.md
|
|
888
896
|
*/
|
|
889
897
|
'import/extensions'?: Linter.RuleEntry<ImportExtensions>;
|
|
890
898
|
/**
|
|
891
899
|
* Ensure all imports appear before other statements.
|
|
892
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
900
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/first.md
|
|
893
901
|
*/
|
|
894
902
|
'import/first'?: Linter.RuleEntry<ImportFirst>;
|
|
895
903
|
/**
|
|
896
904
|
* Prefer named exports to be grouped together in a single export declaration.
|
|
897
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
905
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/group-exports.md
|
|
898
906
|
*/
|
|
899
907
|
'import/group-exports'?: Linter.RuleEntry<[]>;
|
|
900
908
|
/**
|
|
901
909
|
* Replaced by `import-x/first`.
|
|
902
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
910
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/imports-first.md
|
|
903
911
|
* @deprecated
|
|
904
912
|
*/
|
|
905
913
|
'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>;
|
|
906
914
|
/**
|
|
907
915
|
* Enforce the maximum number of dependencies a module can have.
|
|
908
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
916
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/max-dependencies.md
|
|
909
917
|
*/
|
|
910
918
|
'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>;
|
|
911
919
|
/**
|
|
912
920
|
* Ensure named imports correspond to a named export in the remote file.
|
|
913
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
921
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/named.md
|
|
914
922
|
*/
|
|
915
923
|
'import/named'?: Linter.RuleEntry<ImportNamed>;
|
|
916
924
|
/**
|
|
917
925
|
* Ensure imported namespaces contain dereferenced properties as they are dereferenced.
|
|
918
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
926
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/namespace.md
|
|
919
927
|
*/
|
|
920
928
|
'import/namespace'?: Linter.RuleEntry<ImportNamespace>;
|
|
921
929
|
/**
|
|
922
930
|
* Enforce a newline after import statements.
|
|
923
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
931
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/newline-after-import.md
|
|
924
932
|
*/
|
|
925
933
|
'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>;
|
|
926
934
|
/**
|
|
927
935
|
* Forbid import of modules using absolute paths.
|
|
928
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
936
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-absolute-path.md
|
|
929
937
|
*/
|
|
930
938
|
'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>;
|
|
931
939
|
/**
|
|
932
940
|
* Forbid AMD `require` and `define` calls.
|
|
933
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
941
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-amd.md
|
|
934
942
|
*/
|
|
935
943
|
'import/no-amd'?: Linter.RuleEntry<[]>;
|
|
936
944
|
/**
|
|
937
945
|
* Forbid anonymous values as default exports.
|
|
938
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
946
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-anonymous-default-export.md
|
|
939
947
|
*/
|
|
940
948
|
'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>;
|
|
941
949
|
/**
|
|
942
950
|
* Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
|
|
943
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
951
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-commonjs.md
|
|
944
952
|
*/
|
|
945
953
|
'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>;
|
|
946
954
|
/**
|
|
947
955
|
* Forbid a module from importing a module with a dependency path back to itself.
|
|
948
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
956
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-cycle.md
|
|
949
957
|
*/
|
|
950
958
|
'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>;
|
|
951
959
|
/**
|
|
952
960
|
* Forbid default exports.
|
|
953
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
961
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-default-export.md
|
|
954
962
|
*/
|
|
955
963
|
'import/no-default-export'?: Linter.RuleEntry<[]>;
|
|
956
964
|
/**
|
|
957
965
|
* Forbid imported names marked with `@deprecated` documentation tag.
|
|
958
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
966
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-deprecated.md
|
|
959
967
|
*/
|
|
960
968
|
'import/no-deprecated'?: Linter.RuleEntry<[]>;
|
|
961
969
|
/**
|
|
962
970
|
* Forbid repeated import of the same module in multiple places.
|
|
963
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
971
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-duplicates.md
|
|
964
972
|
*/
|
|
965
973
|
'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>;
|
|
966
974
|
/**
|
|
967
975
|
* Forbid `require()` calls with expressions.
|
|
968
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
976
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-dynamic-require.md
|
|
969
977
|
*/
|
|
970
978
|
'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>;
|
|
971
979
|
/**
|
|
972
980
|
* Forbid empty named import blocks.
|
|
973
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
981
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-empty-named-blocks.md
|
|
974
982
|
*/
|
|
975
983
|
'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>;
|
|
976
984
|
/**
|
|
977
985
|
* Forbid the use of extraneous packages.
|
|
978
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
986
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-extraneous-dependencies.md
|
|
979
987
|
*/
|
|
980
988
|
'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>;
|
|
981
989
|
/**
|
|
982
990
|
* Forbid import statements with CommonJS module.exports.
|
|
983
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
991
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-import-module-exports.md
|
|
984
992
|
*/
|
|
985
993
|
'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>;
|
|
986
994
|
/**
|
|
987
995
|
* Forbid importing the submodules of other modules.
|
|
988
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
996
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-internal-modules.md
|
|
989
997
|
*/
|
|
990
998
|
'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>;
|
|
991
999
|
/**
|
|
992
1000
|
* Forbid the use of mutable exports with `var` or `let`.
|
|
993
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1001
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-mutable-exports.md
|
|
994
1002
|
*/
|
|
995
1003
|
'import/no-mutable-exports'?: Linter.RuleEntry<[]>;
|
|
996
1004
|
/**
|
|
997
1005
|
* Forbid use of exported name as identifier of default export.
|
|
998
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1006
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-named-as-default.md
|
|
999
1007
|
*/
|
|
1000
1008
|
'import/no-named-as-default'?: Linter.RuleEntry<[]>;
|
|
1001
1009
|
/**
|
|
1002
1010
|
* Forbid use of exported name as property of default export.
|
|
1003
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1011
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-named-as-default-member.md
|
|
1004
1012
|
*/
|
|
1005
1013
|
'import/no-named-as-default-member'?: Linter.RuleEntry<[]>;
|
|
1006
1014
|
/**
|
|
1007
1015
|
* Forbid named default exports.
|
|
1008
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1016
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-named-default.md
|
|
1009
1017
|
*/
|
|
1010
1018
|
'import/no-named-default'?: Linter.RuleEntry<[]>;
|
|
1011
1019
|
/**
|
|
1012
1020
|
* Forbid named exports.
|
|
1013
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1021
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-named-export.md
|
|
1014
1022
|
*/
|
|
1015
1023
|
'import/no-named-export'?: Linter.RuleEntry<[]>;
|
|
1016
1024
|
/**
|
|
1017
1025
|
* Forbid namespace (a.k.a. "wildcard" `*`) imports.
|
|
1018
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1026
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-namespace.md
|
|
1019
1027
|
*/
|
|
1020
1028
|
'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>;
|
|
1021
1029
|
/**
|
|
1022
1030
|
* Forbid Node.js builtin modules.
|
|
1023
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1031
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-nodejs-modules.md
|
|
1024
1032
|
*/
|
|
1025
1033
|
'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>;
|
|
1026
1034
|
/**
|
|
1027
1035
|
* Forbid importing packages through relative paths.
|
|
1028
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1036
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-relative-packages.md
|
|
1029
1037
|
*/
|
|
1030
1038
|
'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>;
|
|
1031
1039
|
/**
|
|
1032
1040
|
* Forbid importing modules from parent directories.
|
|
1033
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1041
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-relative-parent-imports.md
|
|
1034
1042
|
*/
|
|
1035
1043
|
'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>;
|
|
1036
1044
|
/**
|
|
1037
1045
|
* Forbid importing a default export by a different name.
|
|
1038
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1046
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-rename-default.md
|
|
1039
1047
|
*/
|
|
1040
1048
|
'import/no-rename-default'?: Linter.RuleEntry<ImportNoRenameDefault>;
|
|
1041
1049
|
/**
|
|
1042
1050
|
* Enforce which files can be imported in a given folder.
|
|
1043
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1051
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-restricted-paths.md
|
|
1044
1052
|
*/
|
|
1045
1053
|
'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>;
|
|
1046
1054
|
/**
|
|
1047
1055
|
* Forbid a module from importing itself.
|
|
1048
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1056
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-self-import.md
|
|
1049
1057
|
*/
|
|
1050
1058
|
'import/no-self-import'?: Linter.RuleEntry<[]>;
|
|
1051
1059
|
/**
|
|
1052
1060
|
* Forbid unassigned imports.
|
|
1053
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1061
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-unassigned-import.md
|
|
1054
1062
|
*/
|
|
1055
1063
|
'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>;
|
|
1056
1064
|
/**
|
|
1057
1065
|
* Ensure imports point to a file/module that can be resolved.
|
|
1058
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1066
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-unresolved.md
|
|
1059
1067
|
*/
|
|
1060
1068
|
'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>;
|
|
1061
1069
|
/**
|
|
1062
1070
|
* Forbid modules without exports, or exports without matching import in another module.
|
|
1063
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1071
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-unused-modules.md
|
|
1064
1072
|
*/
|
|
1065
1073
|
'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>;
|
|
1066
1074
|
/**
|
|
1067
1075
|
* Forbid unnecessary path segments in import and require statements.
|
|
1068
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1076
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-useless-path-segments.md
|
|
1069
1077
|
*/
|
|
1070
1078
|
'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>;
|
|
1071
1079
|
/**
|
|
1072
1080
|
* Forbid webpack loader syntax in imports.
|
|
1073
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1081
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/no-webpack-loader-syntax.md
|
|
1074
1082
|
*/
|
|
1075
1083
|
'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>;
|
|
1076
1084
|
/**
|
|
1077
1085
|
* Enforce a convention in module import order.
|
|
1078
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1086
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/order.md
|
|
1079
1087
|
*/
|
|
1080
1088
|
'import/order'?: Linter.RuleEntry<ImportOrder>;
|
|
1081
1089
|
/**
|
|
1082
1090
|
* Prefer a default export if module exports a single name or multiple names.
|
|
1083
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1091
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/prefer-default-export.md
|
|
1084
1092
|
*/
|
|
1085
1093
|
'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>;
|
|
1086
1094
|
/**
|
|
1087
1095
|
* Enforce using namespace imports for specific modules, like `react`/`react-dom`, etc.
|
|
1088
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1096
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/prefer-namespace-import.md
|
|
1089
1097
|
*/
|
|
1090
1098
|
'import/prefer-namespace-import'?: Linter.RuleEntry<ImportPreferNamespaceImport>;
|
|
1091
1099
|
/**
|
|
1092
1100
|
* Forbid potentially ambiguous parse goal (`script` vs. `module`).
|
|
1093
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.
|
|
1101
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.0/docs/rules/unambiguous.md
|
|
1094
1102
|
*/
|
|
1095
1103
|
'import/unambiguous'?: Linter.RuleEntry<[]>;
|
|
1096
1104
|
/**
|
|
@@ -5745,918 +5753,1620 @@ interface RuleOptions {
|
|
|
5745
5753
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
5746
5754
|
/**
|
|
5747
5755
|
* Prefer better DOM traversal APIs.
|
|
5748
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5756
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/better-dom-traversing.md
|
|
5749
5757
|
*/
|
|
5750
5758
|
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>;
|
|
5751
5759
|
/**
|
|
5752
5760
|
* Removed. Prefer `eslint-plugin-regexp`
|
|
5753
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5761
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#better-regex
|
|
5754
5762
|
* @deprecated
|
|
5755
5763
|
*/
|
|
5756
5764
|
'unicorn/better-regex'?: Linter.RuleEntry<[]>;
|
|
5757
5765
|
/**
|
|
5758
5766
|
* Enforce a specific parameter name in catch clauses.
|
|
5759
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5767
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/catch-error-name.md
|
|
5760
5768
|
*/
|
|
5761
5769
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
5770
|
+
/**
|
|
5771
|
+
* Enforce consistent class references in static methods.
|
|
5772
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/class-reference-in-static-methods.md
|
|
5773
|
+
*/
|
|
5774
|
+
'unicorn/class-reference-in-static-methods'?: Linter.RuleEntry<UnicornClassReferenceInStaticMethods>;
|
|
5775
|
+
/**
|
|
5776
|
+
* Enforce better comment content.
|
|
5777
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/comment-content.md
|
|
5778
|
+
*/
|
|
5779
|
+
'unicorn/comment-content'?: Linter.RuleEntry<UnicornCommentContent>;
|
|
5762
5780
|
/**
|
|
5763
5781
|
* Enforce consistent assertion style with `node:assert`.
|
|
5764
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5782
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-assert.md
|
|
5765
5783
|
*/
|
|
5766
5784
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
5785
|
+
/**
|
|
5786
|
+
* Enforce consistent naming for boolean names.
|
|
5787
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-boolean-name.md
|
|
5788
|
+
*/
|
|
5789
|
+
'unicorn/consistent-boolean-name'?: Linter.RuleEntry<UnicornConsistentBooleanName>;
|
|
5790
|
+
/**
|
|
5791
|
+
* Enforce consistent class member order.
|
|
5792
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-class-member-order.md
|
|
5793
|
+
*/
|
|
5794
|
+
'unicorn/consistent-class-member-order'?: Linter.RuleEntry<UnicornConsistentClassMemberOrder>;
|
|
5767
5795
|
/**
|
|
5768
5796
|
* Enforce consistent spelling of compound words in identifiers.
|
|
5769
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5797
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-compound-words.md
|
|
5770
5798
|
*/
|
|
5771
5799
|
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>;
|
|
5800
|
+
/**
|
|
5801
|
+
* Enforce consistent conditional object spread style.
|
|
5802
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-conditional-object-spread.md
|
|
5803
|
+
*/
|
|
5804
|
+
'unicorn/consistent-conditional-object-spread'?: Linter.RuleEntry<UnicornConsistentConditionalObjectSpread>;
|
|
5772
5805
|
/**
|
|
5773
5806
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
5774
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5807
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-date-clone.md
|
|
5775
5808
|
*/
|
|
5776
5809
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
5777
5810
|
/**
|
|
5778
5811
|
* Use destructured variables over properties.
|
|
5779
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5812
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-destructuring.md
|
|
5780
5813
|
*/
|
|
5781
5814
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
5782
5815
|
/**
|
|
5783
5816
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
5784
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5817
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-empty-array-spread.md
|
|
5785
5818
|
*/
|
|
5786
5819
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
5787
5820
|
/**
|
|
5788
5821
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
5789
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5822
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-existence-index-check.md
|
|
5790
5823
|
*/
|
|
5791
5824
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
5825
|
+
/**
|
|
5826
|
+
* Enforce consistent decorator position on exported classes.
|
|
5827
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-export-decorator-position.md
|
|
5828
|
+
*/
|
|
5829
|
+
'unicorn/consistent-export-decorator-position'?: Linter.RuleEntry<UnicornConsistentExportDecoratorPosition>;
|
|
5792
5830
|
/**
|
|
5793
5831
|
* Move function definitions to the highest possible scope.
|
|
5794
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5832
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-function-scoping.md
|
|
5795
5833
|
*/
|
|
5796
5834
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
5835
|
+
/**
|
|
5836
|
+
* Enforce function syntax by role.
|
|
5837
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-function-style.md
|
|
5838
|
+
*/
|
|
5839
|
+
'unicorn/consistent-function-style'?: Linter.RuleEntry<UnicornConsistentFunctionStyle>;
|
|
5797
5840
|
/**
|
|
5798
5841
|
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
5799
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5842
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-json-file-read.md
|
|
5800
5843
|
*/
|
|
5801
5844
|
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>;
|
|
5845
|
+
/**
|
|
5846
|
+
* Enforce consistent optional chaining for same-base member access.
|
|
5847
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-optional-chaining.md
|
|
5848
|
+
*/
|
|
5849
|
+
'unicorn/consistent-optional-chaining'?: Linter.RuleEntry<[]>;
|
|
5802
5850
|
/**
|
|
5803
5851
|
* Enforce consistent style for escaping `${` in template literals.
|
|
5804
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5852
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-template-literal-escape.md
|
|
5805
5853
|
*/
|
|
5806
5854
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>;
|
|
5855
|
+
/**
|
|
5856
|
+
* Enforce consistent labels on tuple type elements.
|
|
5857
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-tuple-labels.md
|
|
5858
|
+
*/
|
|
5859
|
+
'unicorn/consistent-tuple-labels'?: Linter.RuleEntry<[]>;
|
|
5807
5860
|
/**
|
|
5808
5861
|
* Enforce correct `Error` subclassing.
|
|
5809
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5862
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/custom-error-definition.md
|
|
5810
5863
|
*/
|
|
5811
5864
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
5865
|
+
/**
|
|
5866
|
+
* Enforce consistent default export declarations.
|
|
5867
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/default-export-style.md
|
|
5868
|
+
*/
|
|
5869
|
+
'unicorn/default-export-style'?: Linter.RuleEntry<UnicornDefaultExportStyle>;
|
|
5812
5870
|
/**
|
|
5813
5871
|
* Enforce consistent style for DOM element dataset access.
|
|
5814
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5872
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/dom-node-dataset.md
|
|
5815
5873
|
*/
|
|
5816
5874
|
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>;
|
|
5817
5875
|
/**
|
|
5818
5876
|
* Enforce no spaces between braces.
|
|
5819
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5877
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/empty-brace-spaces.md
|
|
5820
5878
|
*/
|
|
5821
5879
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
5822
5880
|
/**
|
|
5823
5881
|
* Enforce passing a `message` value when creating a built-in error.
|
|
5824
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5882
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/error-message.md
|
|
5825
5883
|
*/
|
|
5826
5884
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
5827
5885
|
/**
|
|
5828
5886
|
* Require escape sequences to use uppercase or lowercase values.
|
|
5829
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5887
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/escape-case.md
|
|
5830
5888
|
*/
|
|
5831
5889
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
5832
5890
|
/**
|
|
5833
5891
|
* Add expiration conditions to TODO comments.
|
|
5834
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5892
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/expiring-todo-comments.md
|
|
5835
5893
|
*/
|
|
5836
5894
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
5837
5895
|
/**
|
|
5838
5896
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
5839
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5897
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/explicit-length-check.md
|
|
5840
5898
|
*/
|
|
5841
5899
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
5900
|
+
/**
|
|
5901
|
+
* Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.
|
|
5902
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/explicit-timer-delay.md
|
|
5903
|
+
*/
|
|
5904
|
+
'unicorn/explicit-timer-delay'?: Linter.RuleEntry<UnicornExplicitTimerDelay>;
|
|
5842
5905
|
/**
|
|
5843
5906
|
* Enforce a case style for filenames and directory names.
|
|
5844
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5907
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/filename-case.md
|
|
5845
5908
|
*/
|
|
5846
5909
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
5910
|
+
/**
|
|
5911
|
+
* Require identifiers to match a specified regular expression.
|
|
5912
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/id-match.md
|
|
5913
|
+
*/
|
|
5914
|
+
'unicorn/id-match'?: Linter.RuleEntry<UnicornIdMatch>;
|
|
5847
5915
|
/**
|
|
5848
5916
|
* Enforce specific import styles per module.
|
|
5849
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5917
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/import-style.md
|
|
5850
5918
|
*/
|
|
5851
5919
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
5852
5920
|
/**
|
|
5853
5921
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
5854
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5922
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/isolated-functions.md
|
|
5855
5923
|
*/
|
|
5856
5924
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>;
|
|
5857
5925
|
/**
|
|
5858
|
-
*
|
|
5859
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5926
|
+
* Require or disallow logical assignment operator shorthand
|
|
5927
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/logical-assignment-operators.md
|
|
5928
|
+
*/
|
|
5929
|
+
'unicorn/logical-assignment-operators'?: Linter.RuleEntry<UnicornLogicalAssignmentOperators>;
|
|
5930
|
+
/**
|
|
5931
|
+
* Limit the depth of nested calls.
|
|
5932
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/max-nested-calls.md
|
|
5933
|
+
*/
|
|
5934
|
+
'unicorn/max-nested-calls'?: Linter.RuleEntry<UnicornMaxNestedCalls>;
|
|
5935
|
+
/**
|
|
5936
|
+
* Enforce replacements for variable, property, and filenames.
|
|
5937
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/name-replacements.md
|
|
5938
|
+
*/
|
|
5939
|
+
'unicorn/name-replacements'?: Linter.RuleEntry<UnicornNameReplacements>;
|
|
5940
|
+
/**
|
|
5941
|
+
* Enforce correct use of `new` for builtin constructors.
|
|
5942
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/new-for-builtins.md
|
|
5860
5943
|
*/
|
|
5861
5944
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
5862
5945
|
/**
|
|
5863
5946
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
5864
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5947
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
5865
5948
|
*/
|
|
5866
5949
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
5867
5950
|
/**
|
|
5868
5951
|
* Disallow recursive access to `this` within getters and setters.
|
|
5869
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5952
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-accessor-recursion.md
|
|
5870
5953
|
*/
|
|
5871
5954
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
5955
|
+
/**
|
|
5956
|
+
* Disallow bitwise operators where a logical operator was likely intended.
|
|
5957
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-accidental-bitwise-operator.md
|
|
5958
|
+
*/
|
|
5959
|
+
'unicorn/no-accidental-bitwise-operator'?: Linter.RuleEntry<[]>;
|
|
5872
5960
|
/**
|
|
5873
5961
|
* Disallow anonymous functions and classes as the default export.
|
|
5874
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5962
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-anonymous-default-export.md
|
|
5875
5963
|
*/
|
|
5876
5964
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
5877
5965
|
/**
|
|
5878
5966
|
* Prevent passing a function reference directly to iterator methods.
|
|
5879
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5967
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-callback-reference.md
|
|
5880
5968
|
*/
|
|
5881
5969
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>;
|
|
5882
5970
|
/**
|
|
5883
|
-
* Disallow
|
|
5884
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5971
|
+
* Disallow array accumulation with `Array#concat()` in loops.
|
|
5972
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-concat-in-loop.md
|
|
5885
5973
|
*/
|
|
5886
|
-
'unicorn/no-array-
|
|
5974
|
+
'unicorn/no-array-concat-in-loop'?: Linter.RuleEntry<[]>;
|
|
5887
5975
|
/**
|
|
5888
|
-
*
|
|
5889
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5976
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
5977
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-fill-with-reference-type.md
|
|
5890
5978
|
*/
|
|
5891
|
-
'unicorn/no-array-
|
|
5979
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>;
|
|
5892
5980
|
/**
|
|
5893
5981
|
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
5894
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5982
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-from-fill.md
|
|
5895
5983
|
*/
|
|
5896
5984
|
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>;
|
|
5985
|
+
/**
|
|
5986
|
+
* Disallow front-of-array mutation.
|
|
5987
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-front-mutation.md
|
|
5988
|
+
*/
|
|
5989
|
+
'unicorn/no-array-front-mutation'?: Linter.RuleEntry<[]>;
|
|
5897
5990
|
/**
|
|
5898
5991
|
* Disallow using the `this` argument in array methods.
|
|
5899
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5992
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-method-this-argument.md
|
|
5900
5993
|
*/
|
|
5901
5994
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
5902
5995
|
/**
|
|
5903
5996
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
5904
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5997
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
5905
5998
|
* @deprecated
|
|
5906
5999
|
*/
|
|
5907
6000
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
5908
6001
|
/**
|
|
5909
6002
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
5910
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6003
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-reduce.md
|
|
5911
6004
|
*/
|
|
5912
6005
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
5913
6006
|
/**
|
|
5914
6007
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
5915
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6008
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-reverse.md
|
|
5916
6009
|
*/
|
|
5917
6010
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
5918
6011
|
/**
|
|
5919
6012
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
5920
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6013
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-sort.md
|
|
5921
6014
|
*/
|
|
5922
6015
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
6016
|
+
/**
|
|
6017
|
+
* Disallow sorting arrays to get the minimum or maximum value.
|
|
6018
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-sort-for-min-max.md
|
|
6019
|
+
*/
|
|
6020
|
+
'unicorn/no-array-sort-for-min-max'?: Linter.RuleEntry<[]>;
|
|
6021
|
+
/**
|
|
6022
|
+
* Prefer `Array#toSpliced()` over `Array#splice()`.
|
|
6023
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-splice.md
|
|
6024
|
+
*/
|
|
6025
|
+
'unicorn/no-array-splice'?: Linter.RuleEntry<[]>;
|
|
6026
|
+
/**
|
|
6027
|
+
* Disallow asterisk prefixes in documentation comments.
|
|
6028
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-asterisk-prefix-in-documentation-comments.md
|
|
6029
|
+
*/
|
|
6030
|
+
'unicorn/no-asterisk-prefix-in-documentation-comments'?: Linter.RuleEntry<[]>;
|
|
5923
6031
|
/**
|
|
5924
6032
|
* Disallow member access from await expression.
|
|
5925
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6033
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-await-expression-member.md
|
|
5926
6034
|
*/
|
|
5927
6035
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
5928
6036
|
/**
|
|
5929
6037
|
* Disallow using `await` in `Promise` method parameters.
|
|
5930
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6038
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-await-in-promise-methods.md
|
|
5931
6039
|
*/
|
|
5932
6040
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5933
6041
|
/**
|
|
5934
6042
|
* Disallow unnecessary `Blob` to `File` conversion.
|
|
5935
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6043
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-blob-to-file.md
|
|
5936
6044
|
*/
|
|
5937
6045
|
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>;
|
|
6046
|
+
/**
|
|
6047
|
+
* Disallow boolean-returning sort comparators.
|
|
6048
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-boolean-sort-comparator.md
|
|
6049
|
+
*/
|
|
6050
|
+
'unicorn/no-boolean-sort-comparator'?: Linter.RuleEntry<[]>;
|
|
6051
|
+
/**
|
|
6052
|
+
* Disallow `break` and `continue` in nested loops and switches inside loops.
|
|
6053
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-break-in-nested-loop.md
|
|
6054
|
+
*/
|
|
6055
|
+
'unicorn/no-break-in-nested-loop'?: Linter.RuleEntry<[]>;
|
|
5938
6056
|
/**
|
|
5939
6057
|
* Prefer drawing canvases directly instead of converting them to images.
|
|
5940
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6058
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-canvas-to-image.md
|
|
5941
6059
|
*/
|
|
5942
6060
|
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>;
|
|
6061
|
+
/**
|
|
6062
|
+
* Disallow chained comparisons such as `a < b < c`.
|
|
6063
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-chained-comparison.md
|
|
6064
|
+
*/
|
|
6065
|
+
'unicorn/no-chained-comparison'?: Linter.RuleEntry<[]>;
|
|
6066
|
+
/**
|
|
6067
|
+
* Disallow accessing `Map`, `Set`, `WeakMap`, and `WeakSet` entries with bracket notation.
|
|
6068
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-collection-bracket-access.md
|
|
6069
|
+
*/
|
|
6070
|
+
'unicorn/no-collection-bracket-access'?: Linter.RuleEntry<[]>;
|
|
6071
|
+
/**
|
|
6072
|
+
* Disallow dynamic object property existence checks.
|
|
6073
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-computed-property-existence-check.md
|
|
6074
|
+
*/
|
|
6075
|
+
'unicorn/no-computed-property-existence-check'?: Linter.RuleEntry<[]>;
|
|
5943
6076
|
/**
|
|
5944
6077
|
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
5945
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6078
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-confusing-array-splice.md
|
|
5946
6079
|
*/
|
|
5947
6080
|
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>;
|
|
6081
|
+
/**
|
|
6082
|
+
* Disallow confusing uses of `Array#with()`.
|
|
6083
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-confusing-array-with.md
|
|
6084
|
+
*/
|
|
6085
|
+
'unicorn/no-confusing-array-with'?: Linter.RuleEntry<[]>;
|
|
5948
6086
|
/**
|
|
5949
6087
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
5950
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6088
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-console-spaces.md
|
|
5951
6089
|
*/
|
|
5952
6090
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
6091
|
+
/**
|
|
6092
|
+
* Disallow arithmetic and bitwise operations that always evaluate to `0`.
|
|
6093
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-constant-zero-expression.md
|
|
6094
|
+
*/
|
|
6095
|
+
'unicorn/no-constant-zero-expression'?: Linter.RuleEntry<[]>;
|
|
6096
|
+
/**
|
|
6097
|
+
* Disallow declarations before conditional early exits when they are only used after the exit.
|
|
6098
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-declarations-before-early-exit.md
|
|
6099
|
+
*/
|
|
6100
|
+
'unicorn/no-declarations-before-early-exit'?: Linter.RuleEntry<[]>;
|
|
5953
6101
|
/**
|
|
5954
6102
|
* Do not use `document.cookie` directly.
|
|
5955
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6103
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-document-cookie.md
|
|
5956
6104
|
*/
|
|
5957
6105
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
6106
|
+
/**
|
|
6107
|
+
* Disallow two comparisons of the same operands that can be combined into one.
|
|
6108
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-double-comparison.md
|
|
6109
|
+
*/
|
|
6110
|
+
'unicorn/no-double-comparison'?: Linter.RuleEntry<[]>;
|
|
6111
|
+
/**
|
|
6112
|
+
* Disallow duplicate adjacent branches in if chains.
|
|
6113
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-if-branches.md
|
|
6114
|
+
*/
|
|
6115
|
+
'unicorn/no-duplicate-if-branches'?: Linter.RuleEntry<[]>;
|
|
6116
|
+
/**
|
|
6117
|
+
* Disallow adjacent duplicate operands in logical expressions.
|
|
6118
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-logical-operands.md
|
|
6119
|
+
*/
|
|
6120
|
+
'unicorn/no-duplicate-logical-operands'?: Linter.RuleEntry<[]>;
|
|
6121
|
+
/**
|
|
6122
|
+
* Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.
|
|
6123
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-loops.md
|
|
6124
|
+
*/
|
|
6125
|
+
'unicorn/no-duplicate-loops'?: Linter.RuleEntry<[]>;
|
|
5958
6126
|
/**
|
|
5959
6127
|
* Disallow duplicate values in `Set` constructor array literals.
|
|
5960
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6128
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-set-values.md
|
|
5961
6129
|
*/
|
|
5962
6130
|
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>;
|
|
5963
6131
|
/**
|
|
5964
6132
|
* Disallow empty files.
|
|
5965
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6133
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-empty-file.md
|
|
5966
6134
|
*/
|
|
5967
6135
|
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>;
|
|
6136
|
+
/**
|
|
6137
|
+
* Disallow assigning to built-in error properties.
|
|
6138
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-error-property-assignment.md
|
|
6139
|
+
*/
|
|
6140
|
+
'unicorn/no-error-property-assignment'?: Linter.RuleEntry<[]>;
|
|
5968
6141
|
/**
|
|
5969
6142
|
* Disallow exports in scripts.
|
|
5970
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6143
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-exports-in-scripts.md
|
|
5971
6144
|
*/
|
|
5972
6145
|
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>;
|
|
6146
|
+
/**
|
|
6147
|
+
* Prefer `for…of` over the `forEach` method.
|
|
6148
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-for-each.md
|
|
6149
|
+
*/
|
|
6150
|
+
'unicorn/no-for-each'?: Linter.RuleEntry<[]>;
|
|
5973
6151
|
/**
|
|
5974
6152
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
5975
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6153
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-for-loop.md
|
|
5976
6154
|
*/
|
|
5977
6155
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
5978
6156
|
/**
|
|
5979
|
-
*
|
|
5980
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6157
|
+
* Disallow assigning properties on the global object.
|
|
6158
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-global-object-property-assignment.md
|
|
6159
|
+
*/
|
|
6160
|
+
'unicorn/no-global-object-property-assignment'?: Linter.RuleEntry<[]>;
|
|
6161
|
+
/**
|
|
6162
|
+
* Replaced by `unicorn/prefer-unicode-code-point-escapes` which covers more cases.
|
|
6163
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-hex-escape
|
|
6164
|
+
* @deprecated
|
|
5981
6165
|
*/
|
|
5982
6166
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
5983
6167
|
/**
|
|
5984
6168
|
* Disallow immediate mutation after variable assignment.
|
|
5985
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6169
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-immediate-mutation.md
|
|
5986
6170
|
*/
|
|
5987
6171
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
6172
|
+
/**
|
|
6173
|
+
* Disallow impossible comparisons against `.length` or `.size`.
|
|
6174
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-impossible-length-comparison.md
|
|
6175
|
+
*/
|
|
6176
|
+
'unicorn/no-impossible-length-comparison'?: Linter.RuleEntry<[]>;
|
|
5988
6177
|
/**
|
|
5989
6178
|
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
5990
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6179
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-incorrect-query-selector.md
|
|
5991
6180
|
*/
|
|
5992
6181
|
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>;
|
|
6182
|
+
/**
|
|
6183
|
+
* Disallow incorrect template literal interpolation syntax.
|
|
6184
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-incorrect-template-string-interpolation.md
|
|
6185
|
+
*/
|
|
6186
|
+
'unicorn/no-incorrect-template-string-interpolation'?: Linter.RuleEntry<[]>;
|
|
5993
6187
|
/**
|
|
5994
6188
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
5995
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6189
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
5996
6190
|
* @deprecated
|
|
5997
6191
|
*/
|
|
5998
6192
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
5999
6193
|
/**
|
|
6000
6194
|
* Disallow `instanceof` with built-in objects
|
|
6001
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6195
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-instanceof-builtins.md
|
|
6002
6196
|
*/
|
|
6003
6197
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
6198
|
+
/**
|
|
6199
|
+
* Disallow calling functions and constructors with an invalid number of arguments.
|
|
6200
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-argument-count.md
|
|
6201
|
+
*/
|
|
6202
|
+
'unicorn/no-invalid-argument-count'?: Linter.RuleEntry<UnicornNoInvalidArgumentCount>;
|
|
6203
|
+
/**
|
|
6204
|
+
* Disallow comparing a single character from a string to a multi-character string.
|
|
6205
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-character-comparison.md
|
|
6206
|
+
*/
|
|
6207
|
+
'unicorn/no-invalid-character-comparison'?: Linter.RuleEntry<[]>;
|
|
6004
6208
|
/**
|
|
6005
6209
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
6006
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6210
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-fetch-options.md
|
|
6007
6211
|
*/
|
|
6008
6212
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
6009
6213
|
/**
|
|
6010
6214
|
* Disallow invalid `accept` values on file inputs.
|
|
6011
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6215
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-file-input-accept.md
|
|
6012
6216
|
*/
|
|
6013
6217
|
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>;
|
|
6014
6218
|
/**
|
|
6015
6219
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
6016
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6220
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
6017
6221
|
*/
|
|
6018
6222
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
6223
|
+
/**
|
|
6224
|
+
* Disallow invalid implementations of well-known symbol methods.
|
|
6225
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-well-known-symbol-methods.md
|
|
6226
|
+
*/
|
|
6227
|
+
'unicorn/no-invalid-well-known-symbol-methods'?: Linter.RuleEntry<[]>;
|
|
6019
6228
|
/**
|
|
6020
6229
|
* Disallow identifiers starting with `new` or `class`.
|
|
6021
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6230
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-keyword-prefix.md
|
|
6022
6231
|
*/
|
|
6023
6232
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
6024
6233
|
/**
|
|
6025
6234
|
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
6026
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6235
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-late-current-target-access.md
|
|
6027
6236
|
*/
|
|
6028
6237
|
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>;
|
|
6238
|
+
/**
|
|
6239
|
+
* Disallow event-control method calls after the synchronous event dispatch has finished.
|
|
6240
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-late-event-control.md
|
|
6241
|
+
*/
|
|
6242
|
+
'unicorn/no-late-event-control'?: Linter.RuleEntry<[]>;
|
|
6029
6243
|
/**
|
|
6030
6244
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
6031
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6245
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
6032
6246
|
* @deprecated
|
|
6033
6247
|
*/
|
|
6034
6248
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
6035
6249
|
/**
|
|
6036
6250
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
6037
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6251
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-lonely-if.md
|
|
6038
6252
|
*/
|
|
6039
6253
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
6254
|
+
/**
|
|
6255
|
+
* Disallow mutating a loop iterable during iteration.
|
|
6256
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-loop-iterable-mutation.md
|
|
6257
|
+
*/
|
|
6258
|
+
'unicorn/no-loop-iterable-mutation'?: Linter.RuleEntry<[]>;
|
|
6040
6259
|
/**
|
|
6041
6260
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
6042
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6261
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
6043
6262
|
*/
|
|
6044
6263
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6045
6264
|
/**
|
|
6046
6265
|
* Disallow manually wrapped comments.
|
|
6047
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6266
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-manually-wrapped-comments.md
|
|
6048
6267
|
*/
|
|
6049
6268
|
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>;
|
|
6269
|
+
/**
|
|
6270
|
+
* Disallow checking a Map key before accessing a different key.
|
|
6271
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-mismatched-map-key.md
|
|
6272
|
+
*/
|
|
6273
|
+
'unicorn/no-mismatched-map-key'?: Linter.RuleEntry<[]>;
|
|
6274
|
+
/**
|
|
6275
|
+
* Disallow misrefactored compound assignments where the target is duplicated in the right-hand side.
|
|
6276
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-misrefactored-assignment.md
|
|
6277
|
+
*/
|
|
6278
|
+
'unicorn/no-misrefactored-assignment'?: Linter.RuleEntry<[]>;
|
|
6050
6279
|
/**
|
|
6051
6280
|
* Disallow named usage of default import and export.
|
|
6052
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6281
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-named-default.md
|
|
6053
6282
|
*/
|
|
6054
6283
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
6284
|
+
/**
|
|
6285
|
+
* Disallow negated array predicate calls.
|
|
6286
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negated-array-predicate.md
|
|
6287
|
+
*/
|
|
6288
|
+
'unicorn/no-negated-array-predicate'?: Linter.RuleEntry<[]>;
|
|
6289
|
+
/**
|
|
6290
|
+
* Disallow negated comparisons.
|
|
6291
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negated-comparison.md
|
|
6292
|
+
*/
|
|
6293
|
+
'unicorn/no-negated-comparison'?: Linter.RuleEntry<UnicornNoNegatedComparison>;
|
|
6055
6294
|
/**
|
|
6056
6295
|
* Disallow negated conditions.
|
|
6057
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6296
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negated-condition.md
|
|
6058
6297
|
*/
|
|
6059
6298
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
6060
6299
|
/**
|
|
6061
6300
|
* Disallow negated expression in equality check.
|
|
6062
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6301
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negation-in-equality-check.md
|
|
6063
6302
|
*/
|
|
6064
6303
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
6065
6304
|
/**
|
|
6066
6305
|
* Disallow nested ternary expressions.
|
|
6067
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6306
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-nested-ternary.md
|
|
6068
6307
|
*/
|
|
6069
6308
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6070
6309
|
/**
|
|
6071
6310
|
* Disallow `new Array()`.
|
|
6072
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6311
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-new-array.md
|
|
6073
6312
|
*/
|
|
6074
6313
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
6075
6314
|
/**
|
|
6076
6315
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
6077
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6316
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-new-buffer.md
|
|
6078
6317
|
*/
|
|
6079
6318
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
6319
|
+
/**
|
|
6320
|
+
* Disallow non-function values with function-style verb prefixes.
|
|
6321
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-non-function-verb-prefix.md
|
|
6322
|
+
*/
|
|
6323
|
+
'unicorn/no-non-function-verb-prefix'?: Linter.RuleEntry<UnicornNoNonFunctionVerbPrefix>;
|
|
6324
|
+
/**
|
|
6325
|
+
* Disallow non-standard properties on built-in objects.
|
|
6326
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-nonstandard-builtin-properties.md
|
|
6327
|
+
*/
|
|
6328
|
+
'unicorn/no-nonstandard-builtin-properties'?: Linter.RuleEntry<[]>;
|
|
6080
6329
|
/**
|
|
6081
6330
|
* Disallow the use of the `null` literal.
|
|
6082
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6331
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-null.md
|
|
6083
6332
|
*/
|
|
6084
6333
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
6085
6334
|
/**
|
|
6086
6335
|
* Disallow the use of objects as default parameters.
|
|
6087
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6336
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-object-as-default-parameter.md
|
|
6088
6337
|
*/
|
|
6089
6338
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
6339
|
+
/**
|
|
6340
|
+
* Disallow `Object` methods with `Map` or `Set`.
|
|
6341
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-object-methods-with-collections.md
|
|
6342
|
+
*/
|
|
6343
|
+
'unicorn/no-object-methods-with-collections'?: Linter.RuleEntry<[]>;
|
|
6344
|
+
/**
|
|
6345
|
+
* Disallow optional chaining on undeclared variables.
|
|
6346
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-optional-chaining-on-undeclared-variable.md
|
|
6347
|
+
*/
|
|
6348
|
+
'unicorn/no-optional-chaining-on-undeclared-variable'?: Linter.RuleEntry<[]>;
|
|
6090
6349
|
/**
|
|
6091
6350
|
* Disallow `process.exit()`.
|
|
6092
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6351
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-process-exit.md
|
|
6093
6352
|
*/
|
|
6094
6353
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
6354
|
+
/**
|
|
6355
|
+
* Disallow comparisons made redundant by an equality check in the same logical AND.
|
|
6356
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-redundant-comparison.md
|
|
6357
|
+
*/
|
|
6358
|
+
'unicorn/no-redundant-comparison'?: Linter.RuleEntry<[]>;
|
|
6359
|
+
/**
|
|
6360
|
+
* Disallow using the return value of `Array#push()` and `Array#unshift()`.
|
|
6361
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-return-array-push.md
|
|
6362
|
+
*/
|
|
6363
|
+
'unicorn/no-return-array-push'?: Linter.RuleEntry<[]>;
|
|
6364
|
+
/**
|
|
6365
|
+
* Disallow selector syntax in DOM names.
|
|
6366
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-selector-as-dom-name.md
|
|
6367
|
+
*/
|
|
6368
|
+
'unicorn/no-selector-as-dom-name'?: Linter.RuleEntry<[]>;
|
|
6095
6369
|
/**
|
|
6096
6370
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
6097
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6371
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
6098
6372
|
*/
|
|
6099
6373
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6100
6374
|
/**
|
|
6101
6375
|
* Disallow classes that only have static members.
|
|
6102
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6376
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-static-only-class.md
|
|
6103
6377
|
*/
|
|
6104
6378
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
6379
|
+
/**
|
|
6380
|
+
* Prefer comparing values directly over subtracting and comparing to `0`.
|
|
6381
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-subtraction-comparison.md
|
|
6382
|
+
*/
|
|
6383
|
+
'unicorn/no-subtraction-comparison'?: Linter.RuleEntry<[]>;
|
|
6105
6384
|
/**
|
|
6106
6385
|
* Disallow `then` property.
|
|
6107
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6386
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-thenable.md
|
|
6108
6387
|
*/
|
|
6109
6388
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
6110
6389
|
/**
|
|
6111
6390
|
* Disallow assigning `this` to a variable.
|
|
6112
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6391
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-this-assignment.md
|
|
6113
6392
|
*/
|
|
6114
6393
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
6115
6394
|
/**
|
|
6116
6395
|
* Disallow `this` outside of classes.
|
|
6117
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6396
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-this-outside-of-class.md
|
|
6118
6397
|
*/
|
|
6119
6398
|
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>;
|
|
6399
|
+
/**
|
|
6400
|
+
* Disallow assigning to top-level variables from inside functions.
|
|
6401
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-top-level-assignment-in-function.md
|
|
6402
|
+
*/
|
|
6403
|
+
'unicorn/no-top-level-assignment-in-function'?: Linter.RuleEntry<[]>;
|
|
6404
|
+
/**
|
|
6405
|
+
* Disallow top-level side effects in exported modules.
|
|
6406
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-top-level-side-effects.md
|
|
6407
|
+
*/
|
|
6408
|
+
'unicorn/no-top-level-side-effects'?: Linter.RuleEntry<[]>;
|
|
6120
6409
|
/**
|
|
6121
6410
|
* Disallow comparing `undefined` using `typeof`.
|
|
6122
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6411
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-typeof-undefined.md
|
|
6123
6412
|
*/
|
|
6124
6413
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
6414
|
+
/**
|
|
6415
|
+
* Disallow referencing methods without calling them.
|
|
6416
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-uncalled-method.md
|
|
6417
|
+
*/
|
|
6418
|
+
'unicorn/no-uncalled-method'?: Linter.RuleEntry<[]>;
|
|
6419
|
+
/**
|
|
6420
|
+
* Require class members to be declared.
|
|
6421
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-undeclared-class-members.md
|
|
6422
|
+
*/
|
|
6423
|
+
'unicorn/no-undeclared-class-members'?: Linter.RuleEntry<[]>;
|
|
6125
6424
|
/**
|
|
6126
6425
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
6127
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6426
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
6128
6427
|
*/
|
|
6129
6428
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6130
6429
|
/**
|
|
6131
6430
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
6132
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6431
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
6133
6432
|
*/
|
|
6134
6433
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
6135
6434
|
/**
|
|
6136
6435
|
* Disallow awaiting non-promise values.
|
|
6137
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6436
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-await.md
|
|
6138
6437
|
*/
|
|
6139
6438
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
6439
|
+
/**
|
|
6440
|
+
* Disallow unnecessary comparisons against boolean literals.
|
|
6441
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-boolean-comparison.md
|
|
6442
|
+
*/
|
|
6443
|
+
'unicorn/no-unnecessary-boolean-comparison'?: Linter.RuleEntry<[]>;
|
|
6444
|
+
/**
|
|
6445
|
+
* Disallow unnecessary `globalThis` references.
|
|
6446
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-global-this.md
|
|
6447
|
+
*/
|
|
6448
|
+
'unicorn/no-unnecessary-global-this'?: Linter.RuleEntry<[]>;
|
|
6140
6449
|
/**
|
|
6141
6450
|
* Disallow unnecessary nested ternary expressions.
|
|
6142
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6451
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-nested-ternary.md
|
|
6143
6452
|
*/
|
|
6144
6453
|
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6145
6454
|
/**
|
|
6146
6455
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
6147
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6456
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
6148
6457
|
*/
|
|
6149
6458
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
6150
6459
|
/**
|
|
6151
6460
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
6152
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6461
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
6153
6462
|
*/
|
|
6154
6463
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
6464
|
+
/**
|
|
6465
|
+
* Disallow `Array#splice()` when simpler alternatives exist.
|
|
6466
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-splice.md
|
|
6467
|
+
*/
|
|
6468
|
+
'unicorn/no-unnecessary-splice'?: Linter.RuleEntry<[]>;
|
|
6155
6469
|
/**
|
|
6156
6470
|
* Disallow unreadable array destructuring.
|
|
6157
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6471
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
6158
6472
|
*/
|
|
6159
|
-
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<
|
|
6473
|
+
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<UnicornNoUnreadableArrayDestructuring>;
|
|
6474
|
+
/**
|
|
6475
|
+
* Disallow unreadable iterable expressions in `for…of` and `for await…of` loop headers.
|
|
6476
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-for-of-expression.md
|
|
6477
|
+
*/
|
|
6478
|
+
'unicorn/no-unreadable-for-of-expression'?: Linter.RuleEntry<[]>;
|
|
6160
6479
|
/**
|
|
6161
6480
|
* Disallow unreadable IIFEs.
|
|
6162
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6481
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-iife.md
|
|
6163
6482
|
*/
|
|
6164
6483
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
6484
|
+
/**
|
|
6485
|
+
* Disallow unreadable `new` expressions.
|
|
6486
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-new-expression.md
|
|
6487
|
+
*/
|
|
6488
|
+
'unicorn/no-unreadable-new-expression'?: Linter.RuleEntry<[]>;
|
|
6489
|
+
/**
|
|
6490
|
+
* Disallow unreadable object destructuring.
|
|
6491
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-object-destructuring.md
|
|
6492
|
+
*/
|
|
6493
|
+
'unicorn/no-unreadable-object-destructuring'?: Linter.RuleEntry<[]>;
|
|
6494
|
+
/**
|
|
6495
|
+
* Prevent unsafe use of ArrayBuffer view `.buffer`.
|
|
6496
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-buffer-conversion.md
|
|
6497
|
+
*/
|
|
6498
|
+
'unicorn/no-unsafe-buffer-conversion'?: Linter.RuleEntry<[]>;
|
|
6499
|
+
/**
|
|
6500
|
+
* Disallow unsafe DOM HTML APIs.
|
|
6501
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-dom-html.md
|
|
6502
|
+
*/
|
|
6503
|
+
'unicorn/no-unsafe-dom-html'?: Linter.RuleEntry<[]>;
|
|
6504
|
+
/**
|
|
6505
|
+
* Disallow unsafe values as property keys.
|
|
6506
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-property-key.md
|
|
6507
|
+
*/
|
|
6508
|
+
'unicorn/no-unsafe-property-key'?: Linter.RuleEntry<[]>;
|
|
6509
|
+
/**
|
|
6510
|
+
* Disallow non-literal replacement values in `String#replace()` and `String#replaceAll()`.
|
|
6511
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-string-replacement.md
|
|
6512
|
+
*/
|
|
6513
|
+
'unicorn/no-unsafe-string-replacement'?: Linter.RuleEntry<[]>;
|
|
6165
6514
|
/**
|
|
6166
6515
|
* Disallow ignoring the return value of selected array methods.
|
|
6167
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6516
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unused-array-method-return.md
|
|
6168
6517
|
*/
|
|
6169
6518
|
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>;
|
|
6170
6519
|
/**
|
|
6171
6520
|
* Disallow unused object properties.
|
|
6172
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6521
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unused-properties.md
|
|
6173
6522
|
*/
|
|
6174
6523
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
6524
|
+
/**
|
|
6525
|
+
* Disallow unnecessary `Boolean()` casts in array predicate callbacks.
|
|
6526
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-boolean-cast.md
|
|
6527
|
+
*/
|
|
6528
|
+
'unicorn/no-useless-boolean-cast'?: Linter.RuleEntry<[]>;
|
|
6529
|
+
/**
|
|
6530
|
+
* Disallow useless type coercions of values that are already of the target type.
|
|
6531
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-coercion.md
|
|
6532
|
+
*/
|
|
6533
|
+
'unicorn/no-useless-coercion'?: Linter.RuleEntry<[]>;
|
|
6175
6534
|
/**
|
|
6176
6535
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
6177
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6536
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-collection-argument.md
|
|
6178
6537
|
*/
|
|
6179
6538
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
6539
|
+
/**
|
|
6540
|
+
* Disallow useless compound assignments such as `x += 0`.
|
|
6541
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-compound-assignment.md
|
|
6542
|
+
*/
|
|
6543
|
+
'unicorn/no-useless-compound-assignment'?: Linter.RuleEntry<[]>;
|
|
6544
|
+
/**
|
|
6545
|
+
* Disallow useless concatenation of literals.
|
|
6546
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-concat.md
|
|
6547
|
+
*/
|
|
6548
|
+
'unicorn/no-useless-concat'?: Linter.RuleEntry<[]>;
|
|
6549
|
+
/**
|
|
6550
|
+
* Disallow useless `continue` statements.
|
|
6551
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-continue.md
|
|
6552
|
+
*/
|
|
6553
|
+
'unicorn/no-useless-continue'?: Linter.RuleEntry<[]>;
|
|
6554
|
+
/**
|
|
6555
|
+
* Disallow unnecessary existence checks before deletion.
|
|
6556
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-delete-check.md
|
|
6557
|
+
*/
|
|
6558
|
+
'unicorn/no-useless-delete-check'?: Linter.RuleEntry<[]>;
|
|
6559
|
+
/**
|
|
6560
|
+
* Disallow `else` after a statement that exits.
|
|
6561
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-else.md
|
|
6562
|
+
*/
|
|
6563
|
+
'unicorn/no-useless-else'?: Linter.RuleEntry<[]>;
|
|
6180
6564
|
/**
|
|
6181
6565
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
6182
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6566
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
6183
6567
|
*/
|
|
6184
6568
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
6185
6569
|
/**
|
|
6186
6570
|
* Disallow useless fallback when spreading in object literals.
|
|
6187
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6571
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
6188
6572
|
*/
|
|
6189
6573
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
6190
6574
|
/**
|
|
6191
6575
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
6192
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6576
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-iterator-to-array.md
|
|
6193
6577
|
*/
|
|
6194
6578
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
6195
6579
|
/**
|
|
6196
6580
|
* Disallow useless array length check.
|
|
6197
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6581
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-length-check.md
|
|
6198
6582
|
*/
|
|
6199
6583
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
6584
|
+
/**
|
|
6585
|
+
* Disallow unnecessary operands in logical expressions involving boolean literals.
|
|
6586
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-logical-operand.md
|
|
6587
|
+
*/
|
|
6588
|
+
'unicorn/no-useless-logical-operand'?: Linter.RuleEntry<[]>;
|
|
6589
|
+
/**
|
|
6590
|
+
* Disallow useless overrides of class methods.
|
|
6591
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-override.md
|
|
6592
|
+
*/
|
|
6593
|
+
'unicorn/no-useless-override'?: Linter.RuleEntry<[]>;
|
|
6200
6594
|
/**
|
|
6201
6595
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
6202
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6596
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
6203
6597
|
*/
|
|
6204
6598
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
6599
|
+
/**
|
|
6600
|
+
* Disallow simple recursive function calls that can be replaced with a loop.
|
|
6601
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-recursion.md
|
|
6602
|
+
*/
|
|
6603
|
+
'unicorn/no-useless-recursion'?: Linter.RuleEntry<[]>;
|
|
6205
6604
|
/**
|
|
6206
6605
|
* Disallow unnecessary spread.
|
|
6207
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6606
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-spread.md
|
|
6208
6607
|
*/
|
|
6209
6608
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
6210
6609
|
/**
|
|
6211
6610
|
* Disallow useless case in switch statements.
|
|
6212
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6611
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-switch-case.md
|
|
6213
6612
|
*/
|
|
6214
6613
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
6614
|
+
/**
|
|
6615
|
+
* Disallow useless template literal expressions.
|
|
6616
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-template-literals.md
|
|
6617
|
+
*/
|
|
6618
|
+
'unicorn/no-useless-template-literals'?: Linter.RuleEntry<[]>;
|
|
6215
6619
|
/**
|
|
6216
6620
|
* Disallow useless `undefined`.
|
|
6217
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6621
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-undefined.md
|
|
6218
6622
|
*/
|
|
6219
6623
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
6624
|
+
/**
|
|
6625
|
+
* Disallow the bitwise XOR operator where exponentiation was likely intended.
|
|
6626
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-xor-as-exponentiation.md
|
|
6627
|
+
*/
|
|
6628
|
+
'unicorn/no-xor-as-exponentiation'?: Linter.RuleEntry<[]>;
|
|
6220
6629
|
/**
|
|
6221
6630
|
* Disallow number literals with zero fractions or dangling dots.
|
|
6222
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6631
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-zero-fractions.md
|
|
6223
6632
|
*/
|
|
6224
6633
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
6225
6634
|
/**
|
|
6226
6635
|
* Enforce proper case for numeric literals.
|
|
6227
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6636
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/number-literal-case.md
|
|
6228
6637
|
*/
|
|
6229
6638
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
6230
6639
|
/**
|
|
6231
6640
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
6232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6641
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/numeric-separators-style.md
|
|
6233
6642
|
*/
|
|
6234
6643
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
6644
|
+
/**
|
|
6645
|
+
* Require assignment operator shorthand where possible.
|
|
6646
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/operator-assignment.md
|
|
6647
|
+
*/
|
|
6648
|
+
'unicorn/operator-assignment'?: Linter.RuleEntry<UnicornOperatorAssignment>;
|
|
6649
|
+
/**
|
|
6650
|
+
* Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.
|
|
6651
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-abort-signal-timeout.md
|
|
6652
|
+
*/
|
|
6653
|
+
'unicorn/prefer-abort-signal-timeout'?: Linter.RuleEntry<[]>;
|
|
6235
6654
|
/**
|
|
6236
6655
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
6237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6656
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-add-event-listener.md
|
|
6238
6657
|
*/
|
|
6239
6658
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
6659
|
+
/**
|
|
6660
|
+
* Prefer an options object over a boolean in `.addEventListener()`.
|
|
6661
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-add-event-listener-options.md
|
|
6662
|
+
*/
|
|
6663
|
+
'unicorn/prefer-add-event-listener-options'?: Linter.RuleEntry<[]>;
|
|
6664
|
+
/**
|
|
6665
|
+
* Prefer `AggregateError` when throwing collected errors.
|
|
6666
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-aggregate-error.md
|
|
6667
|
+
*/
|
|
6668
|
+
'unicorn/prefer-aggregate-error'?: Linter.RuleEntry<[]>;
|
|
6240
6669
|
/**
|
|
6241
6670
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
6242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6671
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-find.md
|
|
6243
6672
|
*/
|
|
6244
6673
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
6245
6674
|
/**
|
|
6246
6675
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
6247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6676
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-flat.md
|
|
6248
6677
|
*/
|
|
6249
6678
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
6250
6679
|
/**
|
|
6251
|
-
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
6252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6680
|
+
* Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.
|
|
6681
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-flat-map.md
|
|
6253
6682
|
*/
|
|
6254
6683
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
6684
|
+
/**
|
|
6685
|
+
* Prefer `Array.fromAsync()` over `for await…of` array accumulation.
|
|
6686
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-from-async.md
|
|
6687
|
+
*/
|
|
6688
|
+
'unicorn/prefer-array-from-async'?: Linter.RuleEntry<[]>;
|
|
6689
|
+
/**
|
|
6690
|
+
* Prefer using the `Array.from()` mapping function argument.
|
|
6691
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-from-map.md
|
|
6692
|
+
*/
|
|
6693
|
+
'unicorn/prefer-array-from-map'?: Linter.RuleEntry<[]>;
|
|
6255
6694
|
/**
|
|
6256
6695
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
6257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6696
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-index-of.md
|
|
6258
6697
|
*/
|
|
6259
6698
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
6699
|
+
/**
|
|
6700
|
+
* Prefer iterating an array directly or with `Array#keys()` over `Array#entries()` when the index or value is unused.
|
|
6701
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-iterable-methods.md
|
|
6702
|
+
*/
|
|
6703
|
+
'unicorn/prefer-array-iterable-methods'?: Linter.RuleEntry<[]>;
|
|
6260
6704
|
/**
|
|
6261
6705
|
* Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
|
|
6262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6706
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-last-methods.md
|
|
6263
6707
|
*/
|
|
6264
6708
|
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>;
|
|
6709
|
+
/**
|
|
6710
|
+
* Prefer `Array#slice()` over `Array#splice()` when reading from the returned array.
|
|
6711
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-slice.md
|
|
6712
|
+
*/
|
|
6713
|
+
'unicorn/prefer-array-slice'?: Linter.RuleEntry<[]>;
|
|
6265
6714
|
/**
|
|
6266
6715
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
6267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6716
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-some.md
|
|
6268
6717
|
*/
|
|
6269
6718
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
6270
6719
|
/**
|
|
6271
6720
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
6272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6721
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-at.md
|
|
6273
6722
|
*/
|
|
6274
6723
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
6724
|
+
/**
|
|
6725
|
+
* Prefer `await` over promise chaining.
|
|
6726
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-await.md
|
|
6727
|
+
*/
|
|
6728
|
+
'unicorn/prefer-await'?: Linter.RuleEntry<[]>;
|
|
6275
6729
|
/**
|
|
6276
6730
|
* Prefer `BigInt` literals over the constructor.
|
|
6277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6731
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-bigint-literals.md
|
|
6278
6732
|
*/
|
|
6279
6733
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
6280
6734
|
/**
|
|
6281
6735
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
6282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6736
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
6283
6737
|
*/
|
|
6284
6738
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
6739
|
+
/**
|
|
6740
|
+
* Prefer directly returning boolean expressions over `if` statements.
|
|
6741
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-boolean-return.md
|
|
6742
|
+
*/
|
|
6743
|
+
'unicorn/prefer-boolean-return'?: Linter.RuleEntry<[]>;
|
|
6285
6744
|
/**
|
|
6286
6745
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
6287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6746
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-class-fields.md
|
|
6288
6747
|
*/
|
|
6289
6748
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
6290
6749
|
/**
|
|
6291
6750
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
6292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6751
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-classlist-toggle.md
|
|
6293
6752
|
*/
|
|
6294
6753
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
6295
6754
|
/**
|
|
6296
6755
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
6297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6756
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-code-point.md
|
|
6298
6757
|
*/
|
|
6299
6758
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
6759
|
+
/**
|
|
6760
|
+
* Prefer early continues over whole-loop conditional wrapping.
|
|
6761
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-continue.md
|
|
6762
|
+
*/
|
|
6763
|
+
'unicorn/prefer-continue'?: Linter.RuleEntry<UnicornPreferContinue>;
|
|
6300
6764
|
/**
|
|
6301
6765
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
6302
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6766
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-date-now.md
|
|
6303
6767
|
*/
|
|
6304
6768
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
6305
6769
|
/**
|
|
6306
6770
|
* Prefer default parameters over reassignment.
|
|
6307
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6771
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-default-parameters.md
|
|
6308
6772
|
*/
|
|
6309
6773
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
6774
|
+
/**
|
|
6775
|
+
* Prefer direct iteration over default iterator method calls.
|
|
6776
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-direct-iteration.md
|
|
6777
|
+
*/
|
|
6778
|
+
'unicorn/prefer-direct-iteration'?: Linter.RuleEntry<[]>;
|
|
6779
|
+
/**
|
|
6780
|
+
* Prefer using `using`/`await using` over manual `try`/`finally` resource disposal.
|
|
6781
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dispose.md
|
|
6782
|
+
*/
|
|
6783
|
+
'unicorn/prefer-dispose'?: Linter.RuleEntry<[]>;
|
|
6310
6784
|
/**
|
|
6311
6785
|
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
6312
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6786
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-append.md
|
|
6313
6787
|
*/
|
|
6314
6788
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
6315
6789
|
/**
|
|
6316
6790
|
* Renamed to `unicorn/dom-node-dataset`.
|
|
6317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6791
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
6318
6792
|
* @deprecated
|
|
6319
6793
|
*/
|
|
6320
6794
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
6795
|
+
/**
|
|
6796
|
+
* Prefer `.getHTML()` and `.setHTML()` over `.innerHTML`.
|
|
6797
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-html-methods.md
|
|
6798
|
+
*/
|
|
6799
|
+
'unicorn/prefer-dom-node-html-methods'?: Linter.RuleEntry<[]>;
|
|
6321
6800
|
/**
|
|
6322
6801
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
6323
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6802
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-remove.md
|
|
6324
6803
|
*/
|
|
6325
6804
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
6805
|
+
/**
|
|
6806
|
+
* Prefer `.replaceChildren()` when emptying DOM children.
|
|
6807
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-replace-children.md
|
|
6808
|
+
*/
|
|
6809
|
+
'unicorn/prefer-dom-node-replace-children'?: Linter.RuleEntry<[]>;
|
|
6326
6810
|
/**
|
|
6327
6811
|
* Prefer `.textContent` over `.innerText`.
|
|
6328
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6812
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
6329
6813
|
*/
|
|
6330
6814
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
6815
|
+
/**
|
|
6816
|
+
* Prefer early returns over full-function conditional wrapping.
|
|
6817
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-early-return.md
|
|
6818
|
+
*/
|
|
6819
|
+
'unicorn/prefer-early-return'?: Linter.RuleEntry<UnicornPreferEarlyReturn>;
|
|
6820
|
+
/**
|
|
6821
|
+
* Prefer `else if` over adjacent `if` statements with related conditions.
|
|
6822
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-else-if.md
|
|
6823
|
+
*/
|
|
6824
|
+
'unicorn/prefer-else-if'?: Linter.RuleEntry<[]>;
|
|
6825
|
+
/**
|
|
6826
|
+
* Prefer `Error.isError()` when checking for errors.
|
|
6827
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-error-is-error.md
|
|
6828
|
+
*/
|
|
6829
|
+
'unicorn/prefer-error-is-error'?: Linter.RuleEntry<[]>;
|
|
6331
6830
|
/**
|
|
6332
6831
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
6333
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6832
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-event-target.md
|
|
6334
6833
|
*/
|
|
6335
6834
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
6336
6835
|
/**
|
|
6337
6836
|
* Prefer `export…from` when re-exporting.
|
|
6338
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6837
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-export-from.md
|
|
6339
6838
|
*/
|
|
6340
6839
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
6840
|
+
/**
|
|
6841
|
+
* Prefer flat `Math.min()` and `Math.max()` calls over nested calls.
|
|
6842
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-flat-math-min-max.md
|
|
6843
|
+
*/
|
|
6844
|
+
'unicorn/prefer-flat-math-min-max'?: Linter.RuleEntry<[]>;
|
|
6341
6845
|
/**
|
|
6342
6846
|
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
6343
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6847
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-get-or-insert-computed.md
|
|
6344
6848
|
*/
|
|
6345
6849
|
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>;
|
|
6850
|
+
/**
|
|
6851
|
+
* Prefer global numeric constants over `Number` static properties.
|
|
6852
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-global-number-constants.md
|
|
6853
|
+
*/
|
|
6854
|
+
'unicorn/prefer-global-number-constants'?: Linter.RuleEntry<[]>;
|
|
6346
6855
|
/**
|
|
6347
6856
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
6348
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6857
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-global-this.md
|
|
6349
6858
|
*/
|
|
6350
6859
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
6860
|
+
/**
|
|
6861
|
+
* Prefer `.has()` when checking existence.
|
|
6862
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-has-check.md
|
|
6863
|
+
*/
|
|
6864
|
+
'unicorn/prefer-has-check'?: Linter.RuleEntry<[]>;
|
|
6865
|
+
/**
|
|
6866
|
+
* Prefer moving code shared by all branches of an `if` statement out of the branches.
|
|
6867
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-hoisting-branch-code.md
|
|
6868
|
+
*/
|
|
6869
|
+
'unicorn/prefer-hoisting-branch-code'?: Linter.RuleEntry<[]>;
|
|
6351
6870
|
/**
|
|
6352
6871
|
* Prefer HTTPS over HTTP.
|
|
6353
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6872
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-https.md
|
|
6354
6873
|
*/
|
|
6355
6874
|
'unicorn/prefer-https'?: Linter.RuleEntry<[]>;
|
|
6875
|
+
/**
|
|
6876
|
+
* Prefer identifiers over string literals in import and export specifiers.
|
|
6877
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-identifier-import-export-specifiers.md
|
|
6878
|
+
*/
|
|
6879
|
+
'unicorn/prefer-identifier-import-export-specifiers'?: Linter.RuleEntry<[]>;
|
|
6356
6880
|
/**
|
|
6357
6881
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
6358
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6882
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-import-meta-properties.md
|
|
6359
6883
|
*/
|
|
6360
6884
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
6361
6885
|
/**
|
|
6362
6886
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
6363
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6887
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-includes.md
|
|
6364
6888
|
*/
|
|
6365
6889
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
6366
6890
|
/**
|
|
6367
6891
|
* Prefer `.includes()` over repeated equality comparisons.
|
|
6368
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6892
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
6369
6893
|
*/
|
|
6370
6894
|
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>;
|
|
6895
|
+
/**
|
|
6896
|
+
* Prefer passing iterables directly to constructors instead of filling empty collections.
|
|
6897
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterable-in-constructor.md
|
|
6898
|
+
*/
|
|
6899
|
+
'unicorn/prefer-iterable-in-constructor'?: Linter.RuleEntry<[]>;
|
|
6371
6900
|
/**
|
|
6372
6901
|
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
6373
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6902
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterator-concat.md
|
|
6374
6903
|
*/
|
|
6375
6904
|
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>;
|
|
6905
|
+
/**
|
|
6906
|
+
* Prefer `Iterator#toArray()` over temporary arrays from iterator spreads.
|
|
6907
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterator-to-array.md
|
|
6908
|
+
*/
|
|
6909
|
+
'unicorn/prefer-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
6376
6910
|
/**
|
|
6377
6911
|
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
6378
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6912
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterator-to-array-at-end.md
|
|
6379
6913
|
*/
|
|
6380
6914
|
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>;
|
|
6381
6915
|
/**
|
|
6382
6916
|
* Renamed to `unicorn/consistent-json-file-read`.
|
|
6383
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6917
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
6384
6918
|
* @deprecated
|
|
6385
6919
|
*/
|
|
6386
6920
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
6387
6921
|
/**
|
|
6388
6922
|
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
6389
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6923
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
6390
6924
|
*/
|
|
6391
6925
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
6926
|
+
/**
|
|
6927
|
+
* Prefer `location.assign()` over assigning to `location.href`.
|
|
6928
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-location-assign.md
|
|
6929
|
+
*/
|
|
6930
|
+
'unicorn/prefer-location-assign'?: Linter.RuleEntry<[]>;
|
|
6392
6931
|
/**
|
|
6393
6932
|
* Prefer using a logical operator over a ternary.
|
|
6394
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6933
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
6395
6934
|
*/
|
|
6396
6935
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
6936
|
+
/**
|
|
6937
|
+
* Prefer `new Map()` over `Object.fromEntries()` when using the result as a map.
|
|
6938
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-map-from-entries.md
|
|
6939
|
+
*/
|
|
6940
|
+
'unicorn/prefer-map-from-entries'?: Linter.RuleEntry<[]>;
|
|
6397
6941
|
/**
|
|
6398
6942
|
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
6399
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6943
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-abs.md
|
|
6400
6944
|
*/
|
|
6401
6945
|
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>;
|
|
6946
|
+
/**
|
|
6947
|
+
* Prefer `Math` constants over their approximate numeric values.
|
|
6948
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-constants.md
|
|
6949
|
+
*/
|
|
6950
|
+
'unicorn/prefer-math-constants'?: Linter.RuleEntry<[]>;
|
|
6402
6951
|
/**
|
|
6403
6952
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
6404
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6953
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-min-max.md
|
|
6405
6954
|
*/
|
|
6406
6955
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
6407
6956
|
/**
|
|
6408
|
-
*
|
|
6409
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6957
|
+
* Prefer `Math.trunc()` for truncating numbers.
|
|
6958
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-trunc.md
|
|
6410
6959
|
*/
|
|
6411
6960
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
6412
6961
|
/**
|
|
6413
|
-
* Prefer
|
|
6414
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6962
|
+
* Prefer moving ternaries into the minimal varying part of an expression.
|
|
6963
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-minimal-ternary.md
|
|
6964
|
+
*/
|
|
6965
|
+
'unicorn/prefer-minimal-ternary'?: Linter.RuleEntry<UnicornPreferMinimalTernary>;
|
|
6966
|
+
/**
|
|
6967
|
+
* Prefer modern DOM APIs.
|
|
6968
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
6415
6969
|
*/
|
|
6416
6970
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
6417
6971
|
/**
|
|
6418
6972
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
6419
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6973
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-modern-math-apis.md
|
|
6420
6974
|
*/
|
|
6421
6975
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
6422
6976
|
/**
|
|
6423
6977
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
6424
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6978
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-module.md
|
|
6425
6979
|
*/
|
|
6426
6980
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
6427
6981
|
/**
|
|
6428
6982
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
6429
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6983
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
6430
6984
|
*/
|
|
6431
6985
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
6432
6986
|
/**
|
|
6433
6987
|
* Prefer negative index over `.length - index` when possible.
|
|
6434
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6988
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-negative-index.md
|
|
6435
6989
|
*/
|
|
6436
6990
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
6437
6991
|
/**
|
|
6438
6992
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
6439
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6993
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-node-protocol.md
|
|
6440
6994
|
*/
|
|
6441
6995
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
6442
6996
|
/**
|
|
6443
|
-
* Prefer `Number`
|
|
6444
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6997
|
+
* Prefer `Number()` over `parseFloat()` and base-10 `parseInt()`.
|
|
6998
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-number-coercion.md
|
|
6999
|
+
*/
|
|
7000
|
+
'unicorn/prefer-number-coercion'?: Linter.RuleEntry<[]>;
|
|
7001
|
+
/**
|
|
7002
|
+
* Prefer `Number.isSafeInteger()` over integer checks.
|
|
7003
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-number-is-safe-integer.md
|
|
7004
|
+
*/
|
|
7005
|
+
'unicorn/prefer-number-is-safe-integer'?: Linter.RuleEntry<[]>;
|
|
7006
|
+
/**
|
|
7007
|
+
* Prefer `Number` static methods over global functions and optionally static properties over global constants.
|
|
7008
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-number-properties.md
|
|
6445
7009
|
*/
|
|
6446
7010
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
7011
|
+
/**
|
|
7012
|
+
* Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.
|
|
7013
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-define-properties.md
|
|
7014
|
+
*/
|
|
7015
|
+
'unicorn/prefer-object-define-properties'?: Linter.RuleEntry<[]>;
|
|
7016
|
+
/**
|
|
7017
|
+
* Prefer object destructuring defaults over default object literals with spread.
|
|
7018
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-destructuring-defaults.md
|
|
7019
|
+
*/
|
|
7020
|
+
'unicorn/prefer-object-destructuring-defaults'?: Linter.RuleEntry<[]>;
|
|
6447
7021
|
/**
|
|
6448
7022
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6449
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7023
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-from-entries.md
|
|
6450
7024
|
*/
|
|
6451
7025
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
7026
|
+
/**
|
|
7027
|
+
* Prefer the most specific `Object` iterable method.
|
|
7028
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-iterable-methods.md
|
|
7029
|
+
*/
|
|
7030
|
+
'unicorn/prefer-object-iterable-methods'?: Linter.RuleEntry<[]>;
|
|
7031
|
+
/**
|
|
7032
|
+
* Prefer observer APIs over resize and scroll listeners with layout reads.
|
|
7033
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-observer-apis.md
|
|
7034
|
+
*/
|
|
7035
|
+
'unicorn/prefer-observer-apis'?: Linter.RuleEntry<[]>;
|
|
6452
7036
|
/**
|
|
6453
7037
|
* Prefer omitting the `catch` binding parameter.
|
|
6454
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7038
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
6455
7039
|
*/
|
|
6456
7040
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
7041
|
+
/**
|
|
7042
|
+
* Prefer `Path2D` for repeatedly drawn canvas paths.
|
|
7043
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-path2d.md
|
|
7044
|
+
*/
|
|
7045
|
+
'unicorn/prefer-path2d'?: Linter.RuleEntry<[]>;
|
|
7046
|
+
/**
|
|
7047
|
+
* Prefer private class fields over the underscore-prefix convention.
|
|
7048
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-private-class-fields.md
|
|
7049
|
+
*/
|
|
7050
|
+
'unicorn/prefer-private-class-fields'?: Linter.RuleEntry<[]>;
|
|
7051
|
+
/**
|
|
7052
|
+
* Prefer `Promise.try()` over promise-wrapping boilerplate.
|
|
7053
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-promise-try.md
|
|
7054
|
+
*/
|
|
7055
|
+
'unicorn/prefer-promise-try'?: Linter.RuleEntry<[]>;
|
|
7056
|
+
/**
|
|
7057
|
+
* Prefer `Promise.withResolvers()` when extracting resolver functions from `new Promise()`.
|
|
7058
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-promise-with-resolvers.md
|
|
7059
|
+
*/
|
|
7060
|
+
'unicorn/prefer-promise-with-resolvers'?: Linter.RuleEntry<[]>;
|
|
6457
7061
|
/**
|
|
6458
7062
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6459
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7063
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-prototype-methods.md
|
|
6460
7064
|
*/
|
|
6461
7065
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6462
7066
|
/**
|
|
6463
7067
|
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
6464
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7068
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-query-selector.md
|
|
6465
7069
|
*/
|
|
6466
7070
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>;
|
|
6467
7071
|
/**
|
|
6468
7072
|
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
6469
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7073
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-queue-microtask.md
|
|
6470
7074
|
*/
|
|
6471
7075
|
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>;
|
|
6472
7076
|
/**
|
|
6473
7077
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6474
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7078
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-reflect-apply.md
|
|
6475
7079
|
*/
|
|
6476
7080
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6477
7081
|
/**
|
|
6478
|
-
* Prefer `RegExp
|
|
6479
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7082
|
+
* Prefer `RegExp.escape()` for escaping strings to use in regular expressions.
|
|
7083
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-regexp-escape.md
|
|
7084
|
+
*/
|
|
7085
|
+
'unicorn/prefer-regexp-escape'?: Linter.RuleEntry<[]>;
|
|
7086
|
+
/**
|
|
7087
|
+
* Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.
|
|
7088
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-regexp-test.md
|
|
6480
7089
|
*/
|
|
6481
7090
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6482
7091
|
/**
|
|
6483
7092
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
6484
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7093
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-response-static-json.md
|
|
6485
7094
|
*/
|
|
6486
7095
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
7096
|
+
/**
|
|
7097
|
+
* Prefer `:scope` when using element query selector methods.
|
|
7098
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-scoped-selector.md
|
|
7099
|
+
*/
|
|
7100
|
+
'unicorn/prefer-scoped-selector'?: Linter.RuleEntry<[]>;
|
|
6487
7101
|
/**
|
|
6488
7102
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6489
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7103
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-set-has.md
|
|
6490
7104
|
*/
|
|
6491
7105
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>;
|
|
7106
|
+
/**
|
|
7107
|
+
* Prefer `Set` methods for Set operations.
|
|
7108
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-set-methods.md
|
|
7109
|
+
*/
|
|
7110
|
+
'unicorn/prefer-set-methods'?: Linter.RuleEntry<[]>;
|
|
6492
7111
|
/**
|
|
6493
7112
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6494
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7113
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-set-size.md
|
|
6495
7114
|
*/
|
|
6496
7115
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
7116
|
+
/**
|
|
7117
|
+
* Prefer arrow function properties over methods with a single return.
|
|
7118
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-short-arrow-method.md
|
|
7119
|
+
*/
|
|
7120
|
+
'unicorn/prefer-short-arrow-method'?: Linter.RuleEntry<[]>;
|
|
6497
7121
|
/**
|
|
6498
7122
|
* Prefer simple conditions first in logical expressions.
|
|
6499
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7123
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-simple-condition-first.md
|
|
6500
7124
|
*/
|
|
6501
7125
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>;
|
|
7126
|
+
/**
|
|
7127
|
+
* Prefer a simple comparison function for `Array#sort()`.
|
|
7128
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-simple-sort-comparator.md
|
|
7129
|
+
*/
|
|
7130
|
+
'unicorn/prefer-simple-sort-comparator'?: Linter.RuleEntry<[]>;
|
|
7131
|
+
/**
|
|
7132
|
+
* Prefer a single `Array#some()` or `Array#every()` with a combined predicate.
|
|
7133
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-array-predicate.md
|
|
7134
|
+
*/
|
|
7135
|
+
'unicorn/prefer-single-array-predicate'?: Linter.RuleEntry<[]>;
|
|
6502
7136
|
/**
|
|
6503
7137
|
* Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6504
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7138
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-call.md
|
|
6505
7139
|
*/
|
|
6506
7140
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
7141
|
+
/**
|
|
7142
|
+
* Prefer a single object destructuring declaration per local const source.
|
|
7143
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-object-destructuring.md
|
|
7144
|
+
*/
|
|
7145
|
+
'unicorn/prefer-single-object-destructuring'?: Linter.RuleEntry<[]>;
|
|
7146
|
+
/**
|
|
7147
|
+
* Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.
|
|
7148
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-replace.md
|
|
7149
|
+
*/
|
|
7150
|
+
'unicorn/prefer-single-replace'?: Linter.RuleEntry<[]>;
|
|
7151
|
+
/**
|
|
7152
|
+
* Prefer declaring variables in the smallest possible scope.
|
|
7153
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-smaller-scope.md
|
|
7154
|
+
*/
|
|
7155
|
+
'unicorn/prefer-smaller-scope'?: Linter.RuleEntry<[]>;
|
|
6507
7156
|
/**
|
|
6508
7157
|
* Prefer `String#split()` with a limit.
|
|
6509
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7158
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-split-limit.md
|
|
6510
7159
|
*/
|
|
6511
7160
|
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>;
|
|
6512
7161
|
/**
|
|
6513
|
-
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()
|
|
6514
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7162
|
+
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()`, and trivial `for…of` copies.
|
|
7163
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-spread.md
|
|
6515
7164
|
*/
|
|
6516
7165
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
6517
7166
|
/**
|
|
6518
7167
|
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
6519
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7168
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-match-all.md
|
|
6520
7169
|
*/
|
|
6521
7170
|
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>;
|
|
6522
7171
|
/**
|
|
6523
7172
|
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
6524
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7173
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-pad-start-end.md
|
|
6525
7174
|
*/
|
|
6526
7175
|
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>;
|
|
6527
7176
|
/**
|
|
6528
7177
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6529
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7178
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-raw.md
|
|
6530
7179
|
*/
|
|
6531
7180
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
6532
7181
|
/**
|
|
6533
7182
|
* Prefer `String#repeat()` for repeated whitespace.
|
|
6534
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7183
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-repeat.md
|
|
6535
7184
|
*/
|
|
6536
7185
|
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>;
|
|
6537
7186
|
/**
|
|
6538
7187
|
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
6539
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7188
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-replace-all.md
|
|
6540
7189
|
*/
|
|
6541
7190
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
6542
7191
|
/**
|
|
6543
7192
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6544
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7193
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-slice.md
|
|
6545
7194
|
*/
|
|
6546
7195
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
6547
7196
|
/**
|
|
6548
|
-
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6549
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7197
|
+
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()` and `String#indexOf() === 0`.
|
|
7198
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
6550
7199
|
*/
|
|
6551
7200
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
6552
7201
|
/**
|
|
6553
7202
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6554
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7203
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
6555
7204
|
*/
|
|
6556
7205
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
6557
7206
|
/**
|
|
6558
7207
|
* Prefer using `structuredClone` to create a deep clone.
|
|
6559
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7208
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-structured-clone.md
|
|
6560
7209
|
*/
|
|
6561
7210
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
6562
7211
|
/**
|
|
6563
7212
|
* Prefer `switch` over multiple `else-if`.
|
|
6564
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7213
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-switch.md
|
|
6565
7214
|
*/
|
|
6566
7215
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
6567
7216
|
/**
|
|
6568
|
-
* Prefer
|
|
6569
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7217
|
+
* Prefer `Temporal` over `Date`.
|
|
7218
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-temporal.md
|
|
7219
|
+
*/
|
|
7220
|
+
'unicorn/prefer-temporal'?: Linter.RuleEntry<UnicornPreferTemporal>;
|
|
7221
|
+
/**
|
|
7222
|
+
* Prefer ternary expressions over simple `if` statements that return or assign values.
|
|
7223
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-ternary.md
|
|
6570
7224
|
*/
|
|
6571
7225
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
7226
|
+
/**
|
|
7227
|
+
* Prefer using `Element#toggleAttribute()` to toggle attributes.
|
|
7228
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-toggle-attribute.md
|
|
7229
|
+
*/
|
|
7230
|
+
'unicorn/prefer-toggle-attribute'?: Linter.RuleEntry<[]>;
|
|
6572
7231
|
/**
|
|
6573
7232
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6574
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7233
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-top-level-await.md
|
|
6575
7234
|
*/
|
|
6576
7235
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
6577
7236
|
/**
|
|
6578
7237
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6579
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7238
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-type-error.md
|
|
6580
7239
|
*/
|
|
6581
7240
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
6582
7241
|
/**
|
|
6583
|
-
*
|
|
6584
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7242
|
+
* Require type literals to be last in union types.
|
|
7243
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-type-literal-last.md
|
|
7244
|
+
*/
|
|
7245
|
+
'unicorn/prefer-type-literal-last'?: Linter.RuleEntry<[]>;
|
|
7246
|
+
/**
|
|
7247
|
+
* Prefer `Uint8Array#toBase64()` and `Uint8Array.fromBase64()` over `atob()`, `btoa()`, and `Buffer` base64 conversions.
|
|
7248
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-uint8array-base64.md
|
|
7249
|
+
*/
|
|
7250
|
+
'unicorn/prefer-uint8array-base64'?: Linter.RuleEntry<[]>;
|
|
7251
|
+
/**
|
|
7252
|
+
* Prefer the unary minus operator over multiplying or dividing by `-1`.
|
|
7253
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-unary-minus.md
|
|
6585
7254
|
*/
|
|
6586
|
-
'unicorn/
|
|
7255
|
+
'unicorn/prefer-unary-minus'?: Linter.RuleEntry<[]>;
|
|
7256
|
+
/**
|
|
7257
|
+
* Prefer Unicode code point escapes over legacy escape sequences.
|
|
7258
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-unicode-code-point-escapes.md
|
|
7259
|
+
*/
|
|
7260
|
+
'unicorn/prefer-unicode-code-point-escapes'?: Linter.RuleEntry<[]>;
|
|
7261
|
+
/**
|
|
7262
|
+
* Prefer `URL.canParse()` over constructing a `URL` in a try/catch for validation.
|
|
7263
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-url-can-parse.md
|
|
7264
|
+
*/
|
|
7265
|
+
'unicorn/prefer-url-can-parse'?: Linter.RuleEntry<[]>;
|
|
7266
|
+
/**
|
|
7267
|
+
* Prefer `URL#href` over stringifying a `URL`.
|
|
7268
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-url-href.md
|
|
7269
|
+
*/
|
|
7270
|
+
'unicorn/prefer-url-href'?: Linter.RuleEntry<[]>;
|
|
7271
|
+
/**
|
|
7272
|
+
* Prefer `URLSearchParams` over manually splitting query strings.
|
|
7273
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-url-search-parameters.md
|
|
7274
|
+
*/
|
|
7275
|
+
'unicorn/prefer-url-search-parameters'?: Linter.RuleEntry<[]>;
|
|
7276
|
+
/**
|
|
7277
|
+
* Prefer putting the condition in the while statement.
|
|
7278
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-while-loop-condition.md
|
|
7279
|
+
*/
|
|
7280
|
+
'unicorn/prefer-while-loop-condition'?: Linter.RuleEntry<[]>;
|
|
7281
|
+
/**
|
|
7282
|
+
* Renamed to `unicorn/name-replacements`.
|
|
7283
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#prevent-abbreviations
|
|
7284
|
+
* @deprecated
|
|
7285
|
+
*/
|
|
7286
|
+
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<[]>;
|
|
6587
7287
|
/**
|
|
6588
7288
|
* Enforce consistent relative URL style.
|
|
6589
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7289
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/relative-url-style.md
|
|
6590
7290
|
*/
|
|
6591
7291
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
6592
7292
|
/**
|
|
6593
7293
|
* Enforce using the separator argument with `Array#join()`.
|
|
6594
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7294
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-array-join-separator.md
|
|
6595
7295
|
*/
|
|
6596
7296
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
7297
|
+
/**
|
|
7298
|
+
* Require a compare function when calling `Array#sort()` or `Array#toSorted()`.
|
|
7299
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-array-sort-compare.md
|
|
7300
|
+
*/
|
|
7301
|
+
'unicorn/require-array-sort-compare'?: Linter.RuleEntry<[]>;
|
|
6597
7302
|
/**
|
|
6598
7303
|
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
6599
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7304
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-css-escape.md
|
|
6600
7305
|
*/
|
|
6601
7306
|
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>;
|
|
6602
7307
|
/**
|
|
6603
7308
|
* Require non-empty module attributes for imports and exports
|
|
6604
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7309
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-module-attributes.md
|
|
6605
7310
|
*/
|
|
6606
7311
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
6607
7312
|
/**
|
|
6608
7313
|
* Require non-empty specifier list in import and export statements.
|
|
6609
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7314
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-module-specifiers.md
|
|
6610
7315
|
*/
|
|
6611
7316
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
6612
7317
|
/**
|
|
6613
7318
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6614
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7319
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6615
7320
|
*/
|
|
6616
7321
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
6617
7322
|
/**
|
|
6618
7323
|
* Require passive event listeners for high-frequency events.
|
|
6619
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7324
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-passive-events.md
|
|
6620
7325
|
*/
|
|
6621
7326
|
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>;
|
|
6622
7327
|
/**
|
|
6623
7328
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6624
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7329
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-post-message-target-origin.md
|
|
6625
7330
|
*/
|
|
6626
7331
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
7332
|
+
/**
|
|
7333
|
+
* Require boolean-returning Proxy traps to return booleans.
|
|
7334
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-proxy-trap-boolean-return.md
|
|
7335
|
+
*/
|
|
7336
|
+
'unicorn/require-proxy-trap-boolean-return'?: Linter.RuleEntry<[]>;
|
|
6627
7337
|
/**
|
|
6628
7338
|
* Enforce better string content.
|
|
6629
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7339
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/string-content.md
|
|
6630
7340
|
*/
|
|
6631
7341
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
6632
7342
|
/**
|
|
6633
7343
|
* Enforce consistent brace style for `case` clauses.
|
|
6634
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7344
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/switch-case-braces.md
|
|
6635
7345
|
*/
|
|
6636
7346
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
6637
7347
|
/**
|
|
6638
7348
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
6639
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7349
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/switch-case-break-position.md
|
|
6640
7350
|
*/
|
|
6641
7351
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>;
|
|
6642
7352
|
/**
|
|
6643
7353
|
* Fix whitespace-insensitive template indentation.
|
|
6644
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7354
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/template-indent.md
|
|
6645
7355
|
*/
|
|
6646
7356
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
6647
7357
|
/**
|
|
6648
7358
|
* Enforce consistent case for text encoding identifiers.
|
|
6649
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7359
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/text-encoding-identifier-case.md
|
|
6650
7360
|
*/
|
|
6651
7361
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
6652
7362
|
/**
|
|
6653
7363
|
* Require `new` when creating an error.
|
|
6654
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7364
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/throw-new-error.md
|
|
6655
7365
|
*/
|
|
6656
7366
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
6657
7367
|
/**
|
|
6658
7368
|
* Limit the complexity of `try` blocks.
|
|
6659
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7369
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/try-complexity.md
|
|
6660
7370
|
*/
|
|
6661
7371
|
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>;
|
|
6662
7372
|
/**
|
|
@@ -6802,6 +7512,11 @@ interface RuleOptions {
|
|
|
6802
7512
|
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-tab-indent.html
|
|
6803
7513
|
*/
|
|
6804
7514
|
'yml/no-tab-indent'?: Linter.RuleEntry<[]>;
|
|
7515
|
+
/**
|
|
7516
|
+
* disallow trailing whitespace at the end of lines
|
|
7517
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-trailing-spaces.html
|
|
7518
|
+
*/
|
|
7519
|
+
'yml/no-trailing-spaces'?: Linter.RuleEntry<YmlNoTrailingSpaces>;
|
|
6805
7520
|
/**
|
|
6806
7521
|
* disallow trailing zeros for floats
|
|
6807
7522
|
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-trailing-zeros.html
|
|
@@ -7248,7 +7963,7 @@ type ImportNoAbsolutePath = [] | [{
|
|
|
7248
7963
|
commonjs?: boolean;
|
|
7249
7964
|
amd?: boolean;
|
|
7250
7965
|
esmodule?: boolean;
|
|
7251
|
-
ignore?: [
|
|
7966
|
+
ignore?: [unknown, ...(unknown)[]];
|
|
7252
7967
|
}]; // ----- import/no-anonymous-default-export -----
|
|
7253
7968
|
type ImportNoAnonymousDefaultExport = [] | [{
|
|
7254
7969
|
allowArray?: boolean;
|
|
@@ -7269,7 +7984,7 @@ type ImportNoCycle = [] | [{
|
|
|
7269
7984
|
commonjs?: boolean;
|
|
7270
7985
|
amd?: boolean;
|
|
7271
7986
|
esmodule?: boolean;
|
|
7272
|
-
ignore?: [
|
|
7987
|
+
ignore?: [unknown, ...(unknown)[]];
|
|
7273
7988
|
maxDepth?: (number | "∞");
|
|
7274
7989
|
ignoreExternal?: boolean;
|
|
7275
7990
|
allowUnsafeDynamicCyclicDependency?: boolean;
|
|
@@ -7310,13 +8025,13 @@ type ImportNoRelativePackages = [] | [{
|
|
|
7310
8025
|
commonjs?: boolean;
|
|
7311
8026
|
amd?: boolean;
|
|
7312
8027
|
esmodule?: boolean;
|
|
7313
|
-
ignore?: [
|
|
8028
|
+
ignore?: [unknown, ...(unknown)[]];
|
|
7314
8029
|
}]; // ----- import/no-relative-parent-imports -----
|
|
7315
8030
|
type ImportNoRelativeParentImports = [] | [{
|
|
7316
8031
|
commonjs?: boolean;
|
|
7317
8032
|
amd?: boolean;
|
|
7318
8033
|
esmodule?: boolean;
|
|
7319
|
-
ignore?: [
|
|
8034
|
+
ignore?: [unknown, ...(unknown)[]];
|
|
7320
8035
|
}]; // ----- import/no-rename-default -----
|
|
7321
8036
|
type ImportNoRenameDefault = [] | [{
|
|
7322
8037
|
commonjs?: boolean;
|
|
@@ -7346,7 +8061,7 @@ type ImportNoUnresolved = [] | [{
|
|
|
7346
8061
|
commonjs?: boolean;
|
|
7347
8062
|
amd?: boolean;
|
|
7348
8063
|
esmodule?: boolean;
|
|
7349
|
-
ignore?: [
|
|
8064
|
+
ignore?: [unknown, ...(unknown)[]];
|
|
7350
8065
|
caseSensitive?: boolean;
|
|
7351
8066
|
caseSensitiveStrict?: boolean;
|
|
7352
8067
|
}]; // ----- import/no-unused-modules -----
|
|
@@ -16248,6 +16963,30 @@ type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/catch-error-name
|
|
|
16248
16963
|
type UnicornCatchErrorName = [] | [{
|
|
16249
16964
|
name?: string;
|
|
16250
16965
|
ignore?: unknown[];
|
|
16966
|
+
}]; // ----- unicorn/class-reference-in-static-methods -----
|
|
16967
|
+
type UnicornClassReferenceInStaticMethods = [] | [{
|
|
16968
|
+
preferThis?: boolean;
|
|
16969
|
+
preferSuper?: boolean;
|
|
16970
|
+
}]; // ----- unicorn/comment-content -----
|
|
16971
|
+
type UnicornCommentContent = [] | [{
|
|
16972
|
+
checkUniformCase?: boolean;
|
|
16973
|
+
extendDefaultReplacements?: boolean;
|
|
16974
|
+
replacements?: {
|
|
16975
|
+
[k: string]: (false | string | {
|
|
16976
|
+
replacement: string;
|
|
16977
|
+
caseSensitive?: boolean;
|
|
16978
|
+
}) | undefined;
|
|
16979
|
+
};
|
|
16980
|
+
}]; // ----- unicorn/consistent-boolean-name -----
|
|
16981
|
+
type UnicornConsistentBooleanName = [] | [{
|
|
16982
|
+
checkProperties?: boolean;
|
|
16983
|
+
prefixes?: {
|
|
16984
|
+
[k: string]: boolean | undefined;
|
|
16985
|
+
};
|
|
16986
|
+
ignore?: unknown[];
|
|
16987
|
+
}]; // ----- unicorn/consistent-class-member-order -----
|
|
16988
|
+
type UnicornConsistentClassMemberOrder = [] | [{
|
|
16989
|
+
order?: [("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method")];
|
|
16251
16990
|
}]; // ----- unicorn/consistent-compound-words -----
|
|
16252
16991
|
type UnicornConsistentCompoundWords = [] | [{
|
|
16253
16992
|
checkProperties?: boolean;
|
|
@@ -16264,11 +17003,26 @@ interface _UnicornConsistentCompoundWords_Replacements {
|
|
|
16264
17003
|
}
|
|
16265
17004
|
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
16266
17005
|
[k: string]: true | undefined;
|
|
16267
|
-
} // ----- unicorn/consistent-
|
|
17006
|
+
} // ----- unicorn/consistent-conditional-object-spread -----
|
|
17007
|
+
type UnicornConsistentConditionalObjectSpread = [] | [("logical" | "ternary")]; // ----- unicorn/consistent-export-decorator-position -----
|
|
17008
|
+
type UnicornConsistentExportDecoratorPosition = [] | [("above" | "before" | "after")]; // ----- unicorn/consistent-function-scoping -----
|
|
16268
17009
|
type UnicornConsistentFunctionScoping = [] | [{
|
|
16269
17010
|
checkArrowFunctions?: boolean;
|
|
17011
|
+
}]; // ----- unicorn/consistent-function-style -----
|
|
17012
|
+
type UnicornConsistentFunctionStyle = [] | [{
|
|
17013
|
+
default?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
17014
|
+
namedFunctions?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
17015
|
+
namedExports?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
17016
|
+
callbacks?: ("function-expression" | "arrow-function" | "ignore");
|
|
17017
|
+
objectProperties?: ("method" | "function-expression" | "arrow-function" | "ignore");
|
|
17018
|
+
reassignedVariables?: ("function-expression" | "arrow-function" | "ignore");
|
|
17019
|
+
typedVariables?: ("function-expression" | "arrow-function" | "ignore");
|
|
16270
17020
|
}]; // ----- unicorn/consistent-json-file-read -----
|
|
16271
|
-
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/
|
|
17021
|
+
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/default-export-style -----
|
|
17022
|
+
type UnicornDefaultExportStyle = [] | [{
|
|
17023
|
+
functions?: ("inline" | "separate" | "ignore");
|
|
17024
|
+
classes?: ("inline" | "separate" | "ignore");
|
|
17025
|
+
}]; // ----- unicorn/dom-node-dataset -----
|
|
16272
17026
|
type UnicornDomNodeDataset = [] | [{
|
|
16273
17027
|
preferAttributes?: boolean;
|
|
16274
17028
|
}]; // ----- unicorn/escape-case -----
|
|
@@ -16283,15 +17037,17 @@ type UnicornExpiringTodoComments = [] | [{
|
|
|
16283
17037
|
}]; // ----- unicorn/explicit-length-check -----
|
|
16284
17038
|
type UnicornExplicitLengthCheck = [] | [{
|
|
16285
17039
|
"non-zero"?: ("greater-than" | "not-equal");
|
|
16286
|
-
}]; // ----- unicorn/
|
|
17040
|
+
}]; // ----- unicorn/explicit-timer-delay -----
|
|
17041
|
+
type UnicornExplicitTimerDelay = [] | [("always" | "never")]; // ----- unicorn/filename-case -----
|
|
16287
17042
|
type UnicornFilenameCase = [] | [({
|
|
16288
|
-
case?: ("camelCase" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
17043
|
+
case?: ("camelCase" | "camelCaseWithAcronyms" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
16289
17044
|
ignore?: unknown[];
|
|
16290
17045
|
multipleFileExtensions?: boolean;
|
|
16291
17046
|
checkDirectories?: boolean;
|
|
16292
17047
|
} | {
|
|
16293
17048
|
cases?: {
|
|
16294
17049
|
camelCase?: boolean;
|
|
17050
|
+
camelCaseWithAcronyms?: boolean;
|
|
16295
17051
|
snakeCase?: boolean;
|
|
16296
17052
|
kebabCase?: boolean;
|
|
16297
17053
|
pascalCase?: boolean;
|
|
@@ -16299,7 +17055,14 @@ type UnicornFilenameCase = [] | [({
|
|
|
16299
17055
|
ignore?: unknown[];
|
|
16300
17056
|
multipleFileExtensions?: boolean;
|
|
16301
17057
|
checkDirectories?: boolean;
|
|
16302
|
-
})]; // ----- unicorn/
|
|
17058
|
+
})]; // ----- unicorn/id-match -----
|
|
17059
|
+
type UnicornIdMatch = [] | [string] | [string, {
|
|
17060
|
+
properties?: boolean;
|
|
17061
|
+
classFields?: boolean;
|
|
17062
|
+
onlyDeclarations?: boolean;
|
|
17063
|
+
ignoreDestructuring?: boolean;
|
|
17064
|
+
checkNamedSpecifiers?: boolean;
|
|
17065
|
+
}]; // ----- unicorn/import-style -----
|
|
16303
17066
|
type UnicornImportStyle = [] | [{
|
|
16304
17067
|
checkImport?: boolean;
|
|
16305
17068
|
checkDynamicImport?: boolean;
|
|
@@ -16322,7 +17085,36 @@ type UnicornIsolatedFunctions = [] | [{
|
|
|
16322
17085
|
functions?: string[];
|
|
16323
17086
|
selectors?: string[];
|
|
16324
17087
|
comments?: string[];
|
|
16325
|
-
}]; // ----- unicorn/
|
|
17088
|
+
}]; // ----- unicorn/logical-assignment-operators -----
|
|
17089
|
+
type UnicornLogicalAssignmentOperators = (([] | ["always"] | ["always", {
|
|
17090
|
+
enforceForIfStatements?: boolean;
|
|
17091
|
+
}] | ["never"]) & unknown[]); // ----- unicorn/max-nested-calls -----
|
|
17092
|
+
type UnicornMaxNestedCalls = [] | [{
|
|
17093
|
+
max?: number;
|
|
17094
|
+
}]; // ----- unicorn/name-replacements -----
|
|
17095
|
+
type UnicornNameReplacements = [] | [{
|
|
17096
|
+
checkProperties?: boolean;
|
|
17097
|
+
checkVariables?: boolean;
|
|
17098
|
+
checkDefaultAndNamespaceImports?: (boolean | string);
|
|
17099
|
+
checkShorthandImports?: (boolean | string);
|
|
17100
|
+
checkShorthandProperties?: boolean;
|
|
17101
|
+
checkFilenames?: boolean;
|
|
17102
|
+
extendDefaultReplacements?: boolean;
|
|
17103
|
+
replacements?: _UnicornNameReplacements_NameReplacements;
|
|
17104
|
+
extendDefaultAllowList?: boolean;
|
|
17105
|
+
allowList?: _UnicornNameReplacements_BooleanObject;
|
|
17106
|
+
ignore?: unknown[];
|
|
17107
|
+
}];
|
|
17108
|
+
type _UnicornNameReplacementsReplacements = (false | _UnicornNameReplacements_BooleanObject) | undefined;
|
|
17109
|
+
interface _UnicornNameReplacements_NameReplacements {
|
|
17110
|
+
[k: string]: _UnicornNameReplacementsReplacements | undefined;
|
|
17111
|
+
}
|
|
17112
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
17113
|
+
[k: string]: boolean | undefined;
|
|
17114
|
+
}
|
|
17115
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
17116
|
+
[k: string]: boolean | undefined;
|
|
17117
|
+
} // ----- unicorn/no-array-callback-reference -----
|
|
16326
17118
|
type UnicornNoArrayCallbackReference = [] | [{
|
|
16327
17119
|
ignore?: string[];
|
|
16328
17120
|
}]; // ----- unicorn/no-array-reduce -----
|
|
@@ -16343,11 +17135,23 @@ type UnicornNoInstanceofBuiltins = [] | [{
|
|
|
16343
17135
|
strategy?: ("loose" | "strict");
|
|
16344
17136
|
include?: string[];
|
|
16345
17137
|
exclude?: string[];
|
|
17138
|
+
}]; // ----- unicorn/no-invalid-argument-count -----
|
|
17139
|
+
type UnicornNoInvalidArgumentCount = [] | [{
|
|
17140
|
+
[k: string]: (number | [number, ...(number)[]] | {
|
|
17141
|
+
min?: number;
|
|
17142
|
+
max?: number;
|
|
17143
|
+
}) | undefined;
|
|
16346
17144
|
}]; // ----- unicorn/no-keyword-prefix -----
|
|
16347
17145
|
type UnicornNoKeywordPrefix = [] | [{
|
|
16348
17146
|
disallowedPrefixes?: [] | [string];
|
|
16349
17147
|
checkProperties?: boolean;
|
|
16350
17148
|
onlyCamelCase?: boolean;
|
|
17149
|
+
}]; // ----- unicorn/no-negated-comparison -----
|
|
17150
|
+
type UnicornNoNegatedComparison = [] | [{
|
|
17151
|
+
checkLogicalExpressions?: boolean;
|
|
17152
|
+
}]; // ----- unicorn/no-non-function-verb-prefix -----
|
|
17153
|
+
type UnicornNoNonFunctionVerbPrefix = [] | [{
|
|
17154
|
+
verbs?: string[];
|
|
16351
17155
|
}]; // ----- unicorn/no-null -----
|
|
16352
17156
|
type UnicornNoNull = [] | [{
|
|
16353
17157
|
checkArguments?: boolean;
|
|
@@ -16360,6 +17164,9 @@ type UnicornNoUnnecessaryPolyfills = [] | [{
|
|
|
16360
17164
|
targets?: (string | unknown[] | {
|
|
16361
17165
|
[k: string]: unknown | undefined;
|
|
16362
17166
|
});
|
|
17167
|
+
}]; // ----- unicorn/no-unreadable-array-destructuring -----
|
|
17168
|
+
type UnicornNoUnreadableArrayDestructuring = [] | [{
|
|
17169
|
+
maximumIgnoredElements?: number;
|
|
16363
17170
|
}]; // ----- unicorn/no-useless-undefined -----
|
|
16364
17171
|
type UnicornNoUselessUndefined = [] | [{
|
|
16365
17172
|
checkArguments?: boolean;
|
|
@@ -16391,7 +17198,8 @@ type UnicornNumericSeparatorsStyle = [] | [{
|
|
|
16391
17198
|
fractionGroupLength?: number;
|
|
16392
17199
|
};
|
|
16393
17200
|
onlyIfContainsSeparator?: boolean;
|
|
16394
|
-
}]; // ----- unicorn/
|
|
17201
|
+
}]; // ----- unicorn/operator-assignment -----
|
|
17202
|
+
type UnicornOperatorAssignment = [] | [("always" | "never")]; // ----- unicorn/prefer-add-event-listener -----
|
|
16395
17203
|
type UnicornPreferAddEventListener = [] | [{
|
|
16396
17204
|
excludedPackages?: string[];
|
|
16397
17205
|
}]; // ----- unicorn/prefer-array-find -----
|
|
@@ -16404,12 +17212,22 @@ type UnicornPreferArrayFlat = [] | [{
|
|
|
16404
17212
|
type UnicornPreferAt = [] | [{
|
|
16405
17213
|
getLastElementFunctions?: unknown[];
|
|
16406
17214
|
checkAllIndexAccess?: boolean;
|
|
17215
|
+
}]; // ----- unicorn/prefer-continue -----
|
|
17216
|
+
type UnicornPreferContinue = [] | [{
|
|
17217
|
+
maximumStatements?: number;
|
|
17218
|
+
}]; // ----- unicorn/prefer-early-return -----
|
|
17219
|
+
type UnicornPreferEarlyReturn = [] | [{
|
|
17220
|
+
maximumStatements?: number;
|
|
16407
17221
|
}]; // ----- unicorn/prefer-export-from -----
|
|
16408
17222
|
type UnicornPreferExportFrom = [] | [{
|
|
16409
17223
|
checkUsedVariables?: boolean;
|
|
16410
17224
|
}]; // ----- unicorn/prefer-includes-over-repeated-comparisons -----
|
|
16411
17225
|
type UnicornPreferIncludesOverRepeatedComparisons = [] | [{
|
|
16412
17226
|
minimumComparisons?: number;
|
|
17227
|
+
}]; // ----- unicorn/prefer-minimal-ternary -----
|
|
17228
|
+
type UnicornPreferMinimalTernary = [] | [{
|
|
17229
|
+
checkVaryingCallee?: boolean;
|
|
17230
|
+
checkComputedMemberAccess?: boolean;
|
|
16413
17231
|
}]; // ----- unicorn/prefer-number-properties -----
|
|
16414
17232
|
type UnicornPreferNumberProperties = [] | [{
|
|
16415
17233
|
checkInfinity?: boolean;
|
|
@@ -16440,31 +17258,13 @@ type UnicornPreferStructuredClone = [] | [{
|
|
|
16440
17258
|
type UnicornPreferSwitch = [] | [{
|
|
16441
17259
|
minimumCases?: number;
|
|
16442
17260
|
emptyDefaultCase?: ("no-default-comment" | "do-nothing-comment" | "no-default-case");
|
|
17261
|
+
}]; // ----- unicorn/prefer-temporal -----
|
|
17262
|
+
type UnicornPreferTemporal = [] | [{
|
|
17263
|
+
checkDateNow?: boolean;
|
|
17264
|
+
checkReferences?: boolean;
|
|
17265
|
+
checkMethods?: boolean;
|
|
16443
17266
|
}]; // ----- unicorn/prefer-ternary -----
|
|
16444
|
-
type UnicornPreferTernary = [] | [("always" | "only-single-line")]; // ----- unicorn/
|
|
16445
|
-
type UnicornPreventAbbreviations = [] | [{
|
|
16446
|
-
checkProperties?: boolean;
|
|
16447
|
-
checkVariables?: boolean;
|
|
16448
|
-
checkDefaultAndNamespaceImports?: (boolean | string);
|
|
16449
|
-
checkShorthandImports?: (boolean | string);
|
|
16450
|
-
checkShorthandProperties?: boolean;
|
|
16451
|
-
checkFilenames?: boolean;
|
|
16452
|
-
extendDefaultReplacements?: boolean;
|
|
16453
|
-
replacements?: _UnicornPreventAbbreviations_Abbreviations;
|
|
16454
|
-
extendDefaultAllowList?: boolean;
|
|
16455
|
-
allowList?: _UnicornPreventAbbreviations_BooleanObject;
|
|
16456
|
-
ignore?: unknown[];
|
|
16457
|
-
}];
|
|
16458
|
-
type _UnicornPreventAbbreviationsReplacements = (false | _UnicornPreventAbbreviations_BooleanObject) | undefined;
|
|
16459
|
-
interface _UnicornPreventAbbreviations_Abbreviations {
|
|
16460
|
-
[k: string]: _UnicornPreventAbbreviationsReplacements | undefined;
|
|
16461
|
-
}
|
|
16462
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
16463
|
-
[k: string]: boolean | undefined;
|
|
16464
|
-
}
|
|
16465
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
16466
|
-
[k: string]: boolean | undefined;
|
|
16467
|
-
} // ----- unicorn/relative-url-style -----
|
|
17267
|
+
type UnicornPreferTernary = [] | [("always" | "only-single-line")]; // ----- unicorn/relative-url-style -----
|
|
16468
17268
|
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/require-css-escape -----
|
|
16469
17269
|
type UnicornRequireCssEscape = [] | [{
|
|
16470
17270
|
checkAllSelectors?: boolean;
|
|
@@ -16480,7 +17280,7 @@ type UnicornStringContent = [] | [{
|
|
|
16480
17280
|
};
|
|
16481
17281
|
selectors?: string[];
|
|
16482
17282
|
}]; // ----- unicorn/switch-case-braces -----
|
|
16483
|
-
type UnicornSwitchCaseBraces = [] | [("always" | "avoid")]; // ----- unicorn/template-indent -----
|
|
17283
|
+
type UnicornSwitchCaseBraces = [] | [("always" | "avoid" | "single-statement")]; // ----- unicorn/template-indent -----
|
|
16484
17284
|
type UnicornTemplateIndent = [] | [{
|
|
16485
17285
|
indent?: (string | number);
|
|
16486
17286
|
tags?: string[];
|
|
@@ -16643,6 +17443,10 @@ type YmlNoMultipleEmptyLines = [] | [{
|
|
|
16643
17443
|
max: number;
|
|
16644
17444
|
maxEOF?: number;
|
|
16645
17445
|
maxBOF?: number;
|
|
17446
|
+
}]; // ----- yml/no-trailing-spaces -----
|
|
17447
|
+
type YmlNoTrailingSpaces = [] | [{
|
|
17448
|
+
skipBlankLines?: boolean;
|
|
17449
|
+
ignoreComments?: boolean;
|
|
16646
17450
|
}]; // ----- yml/plain-scalar -----
|
|
16647
17451
|
type YmlPlainScalar = [] | [("always" | "never")] | [("always" | "never"), {
|
|
16648
17452
|
ignorePatterns?: string[];
|
|
@@ -16733,7 +17537,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16733
17537
|
exceptRange?: boolean;
|
|
16734
17538
|
onlyEquality?: boolean;
|
|
16735
17539
|
}]; // Names of all the configs
|
|
16736
|
-
type ConfigNames = 'ncontiero/gitignore' | 'ncontiero/ignores' | 'ncontiero/javascript/rules' | 'ncontiero/javascript/cli-rules' | 'ncontiero/javascript/test-rules' | 'ncontiero/comments/rules' | 'ncontiero/command/rules' | 'ncontiero/perfectionist/rules' | 'ncontiero/node/setup' | 'ncontiero/node/rules' | 'ncontiero/promise/setup' | 'ncontiero/promise/rules' | 'ncontiero/jsdoc/setup' | 'ncontiero/jsdoc/rules' | 'ncontiero/imports/rules' | 'ncontiero/imports/allow-default-export' | 'ncontiero/de-morgan' | 'ncontiero/e18e/rules' | 'ncontiero/unicorn/rules' | 'ncontiero/jsx/setup' | 'ncontiero/typescript/setup' | 'ncontiero/typescript/parser' | 'ncontiero/typescript/rules' | 'ncontiero/typescript/dts-rules' | 'ncontiero/typescript/cjs-rules' | 'ncontiero/tanstack-query/setup' | 'ncontiero/tanstack-query/rules' | 'ncontiero/jsonc/recommended' | 'ncontiero/jsonc/recommended' | 'ncontiero/jsonc/recommended' | 'ncontiero/jsonc/rules' | 'ncontiero/sort/package-json' | 'ncontiero/sort/tsconfig' | 'ncontiero/yml/setup' | 'ncontiero/yml/rules' | 'ncontiero/yml/pnpm-workspace' | 'ncontiero/toml/setup' | 'ncontiero/toml/rules' | 'ncontiero/markdown/setup' | 'ncontiero/markdown/processor' | 'ncontiero/markdown/parser' | 'ncontiero/markdown/rules' | 'ncontiero/regexp/rules' | 'ncontiero/react/setup' | 'ncontiero/react/rules' | 'ncontiero/react/typescript' | 'ncontiero/nextjs/setup' | 'ncontiero/nextjs/rules' | 'ncontiero/html/setup' | 'ncontiero/html/rules' | 'ncontiero/tailwindcss/setup' | 'ncontiero/tailwindcss/rules' | 'ncontiero/prettier/setup' | 'ncontiero/prettier/disables' | 'ncontiero/prettier/rules' | 'ncontiero/prettier/markdown' | 'ncontiero/prettier/css' | 'ncontiero/prettier/scss' | 'ncontiero/prettier/less';
|
|
17540
|
+
type ConfigNames = 'ncontiero/gitignore' | 'ncontiero/ignores' | 'ncontiero/javascript/rules' | 'ncontiero/javascript/cli-rules' | 'ncontiero/javascript/test-rules' | 'ncontiero/comments/rules' | 'ncontiero/command/rules' | 'ncontiero/perfectionist/rules' | 'ncontiero/node/setup' | 'ncontiero/node/rules' | 'ncontiero/promise/setup' | 'ncontiero/promise/rules' | 'ncontiero/jsdoc/setup' | 'ncontiero/jsdoc/rules' | 'ncontiero/imports/rules' | 'ncontiero/imports/allow-default-export' | 'ncontiero/de-morgan' | 'ncontiero/e18e/rules' | 'ncontiero/unicorn/setup' | 'ncontiero/unicorn/rules' | 'ncontiero/jsx/setup' | 'ncontiero/typescript/setup' | 'ncontiero/typescript/parser' | 'ncontiero/typescript/rules' | 'ncontiero/typescript/dts-rules' | 'ncontiero/typescript/cjs-rules' | 'ncontiero/tanstack-query/setup' | 'ncontiero/tanstack-query/rules' | 'ncontiero/jsonc/recommended' | 'ncontiero/jsonc/recommended' | 'ncontiero/jsonc/recommended' | 'ncontiero/jsonc/rules' | 'ncontiero/sort/package-json' | 'ncontiero/sort/tsconfig' | 'ncontiero/yml/setup' | 'ncontiero/yml/rules' | 'ncontiero/yml/pnpm-workspace' | 'ncontiero/toml/setup' | 'ncontiero/toml/rules' | 'ncontiero/markdown/setup' | 'ncontiero/markdown/processor' | 'ncontiero/markdown/parser' | 'ncontiero/markdown/rules' | 'ncontiero/regexp/rules' | 'ncontiero/react/setup' | 'ncontiero/react/rules' | 'ncontiero/react/typescript' | 'ncontiero/nextjs/setup' | 'ncontiero/nextjs/rules' | 'ncontiero/html/setup' | 'ncontiero/html/rules' | 'ncontiero/tailwindcss/setup' | 'ncontiero/tailwindcss/rules' | 'ncontiero/prettier/setup' | 'ncontiero/prettier/disables' | 'ncontiero/prettier/rules' | 'ncontiero/prettier/markdown' | 'ncontiero/prettier/css' | 'ncontiero/prettier/scss' | 'ncontiero/prettier/less';
|
|
16737
17541
|
//#endregion
|
|
16738
17542
|
//#region src/types.d.ts
|
|
16739
17543
|
type Awaitable<T> = T | Promise<T>;
|