@lincy/eslint-config 6.1.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +228 -166
- package/dist/index.d.cts +29 -5
- package/dist/{index.d.ts → index.d.mts} +30 -6
- package/dist/{index.js → index.mjs} +190 -150
- package/package.json +91 -81
- package/dist/chunk-DWy1uDak.cjs +0 -39
- package/dist/lib-CEKTiw7V.js +0 -11176
- package/dist/lib-DS4wQk2J.cjs +0 -11153
package/dist/index.cjs
CHANGED
|
@@ -1,42 +1,80 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
3
29
|
let eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
4
|
-
eslint_flat_config_utils = require_chunk.__toESM(eslint_flat_config_utils);
|
|
5
30
|
let node_process = require("node:process");
|
|
6
|
-
node_process =
|
|
31
|
+
node_process = __toESM(node_process);
|
|
32
|
+
let node_fs_promises = require("node:fs/promises");
|
|
33
|
+
node_fs_promises = __toESM(node_fs_promises);
|
|
7
34
|
let node_url = require("node:url");
|
|
8
|
-
node_url = require_chunk.__toESM(node_url);
|
|
9
35
|
let node_fs = require("node:fs");
|
|
10
|
-
node_fs =
|
|
36
|
+
node_fs = __toESM(node_fs);
|
|
11
37
|
let node_path = require("node:path");
|
|
12
|
-
node_path =
|
|
38
|
+
node_path = __toESM(node_path);
|
|
13
39
|
let local_pkg = require("local-pkg");
|
|
14
|
-
local_pkg = require_chunk.__toESM(local_pkg);
|
|
15
40
|
let __eslint_community_eslint_plugin_eslint_comments = require("@eslint-community/eslint-plugin-eslint-comments");
|
|
16
|
-
__eslint_community_eslint_plugin_eslint_comments =
|
|
41
|
+
__eslint_community_eslint_plugin_eslint_comments = __toESM(__eslint_community_eslint_plugin_eslint_comments);
|
|
17
42
|
let eslint_plugin_antfu = require("eslint-plugin-antfu");
|
|
18
|
-
eslint_plugin_antfu =
|
|
43
|
+
eslint_plugin_antfu = __toESM(eslint_plugin_antfu);
|
|
19
44
|
let eslint_plugin_import_lite = require("eslint-plugin-import-lite");
|
|
20
|
-
eslint_plugin_import_lite =
|
|
45
|
+
eslint_plugin_import_lite = __toESM(eslint_plugin_import_lite);
|
|
21
46
|
let eslint_plugin_n = require("eslint-plugin-n");
|
|
22
|
-
eslint_plugin_n =
|
|
47
|
+
eslint_plugin_n = __toESM(eslint_plugin_n);
|
|
23
48
|
let eslint_plugin_perfectionist = require("eslint-plugin-perfectionist");
|
|
24
|
-
eslint_plugin_perfectionist =
|
|
49
|
+
eslint_plugin_perfectionist = __toESM(eslint_plugin_perfectionist);
|
|
25
50
|
let eslint_plugin_unicorn = require("eslint-plugin-unicorn");
|
|
26
|
-
eslint_plugin_unicorn =
|
|
51
|
+
eslint_plugin_unicorn = __toESM(eslint_plugin_unicorn);
|
|
27
52
|
let eslint_plugin_unused_imports = require("eslint-plugin-unused-imports");
|
|
28
|
-
eslint_plugin_unused_imports =
|
|
53
|
+
eslint_plugin_unused_imports = __toESM(eslint_plugin_unused_imports);
|
|
29
54
|
let globals = require("globals");
|
|
30
|
-
globals =
|
|
55
|
+
globals = __toESM(globals);
|
|
31
56
|
let eslint_merge_processors = require("eslint-merge-processors");
|
|
32
|
-
eslint_merge_processors = require_chunk.__toESM(eslint_merge_processors);
|
|
33
57
|
let eslint_parser_plain = require("eslint-parser-plain");
|
|
34
|
-
eslint_parser_plain =
|
|
58
|
+
eslint_parser_plain = __toESM(eslint_parser_plain);
|
|
35
59
|
let eslint_plugin_regexp = require("eslint-plugin-regexp");
|
|
36
|
-
eslint_plugin_regexp = require_chunk.__toESM(eslint_plugin_regexp);
|
|
37
60
|
|
|
38
61
|
//#region node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
|
|
39
62
|
const toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
63
|
+
async function findUp(name, { cwd = node_process.default.cwd(), type = "file", stopAt } = {}) {
|
|
64
|
+
let directory = node_path.default.resolve(toPath(cwd) ?? "");
|
|
65
|
+
const { root } = node_path.default.parse(directory);
|
|
66
|
+
stopAt = node_path.default.resolve(directory, toPath(stopAt ?? root));
|
|
67
|
+
const isAbsoluteName = node_path.default.isAbsolute(name);
|
|
68
|
+
while (directory) {
|
|
69
|
+
const filePath = isAbsoluteName ? name : node_path.default.join(directory, name);
|
|
70
|
+
try {
|
|
71
|
+
const stats = await node_fs_promises.default.stat(filePath);
|
|
72
|
+
if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
|
|
73
|
+
} catch {}
|
|
74
|
+
if (directory === stopAt || directory === root) break;
|
|
75
|
+
directory = node_path.default.dirname(directory);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
40
78
|
function findUpSync(name, { cwd = node_process.default.cwd(), type = "file", stopAt } = {}) {
|
|
41
79
|
let directory = node_path.default.resolve(toPath(cwd) ?? "");
|
|
42
80
|
const { root } = node_path.default.parse(directory);
|
|
@@ -1007,37 +1045,125 @@ async function perfectionist(options = {}) {
|
|
|
1007
1045
|
|
|
1008
1046
|
//#endregion
|
|
1009
1047
|
//#region src/configs/pnpm.ts
|
|
1048
|
+
async function detectCatalogUsage() {
|
|
1049
|
+
const workspaceFile = await findUp("pnpm-workspace.yaml");
|
|
1050
|
+
if (!workspaceFile) return false;
|
|
1051
|
+
const yaml$1 = await node_fs_promises.default.readFile(workspaceFile, "utf-8");
|
|
1052
|
+
return yaml$1.includes("catalog:") || yaml$1.includes("catalogs:");
|
|
1053
|
+
}
|
|
1010
1054
|
async function pnpm(options = {}) {
|
|
1055
|
+
const { catalogs = await detectCatalogUsage(), isInEditor = false } = options;
|
|
1011
1056
|
const [pluginPnpm, yamlParser, jsoncParser] = await Promise.all([
|
|
1012
1057
|
interopDefault(import("eslint-plugin-pnpm")),
|
|
1013
1058
|
interopDefault(import("yaml-eslint-parser")),
|
|
1014
1059
|
interopDefault(import("jsonc-eslint-parser"))
|
|
1015
1060
|
]);
|
|
1016
|
-
return [
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1061
|
+
return [
|
|
1062
|
+
{
|
|
1063
|
+
files: ["package.json", "**/package.json"],
|
|
1064
|
+
languageOptions: { parser: jsoncParser },
|
|
1065
|
+
name: "eslint/pnpm/package-json",
|
|
1066
|
+
plugins: { pnpm: pluginPnpm },
|
|
1067
|
+
rules: {
|
|
1068
|
+
...catalogs ? { "pnpm/json-enforce-catalog": ["error", {
|
|
1069
|
+
autofix: !isInEditor,
|
|
1070
|
+
ignores: ["@types/vscode"]
|
|
1071
|
+
}] } : {},
|
|
1072
|
+
"pnpm/json-prefer-workspace-settings": ["error", { autofix: isInEditor }],
|
|
1073
|
+
"pnpm/json-valid-catalog": ["error", { autofix: isInEditor }]
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
files: ["pnpm-workspace.yaml"],
|
|
1078
|
+
languageOptions: { parser: yamlParser },
|
|
1079
|
+
name: "eslint/pnpm/pnpm-workspace-yaml",
|
|
1080
|
+
plugins: { pnpm: pluginPnpm },
|
|
1081
|
+
rules: {
|
|
1082
|
+
"pnpm/yaml-enforce-settings": ["error", { settings: {
|
|
1083
|
+
catalogMode: "prefer",
|
|
1084
|
+
shellEmulator: true
|
|
1085
|
+
} }],
|
|
1086
|
+
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
1087
|
+
"pnpm/yaml-no-unused-catalog-item": "error"
|
|
1088
|
+
}
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
files: ["pnpm-workspace.yaml"],
|
|
1092
|
+
name: "eslint/yaml/pnpm-workspace",
|
|
1093
|
+
rules: { "yaml/sort-keys": [
|
|
1094
|
+
"error",
|
|
1095
|
+
{
|
|
1096
|
+
order: [
|
|
1097
|
+
...[
|
|
1098
|
+
"cacheDir",
|
|
1099
|
+
"catalogMode",
|
|
1100
|
+
"cleanupUnusedCatalogs",
|
|
1101
|
+
"dedupeDirectDeps",
|
|
1102
|
+
"deployAllFiles",
|
|
1103
|
+
"enablePrePostScripts",
|
|
1104
|
+
"engineStrict",
|
|
1105
|
+
"extendNodePath",
|
|
1106
|
+
"hoist",
|
|
1107
|
+
"hoistPattern",
|
|
1108
|
+
"hoistWorkspacePackages",
|
|
1109
|
+
"ignoreCompatibilityDb",
|
|
1110
|
+
"ignoreDepScripts",
|
|
1111
|
+
"ignoreScripts",
|
|
1112
|
+
"ignoreWorkspaceRootCheck",
|
|
1113
|
+
"managePackageManagerVersions",
|
|
1114
|
+
"minimumReleaseAge",
|
|
1115
|
+
"minimumReleaseAgeExclude",
|
|
1116
|
+
"modulesDir",
|
|
1117
|
+
"nodeLinker",
|
|
1118
|
+
"nodeVersion",
|
|
1119
|
+
"optimisticRepeatInstall",
|
|
1120
|
+
"packageManagerStrict",
|
|
1121
|
+
"packageManagerStrictVersion",
|
|
1122
|
+
"preferSymlinkedExecutables",
|
|
1123
|
+
"preferWorkspacePackages",
|
|
1124
|
+
"publicHoistPattern",
|
|
1125
|
+
"registrySupportsTimeField",
|
|
1126
|
+
"requiredScripts",
|
|
1127
|
+
"resolutionMode",
|
|
1128
|
+
"savePrefix",
|
|
1129
|
+
"scriptShell",
|
|
1130
|
+
"shamefullyHoist",
|
|
1131
|
+
"shellEmulator",
|
|
1132
|
+
"stateDir",
|
|
1133
|
+
"supportedArchitectures",
|
|
1134
|
+
"symlink",
|
|
1135
|
+
"tag",
|
|
1136
|
+
"trustPolicy",
|
|
1137
|
+
"trustPolicyExclude",
|
|
1138
|
+
"updateNotifier"
|
|
1139
|
+
],
|
|
1140
|
+
"packages",
|
|
1141
|
+
"overrides",
|
|
1142
|
+
"patchedDependencies",
|
|
1143
|
+
"catalog",
|
|
1144
|
+
"catalogs",
|
|
1145
|
+
...[
|
|
1146
|
+
"allowedDeprecatedVersions",
|
|
1147
|
+
"allowNonAppliedPatches",
|
|
1148
|
+
"configDependencies",
|
|
1149
|
+
"ignoredBuiltDependencies",
|
|
1150
|
+
"ignoredOptionalDependencies",
|
|
1151
|
+
"neverBuiltDependencies",
|
|
1152
|
+
"onlyBuiltDependencies",
|
|
1153
|
+
"onlyBuiltDependenciesFile",
|
|
1154
|
+
"packageExtensions",
|
|
1155
|
+
"peerDependencyRules"
|
|
1156
|
+
]
|
|
1157
|
+
],
|
|
1158
|
+
pathPattern: "^$"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
order: { type: "asc" },
|
|
1162
|
+
pathPattern: ".*"
|
|
1163
|
+
}
|
|
1164
|
+
] }
|
|
1039
1165
|
}
|
|
1040
|
-
|
|
1166
|
+
];
|
|
1041
1167
|
}
|
|
1042
1168
|
|
|
1043
1169
|
//#endregion
|
|
@@ -1056,8 +1182,9 @@ const ReactRouterPackages = [
|
|
|
1056
1182
|
"@react-router/dev"
|
|
1057
1183
|
];
|
|
1058
1184
|
const NextJsPackages = ["next"];
|
|
1185
|
+
const ReactCompilerPackages = ["babel-plugin-react-compiler"];
|
|
1059
1186
|
async function react(options = {}) {
|
|
1060
|
-
const { files = [GLOB_SRC], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`], overrides = {}, tsconfigPath } = options;
|
|
1187
|
+
const { files = [GLOB_SRC], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`], overrides = {}, reactCompiler = ReactCompilerPackages.some((i) => (0, local_pkg.isPackageExists)(i)), tsconfigPath } = options;
|
|
1061
1188
|
await ensurePackages([
|
|
1062
1189
|
"@eslint-react/eslint-plugin",
|
|
1063
1190
|
"eslint-plugin-react-hooks",
|
|
@@ -1101,18 +1228,19 @@ async function react(options = {}) {
|
|
|
1101
1228
|
"react-dom/no-find-dom-node": "error",
|
|
1102
1229
|
"react-dom/no-flush-sync": "error",
|
|
1103
1230
|
"react-dom/no-hydrate": "error",
|
|
1104
|
-
"react-dom/no-missing-button-type": "warn",
|
|
1105
|
-
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1106
1231
|
"react-dom/no-namespace": "error",
|
|
1107
1232
|
"react-dom/no-render": "error",
|
|
1108
1233
|
"react-dom/no-render-return-value": "error",
|
|
1109
1234
|
"react-dom/no-script-url": "warn",
|
|
1110
1235
|
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1111
|
-
"react-dom/no-unsafe-target-blank": "warn",
|
|
1112
1236
|
"react-dom/no-use-form-state": "error",
|
|
1113
1237
|
"react-dom/no-void-elements-with-children": "error",
|
|
1238
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
1239
|
+
"react-hooks/rules-of-hooks": "error",
|
|
1240
|
+
"react/jsx-key-before-spread": "warn",
|
|
1114
1241
|
"react/jsx-no-comment-textnodes": "warn",
|
|
1115
1242
|
"react/jsx-no-duplicate-props": "warn",
|
|
1243
|
+
"react/jsx-uses-react": "warn",
|
|
1116
1244
|
"react/jsx-uses-vars": "warn",
|
|
1117
1245
|
"react/no-access-state-in-setstate": "error",
|
|
1118
1246
|
"react/no-array-index-key": "warn",
|
|
@@ -1129,11 +1257,12 @@ async function react(options = {}) {
|
|
|
1129
1257
|
"react/no-create-ref": "error",
|
|
1130
1258
|
"react/no-default-props": "error",
|
|
1131
1259
|
"react/no-direct-mutation-state": "error",
|
|
1132
|
-
"react/no-duplicate-key": "
|
|
1260
|
+
"react/no-duplicate-key": "error",
|
|
1133
1261
|
"react/no-forward-ref": "warn",
|
|
1134
1262
|
"react/no-implicit-key": "warn",
|
|
1135
1263
|
"react/no-missing-key": "error",
|
|
1136
1264
|
"react/no-nested-component-definitions": "error",
|
|
1265
|
+
"react/no-nested-lazy-component-declarations": "error",
|
|
1137
1266
|
"react/no-prop-types": "error",
|
|
1138
1267
|
"react/no-redundant-should-component-update": "error",
|
|
1139
1268
|
"react/no-set-state-in-component-did-mount": "warn",
|
|
@@ -1144,14 +1273,26 @@ async function react(options = {}) {
|
|
|
1144
1273
|
"react/no-unsafe-component-will-mount": "warn",
|
|
1145
1274
|
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1146
1275
|
"react/no-unsafe-component-will-update": "warn",
|
|
1147
|
-
"react/no-unstable-context-value": "warn",
|
|
1148
|
-
"react/no-unstable-default-props": "warn",
|
|
1149
|
-
"react/no-unused-class-component-members": "warn",
|
|
1150
|
-
"react/no-unused-state": "warn",
|
|
1151
1276
|
"react/no-use-context": "warn",
|
|
1152
1277
|
"react/no-useless-forward-ref": "warn",
|
|
1153
1278
|
"react/prefer-use-state-lazy-initialization": "warn",
|
|
1154
|
-
...
|
|
1279
|
+
...reactCompiler ? {
|
|
1280
|
+
"react-hooks/component-hook-factories": "error",
|
|
1281
|
+
"react-hooks/config": "error",
|
|
1282
|
+
"react-hooks/error-boundaries": "error",
|
|
1283
|
+
"react-hooks/gating": "error",
|
|
1284
|
+
"react-hooks/globals": "error",
|
|
1285
|
+
"react-hooks/immutability": "error",
|
|
1286
|
+
"react-hooks/incompatible-library": "warn",
|
|
1287
|
+
"react-hooks/preserve-manual-memoization": "error",
|
|
1288
|
+
"react-hooks/purity": "error",
|
|
1289
|
+
"react-hooks/refs": "error",
|
|
1290
|
+
"react-hooks/set-state-in-effect": "error",
|
|
1291
|
+
"react-hooks/set-state-in-render": "error",
|
|
1292
|
+
"react-hooks/static-components": "error",
|
|
1293
|
+
"react-hooks/unsupported-syntax": "warn",
|
|
1294
|
+
"react-hooks/use-memo": "error"
|
|
1295
|
+
} : {},
|
|
1155
1296
|
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1156
1297
|
"react-refresh/only-export-components": ["warn", {
|
|
1157
1298
|
allowConstantExport: isAllowConstantExport,
|
|
@@ -1664,7 +1805,7 @@ async function typescript(options = {}) {
|
|
|
1664
1805
|
}] : [],
|
|
1665
1806
|
...erasableOnly ? [{
|
|
1666
1807
|
name: "eslint/typescript/erasable-syntax-only",
|
|
1667
|
-
plugins: { "erasable-syntax-only": await interopDefault(
|
|
1808
|
+
plugins: { "erasable-syntax-only": await interopDefault(import("eslint-plugin-erasable-syntax-only")) },
|
|
1668
1809
|
rules: {
|
|
1669
1810
|
"erasable-syntax-only/enums": "error",
|
|
1670
1811
|
"erasable-syntax-only/import-aliases": "error",
|
|
@@ -1940,120 +2081,41 @@ async function yaml(options = {}) {
|
|
|
1940
2081
|
const { files = [GLOB_YAML], overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
1941
2082
|
const { quotes = "single" } = typeof stylistic$1 === "boolean" ? {} : stylistic$1;
|
|
1942
2083
|
const [pluginYaml, parserYaml] = await Promise.all([interopDefault(import("eslint-plugin-yml")), interopDefault(import("yaml-eslint-parser"))]);
|
|
1943
|
-
return [
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
{
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
"yaml/
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
} : {},
|
|
1977
|
-
...overrides
|
|
1978
|
-
}
|
|
1979
|
-
},
|
|
1980
|
-
{
|
|
1981
|
-
files: ["pnpm-workspace.yaml"],
|
|
1982
|
-
name: "eslint/yaml/pnpm-workspace",
|
|
1983
|
-
rules: { "yaml/sort-keys": [
|
|
1984
|
-
"error",
|
|
1985
|
-
{
|
|
1986
|
-
order: [
|
|
1987
|
-
...[
|
|
1988
|
-
"cacheDir",
|
|
1989
|
-
"catalogMode",
|
|
1990
|
-
"cleanupUnusedCatalogs",
|
|
1991
|
-
"dedupeDirectDeps",
|
|
1992
|
-
"deployAllFiles",
|
|
1993
|
-
"enablePrePostScripts",
|
|
1994
|
-
"engineStrict",
|
|
1995
|
-
"extendNodePath",
|
|
1996
|
-
"hoist",
|
|
1997
|
-
"hoistPattern",
|
|
1998
|
-
"hoistWorkspacePackages",
|
|
1999
|
-
"ignoreCompatibilityDb",
|
|
2000
|
-
"ignoreDepScripts",
|
|
2001
|
-
"ignoreScripts",
|
|
2002
|
-
"ignoreWorkspaceRootCheck",
|
|
2003
|
-
"managePackageManagerVersions",
|
|
2004
|
-
"minimumReleaseAge",
|
|
2005
|
-
"minimumReleaseAgeExclude",
|
|
2006
|
-
"modulesDir",
|
|
2007
|
-
"nodeLinker",
|
|
2008
|
-
"nodeVersion",
|
|
2009
|
-
"optimisticRepeatInstall",
|
|
2010
|
-
"packageManagerStrict",
|
|
2011
|
-
"packageManagerStrictVersion",
|
|
2012
|
-
"preferSymlinkedExecutables",
|
|
2013
|
-
"preferWorkspacePackages",
|
|
2014
|
-
"publicHoistPattern",
|
|
2015
|
-
"registrySupportsTimeField",
|
|
2016
|
-
"requiredScrpts",
|
|
2017
|
-
"resolutionMode",
|
|
2018
|
-
"savePrefix",
|
|
2019
|
-
"scriptShell",
|
|
2020
|
-
"shamefullyHoist",
|
|
2021
|
-
"shellEmulator",
|
|
2022
|
-
"stateDir",
|
|
2023
|
-
"supportedArchitectures",
|
|
2024
|
-
"symlink",
|
|
2025
|
-
"tag",
|
|
2026
|
-
"trustPolicy",
|
|
2027
|
-
"trustPolicyExclude",
|
|
2028
|
-
"updateNotifier"
|
|
2029
|
-
],
|
|
2030
|
-
"packages",
|
|
2031
|
-
"overrides",
|
|
2032
|
-
"patchedDependencies",
|
|
2033
|
-
"catalog",
|
|
2034
|
-
"catalogs",
|
|
2035
|
-
...[
|
|
2036
|
-
"allowedDeprecatedVersions",
|
|
2037
|
-
"allowNonAppliedPatches",
|
|
2038
|
-
"configDependencies",
|
|
2039
|
-
"ignoredBuiltDependencies",
|
|
2040
|
-
"ignoredOptionalDependencies",
|
|
2041
|
-
"neverBuiltDependencies",
|
|
2042
|
-
"onlyBuiltDependencies",
|
|
2043
|
-
"onlyBuiltDependenciesFile",
|
|
2044
|
-
"packageExtensions",
|
|
2045
|
-
"peerDependencyRules"
|
|
2046
|
-
]
|
|
2047
|
-
],
|
|
2048
|
-
pathPattern: "^$"
|
|
2049
|
-
},
|
|
2050
|
-
{
|
|
2051
|
-
order: { type: "asc" },
|
|
2052
|
-
pathPattern: ".*"
|
|
2053
|
-
}
|
|
2054
|
-
] }
|
|
2084
|
+
return [{
|
|
2085
|
+
name: "eslint/yaml/setup",
|
|
2086
|
+
plugins: { yaml: pluginYaml }
|
|
2087
|
+
}, {
|
|
2088
|
+
files,
|
|
2089
|
+
languageOptions: { parser: parserYaml },
|
|
2090
|
+
name: "eslint/yaml/rules",
|
|
2091
|
+
rules: {
|
|
2092
|
+
"style/spaced-comment": "off",
|
|
2093
|
+
"yaml/block-mapping": "error",
|
|
2094
|
+
"yaml/block-sequence": "error",
|
|
2095
|
+
"yaml/no-empty-key": "error",
|
|
2096
|
+
"yaml/no-empty-sequence-entry": "error",
|
|
2097
|
+
"yaml/no-irregular-whitespace": "error",
|
|
2098
|
+
"yaml/plain-scalar": "error",
|
|
2099
|
+
"yaml/vue-custom-block/no-parsing-error": "error",
|
|
2100
|
+
...stylistic$1 ? {
|
|
2101
|
+
"yaml/block-mapping-question-indicator-newline": "error",
|
|
2102
|
+
"yaml/block-sequence-hyphen-indicator-newline": "error",
|
|
2103
|
+
"yaml/flow-mapping-curly-newline": "error",
|
|
2104
|
+
"yaml/flow-mapping-curly-spacing": "error",
|
|
2105
|
+
"yaml/flow-sequence-bracket-newline": "error",
|
|
2106
|
+
"yaml/flow-sequence-bracket-spacing": "error",
|
|
2107
|
+
"yaml/indent": ["error", 2],
|
|
2108
|
+
"yaml/key-spacing": "error",
|
|
2109
|
+
"yaml/no-tab-indent": "error",
|
|
2110
|
+
"yaml/quotes": ["error", {
|
|
2111
|
+
avoidEscape: true,
|
|
2112
|
+
prefer: quotes === "backtick" ? "single" : quotes
|
|
2113
|
+
}],
|
|
2114
|
+
"yaml/spaced-comment": "error"
|
|
2115
|
+
} : {},
|
|
2116
|
+
...overrides
|
|
2055
2117
|
}
|
|
2056
|
-
];
|
|
2118
|
+
}];
|
|
2057
2119
|
}
|
|
2058
2120
|
|
|
2059
2121
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -387,6 +387,11 @@ interface RuleOptions {
|
|
|
387
387
|
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/consistent-type-specifier-style/README.md
|
|
388
388
|
*/
|
|
389
389
|
'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>;
|
|
390
|
+
/**
|
|
391
|
+
* Ensure all exports appear after other statements.
|
|
392
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/exports-last/README.md
|
|
393
|
+
*/
|
|
394
|
+
'import/exports-last'?: Linter.RuleEntry<[]>;
|
|
390
395
|
/**
|
|
391
396
|
* Ensure all imports appear before other statements.
|
|
392
397
|
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/first/README.md
|
|
@@ -4280,6 +4285,11 @@ interface RuleOptions {
|
|
|
4280
4285
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
4281
4286
|
*/
|
|
4282
4287
|
'test/no-test-return-statement'?: Linter.RuleEntry<[]>;
|
|
4288
|
+
/**
|
|
4289
|
+
* Disallow unnecessary async function wrapper for expected promises
|
|
4290
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
|
|
4291
|
+
*/
|
|
4292
|
+
'test/no-unneeded-async-expect-function'?: Linter.RuleEntry<[]>;
|
|
4283
4293
|
/**
|
|
4284
4294
|
* Enforce padding around `afterAll` blocks
|
|
4285
4295
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
@@ -5099,6 +5109,11 @@ interface RuleOptions {
|
|
|
5099
5109
|
* @see https://typescript-eslint.io/rules/no-useless-constructor
|
|
5100
5110
|
*/
|
|
5101
5111
|
'ts/no-useless-constructor'?: Linter.RuleEntry<[]>;
|
|
5112
|
+
/**
|
|
5113
|
+
* Disallow default values that will never be used
|
|
5114
|
+
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
5115
|
+
*/
|
|
5116
|
+
'ts/no-useless-default-assignment'?: Linter.RuleEntry<[]>;
|
|
5102
5117
|
/**
|
|
5103
5118
|
* Disallow empty exports that don't change anything in a module file
|
|
5104
5119
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
|
@@ -16264,7 +16279,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16264
16279
|
onlyEquality?: boolean;
|
|
16265
16280
|
}];
|
|
16266
16281
|
// Names of all the configs
|
|
16267
|
-
type ConfigNames = 'eslint/comments/rules' | 'eslint/formatter/setup' | 'eslint/formatter/html' | 'eslint/formatter/xml' | 'eslint/formatter/svg' | 'eslint/formatter/markdown' | 'eslint/formatter/graphql' | 'eslint/imports/rules' | 'eslint/javascript/setup' | 'eslint/javascript/rules' | 'eslint/jsdoc/rules' | 'eslint/jsonc/setup' | 'eslint/jsonc/rules' | 'eslint/markdown/setup' | 'eslint/markdown/processor' | 'eslint/markdown/parser' | 'eslint/markdown/disables' | 'eslint/node/rules' | 'eslint/perfectionist/setup' | 'eslint/react/setup' | 'eslint/react/rules' | 'eslint/regexp/rules' | 'eslint/sort/package-json' | 'eslint/stylistic/rules' | 'eslint/test/setup' | 'eslint/test/rules' | 'eslint/toml/setup' | 'eslint/toml/rules' | 'eslint/typescript/setup' | 'eslint/typescript/parser' | 'eslint/typescript/rules' | 'eslint/unicorn/rules' | 'eslint/unocss/rules' | 'eslint/vue/setup' | 'eslint/vue/rules' | 'eslint/yaml/setup' | 'eslint/yaml/rules'
|
|
16282
|
+
type ConfigNames = 'eslint/comments/rules' | 'eslint/formatter/setup' | 'eslint/formatter/html' | 'eslint/formatter/xml' | 'eslint/formatter/svg' | 'eslint/formatter/markdown' | 'eslint/formatter/graphql' | 'eslint/imports/rules' | 'eslint/javascript/setup' | 'eslint/javascript/rules' | 'eslint/jsdoc/rules' | 'eslint/jsonc/setup' | 'eslint/jsonc/rules' | 'eslint/markdown/setup' | 'eslint/markdown/processor' | 'eslint/markdown/parser' | 'eslint/markdown/disables' | 'eslint/node/rules' | 'eslint/perfectionist/setup' | 'eslint/react/setup' | 'eslint/react/rules' | 'eslint/regexp/rules' | 'eslint/sort/package-json' | 'eslint/stylistic/rules' | 'eslint/test/setup' | 'eslint/test/rules' | 'eslint/toml/setup' | 'eslint/toml/rules' | 'eslint/typescript/setup' | 'eslint/typescript/parser' | 'eslint/typescript/rules' | 'eslint/unicorn/rules' | 'eslint/unocss/rules' | 'eslint/vue/setup' | 'eslint/vue/rules' | 'eslint/yaml/setup' | 'eslint/yaml/rules';
|
|
16268
16283
|
//#endregion
|
|
16269
16284
|
//#region src/prettier.types.d.ts
|
|
16270
16285
|
/**
|
|
@@ -16422,6 +16437,9 @@ interface OptionsVue {
|
|
|
16422
16437
|
*/
|
|
16423
16438
|
sfcBlocks?: boolean | Options;
|
|
16424
16439
|
}
|
|
16440
|
+
interface OptionsReact extends OptionsFiles {
|
|
16441
|
+
reactCompiler?: boolean;
|
|
16442
|
+
}
|
|
16425
16443
|
type OptionsTypescript = (OptionsTypeScriptWithTypes & OptionsOverrides & OptionsTypeScriptErasableOnly) | (OptionsTypeScriptParserOptions & OptionsOverrides & OptionsTypeScriptErasableOnly);
|
|
16426
16444
|
interface OptionsFormatters {
|
|
16427
16445
|
/**
|
|
@@ -16574,6 +16592,12 @@ interface OptionsIgnores {
|
|
|
16574
16592
|
interface OptionsIsInEditor {
|
|
16575
16593
|
isInEditor?: boolean;
|
|
16576
16594
|
}
|
|
16595
|
+
interface OptionsPnpm extends OptionsIsInEditor {
|
|
16596
|
+
/**
|
|
16597
|
+
* 需要使用目录支持?
|
|
16598
|
+
*/
|
|
16599
|
+
catalogs?: boolean;
|
|
16600
|
+
}
|
|
16577
16601
|
interface OptionsUnoCSS {
|
|
16578
16602
|
/**
|
|
16579
16603
|
* 启用 attributify 支持.
|
|
@@ -16686,7 +16710,7 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
16686
16710
|
*
|
|
16687
16711
|
* @default 根据依赖关系自动检测
|
|
16688
16712
|
*/
|
|
16689
|
-
react?: boolean |
|
|
16713
|
+
react?: boolean | OptionsReact;
|
|
16690
16714
|
/**
|
|
16691
16715
|
* 启用 nextjs 支持.
|
|
16692
16716
|
*
|
|
@@ -16853,10 +16877,10 @@ declare function node(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]
|
|
|
16853
16877
|
declare function perfectionist(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
16854
16878
|
//#endregion
|
|
16855
16879
|
//#region src/configs/pnpm.d.ts
|
|
16856
|
-
declare function pnpm(options?:
|
|
16880
|
+
declare function pnpm(options?: OptionsPnpm): Promise<TypedFlatConfigItem[]>;
|
|
16857
16881
|
//#endregion
|
|
16858
16882
|
//#region src/configs/react.d.ts
|
|
16859
|
-
declare function react(options?: OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes & OptionsOverrides &
|
|
16883
|
+
declare function react(options?: OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes & OptionsOverrides & OptionsReact): Promise<TypedFlatConfigItem[]>;
|
|
16860
16884
|
//#endregion
|
|
16861
16885
|
//#region src/configs/regexp.d.ts
|
|
16862
16886
|
declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
@@ -16973,4 +16997,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
|
|
|
16973
16997
|
declare function isInEditorEnv(): boolean;
|
|
16974
16998
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
16975
16999
|
//#endregion
|
|
16976
|
-
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIgnores, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, lincy as default, lincy, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
17000
|
+
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIgnores, OptionsIsInEditor, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, lincy as default, lincy, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|