@sxzz/eslint-config 7.4.0 → 7.4.2
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 +10 -418
- package/dist/index.mjs +40 -29
- package/package.json +25 -24
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ import pluginJsdoc from "eslint-plugin-jsdoc";
|
|
|
13
13
|
import pluginIgnore from "eslint-config-flat-gitignore";
|
|
14
14
|
import pluginDeMorgan from "eslint-plugin-de-morgan";
|
|
15
15
|
import pluginPnpm from "eslint-plugin-pnpm";
|
|
16
|
-
import pluginImport from "eslint-plugin-
|
|
16
|
+
import pluginImport from "eslint-plugin-importer";
|
|
17
17
|
import pluginJsonc from "eslint-plugin-jsonc";
|
|
18
18
|
import pluginYml from "eslint-plugin-yml";
|
|
19
19
|
import configJs from "@eslint/js";
|
|
@@ -1098,241 +1098,40 @@ interface Rules {
|
|
|
1098
1098
|
"implicit-arrow-linebreak"?: Linter.RuleEntry<ImplicitArrowLinebreak>;
|
|
1099
1099
|
/**
|
|
1100
1100
|
* Enforce or ban the use of inline type-only markers for named imports.
|
|
1101
|
-
* @see https://github.com/
|
|
1101
|
+
* @see https://github.com/sxzz/eslint-plugin-ii/blob/main/src/rules/consistent-type-specifier-style.test.ts
|
|
1102
1102
|
*/
|
|
1103
1103
|
"import/consistent-type-specifier-style"?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>;
|
|
1104
1104
|
/**
|
|
1105
|
-
* Ensure a default export is present, given a default import.
|
|
1106
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/default.md
|
|
1107
|
-
*/
|
|
1108
|
-
"import/default"?: Linter.RuleEntry<[]>;
|
|
1109
|
-
/**
|
|
1110
|
-
* Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
1111
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/dynamic-import-chunkname.md
|
|
1112
|
-
*/
|
|
1113
|
-
"import/dynamic-import-chunkname"?: Linter.RuleEntry<ImportDynamicImportChunkname>;
|
|
1114
|
-
/**
|
|
1115
|
-
* Forbid any invalid exports, i.e. re-export of the same name.
|
|
1116
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/export.md
|
|
1117
|
-
*/
|
|
1118
|
-
"import/export"?: Linter.RuleEntry<[]>;
|
|
1119
|
-
/**
|
|
1120
|
-
* Ensure all exports appear after other statements.
|
|
1121
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/exports-last.md
|
|
1122
|
-
*/
|
|
1123
|
-
"import/exports-last"?: Linter.RuleEntry<[]>;
|
|
1124
|
-
/**
|
|
1125
|
-
* Ensure consistent use of file extension within the import path.
|
|
1126
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/extensions.md
|
|
1127
|
-
*/
|
|
1128
|
-
"import/extensions"?: Linter.RuleEntry<ImportExtensions>;
|
|
1129
|
-
/**
|
|
1130
1105
|
* Ensure all imports appear before other statements.
|
|
1131
|
-
* @see https://github.com/
|
|
1106
|
+
* @see https://github.com/sxzz/eslint-plugin-ii/blob/main/src/rules/first.test.ts
|
|
1132
1107
|
*/
|
|
1133
1108
|
"import/first"?: Linter.RuleEntry<ImportFirst>;
|
|
1134
1109
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
* @see https://github.com/
|
|
1137
|
-
*/
|
|
1138
|
-
"import/group-exports"?: Linter.RuleEntry<[]>;
|
|
1139
|
-
/**
|
|
1140
|
-
* Replaced by `import-x/first`.
|
|
1141
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/imports-first.md
|
|
1142
|
-
* @deprecated
|
|
1143
|
-
*/
|
|
1144
|
-
"import/imports-first"?: Linter.RuleEntry<ImportImportsFirst>;
|
|
1145
|
-
/**
|
|
1146
|
-
* Enforce the maximum number of dependencies a module can have.
|
|
1147
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/max-dependencies.md
|
|
1148
|
-
*/
|
|
1149
|
-
"import/max-dependencies"?: Linter.RuleEntry<ImportMaxDependencies>;
|
|
1150
|
-
/**
|
|
1151
|
-
* Ensure named imports correspond to a named export in the remote file.
|
|
1152
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/named.md
|
|
1153
|
-
*/
|
|
1154
|
-
"import/named"?: Linter.RuleEntry<ImportNamed>;
|
|
1155
|
-
/**
|
|
1156
|
-
* Ensure imported namespaces contain dereferenced properties as they are dereferenced.
|
|
1157
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/namespace.md
|
|
1110
|
+
* Fix duplication in imports
|
|
1111
|
+
* @see https://github.com/sxzz/eslint-plugin-ii/blob/main/src/rules/import-dedupe.test.ts
|
|
1158
1112
|
*/
|
|
1159
|
-
"import/
|
|
1113
|
+
"import/import-dedupe"?: Linter.RuleEntry<[]>;
|
|
1160
1114
|
/**
|
|
1161
1115
|
* Enforce a newline after import statements.
|
|
1162
|
-
* @see https://github.com/
|
|
1116
|
+
* @see https://github.com/sxzz/eslint-plugin-ii/blob/main/src/rules/newline-after-import.test.ts
|
|
1163
1117
|
*/
|
|
1164
1118
|
"import/newline-after-import"?: Linter.RuleEntry<ImportNewlineAfterImport>;
|
|
1165
1119
|
/**
|
|
1166
|
-
* Forbid import of modules using absolute paths.
|
|
1167
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-absolute-path.md
|
|
1168
|
-
*/
|
|
1169
|
-
"import/no-absolute-path"?: Linter.RuleEntry<ImportNoAbsolutePath>;
|
|
1170
|
-
/**
|
|
1171
|
-
* Forbid AMD `require` and `define` calls.
|
|
1172
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-amd.md
|
|
1173
|
-
*/
|
|
1174
|
-
"import/no-amd"?: Linter.RuleEntry<[]>;
|
|
1175
|
-
/**
|
|
1176
|
-
* Forbid anonymous values as default exports.
|
|
1177
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-anonymous-default-export.md
|
|
1178
|
-
*/
|
|
1179
|
-
"import/no-anonymous-default-export"?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>;
|
|
1180
|
-
/**
|
|
1181
|
-
* Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
|
|
1182
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-commonjs.md
|
|
1183
|
-
*/
|
|
1184
|
-
"import/no-commonjs"?: Linter.RuleEntry<ImportNoCommonjs>;
|
|
1185
|
-
/**
|
|
1186
|
-
* Forbid a module from importing a module with a dependency path back to itself.
|
|
1187
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-cycle.md
|
|
1188
|
-
*/
|
|
1189
|
-
"import/no-cycle"?: Linter.RuleEntry<ImportNoCycle>;
|
|
1190
|
-
/**
|
|
1191
1120
|
* Forbid default exports.
|
|
1192
|
-
* @see https://github.com/
|
|
1121
|
+
* @see https://github.com/sxzz/eslint-plugin-ii/blob/main/src/rules/no-default-export.test.ts
|
|
1193
1122
|
*/
|
|
1194
1123
|
"import/no-default-export"?: Linter.RuleEntry<[]>;
|
|
1195
1124
|
/**
|
|
1196
|
-
* Forbid imported names marked with `@deprecated` documentation tag.
|
|
1197
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-deprecated.md
|
|
1198
|
-
*/
|
|
1199
|
-
"import/no-deprecated"?: Linter.RuleEntry<[]>;
|
|
1200
|
-
/**
|
|
1201
|
-
* Forbid repeated import of the same module in multiple places.
|
|
1202
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-duplicates.md
|
|
1203
|
-
*/
|
|
1204
|
-
"import/no-duplicates"?: Linter.RuleEntry<ImportNoDuplicates>;
|
|
1205
|
-
/**
|
|
1206
|
-
* Forbid `require()` calls with expressions.
|
|
1207
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-dynamic-require.md
|
|
1208
|
-
*/
|
|
1209
|
-
"import/no-dynamic-require"?: Linter.RuleEntry<ImportNoDynamicRequire>;
|
|
1210
|
-
/**
|
|
1211
|
-
* Forbid empty named import blocks.
|
|
1212
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-empty-named-blocks.md
|
|
1213
|
-
*/
|
|
1214
|
-
"import/no-empty-named-blocks"?: Linter.RuleEntry<[]>;
|
|
1215
|
-
/**
|
|
1216
|
-
* Forbid the use of extraneous packages.
|
|
1217
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-extraneous-dependencies.md
|
|
1218
|
-
*/
|
|
1219
|
-
"import/no-extraneous-dependencies"?: Linter.RuleEntry<ImportNoExtraneousDependencies>;
|
|
1220
|
-
/**
|
|
1221
|
-
* Forbid import statements with CommonJS module.exports.
|
|
1222
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-import-module-exports.md
|
|
1223
|
-
*/
|
|
1224
|
-
"import/no-import-module-exports"?: Linter.RuleEntry<ImportNoImportModuleExports>;
|
|
1225
|
-
/**
|
|
1226
|
-
* Forbid importing the submodules of other modules.
|
|
1227
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-internal-modules.md
|
|
1228
|
-
*/
|
|
1229
|
-
"import/no-internal-modules"?: Linter.RuleEntry<ImportNoInternalModules>;
|
|
1230
|
-
/**
|
|
1231
1125
|
* Forbid the use of mutable exports with `var` or `let`.
|
|
1232
|
-
* @see https://github.com/
|
|
1126
|
+
* @see https://github.com/sxzz/eslint-plugin-ii/blob/main/src/rules/no-mutable-exports.test.ts
|
|
1233
1127
|
*/
|
|
1234
1128
|
"import/no-mutable-exports"?: Linter.RuleEntry<[]>;
|
|
1235
1129
|
/**
|
|
1236
|
-
* Forbid use of exported name as identifier of default export.
|
|
1237
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-named-as-default.md
|
|
1238
|
-
*/
|
|
1239
|
-
"import/no-named-as-default"?: Linter.RuleEntry<[]>;
|
|
1240
|
-
/**
|
|
1241
|
-
* Forbid use of exported name as property of default export.
|
|
1242
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-named-as-default-member.md
|
|
1243
|
-
*/
|
|
1244
|
-
"import/no-named-as-default-member"?: Linter.RuleEntry<[]>;
|
|
1245
|
-
/**
|
|
1246
1130
|
* Forbid named default exports.
|
|
1247
|
-
* @see https://github.com/
|
|
1131
|
+
* @see https://github.com/sxzz/eslint-plugin-ii/blob/main/src/rules/no-named-default.test.ts
|
|
1248
1132
|
*/
|
|
1249
1133
|
"import/no-named-default"?: Linter.RuleEntry<[]>;
|
|
1250
1134
|
/**
|
|
1251
|
-
* Forbid named exports.
|
|
1252
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-named-export.md
|
|
1253
|
-
*/
|
|
1254
|
-
"import/no-named-export"?: Linter.RuleEntry<[]>;
|
|
1255
|
-
/**
|
|
1256
|
-
* Forbid namespace (a.k.a. "wildcard" `*`) imports.
|
|
1257
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-namespace.md
|
|
1258
|
-
*/
|
|
1259
|
-
"import/no-namespace"?: Linter.RuleEntry<ImportNoNamespace>;
|
|
1260
|
-
/**
|
|
1261
|
-
* Forbid Node.js builtin modules.
|
|
1262
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-nodejs-modules.md
|
|
1263
|
-
*/
|
|
1264
|
-
"import/no-nodejs-modules"?: Linter.RuleEntry<ImportNoNodejsModules>;
|
|
1265
|
-
/**
|
|
1266
|
-
* Forbid importing packages through relative paths.
|
|
1267
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-relative-packages.md
|
|
1268
|
-
*/
|
|
1269
|
-
"import/no-relative-packages"?: Linter.RuleEntry<ImportNoRelativePackages>;
|
|
1270
|
-
/**
|
|
1271
|
-
* Forbid importing modules from parent directories.
|
|
1272
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-relative-parent-imports.md
|
|
1273
|
-
*/
|
|
1274
|
-
"import/no-relative-parent-imports"?: Linter.RuleEntry<ImportNoRelativeParentImports>;
|
|
1275
|
-
/**
|
|
1276
|
-
* Forbid importing a default export by a different name.
|
|
1277
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-rename-default.md
|
|
1278
|
-
*/
|
|
1279
|
-
"import/no-rename-default"?: Linter.RuleEntry<ImportNoRenameDefault>;
|
|
1280
|
-
/**
|
|
1281
|
-
* Enforce which files can be imported in a given folder.
|
|
1282
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-restricted-paths.md
|
|
1283
|
-
*/
|
|
1284
|
-
"import/no-restricted-paths"?: Linter.RuleEntry<ImportNoRestrictedPaths>;
|
|
1285
|
-
/**
|
|
1286
|
-
* Forbid a module from importing itself.
|
|
1287
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-self-import.md
|
|
1288
|
-
*/
|
|
1289
|
-
"import/no-self-import"?: Linter.RuleEntry<[]>;
|
|
1290
|
-
/**
|
|
1291
|
-
* Forbid unassigned imports.
|
|
1292
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-unassigned-import.md
|
|
1293
|
-
*/
|
|
1294
|
-
"import/no-unassigned-import"?: Linter.RuleEntry<ImportNoUnassignedImport>;
|
|
1295
|
-
/**
|
|
1296
|
-
* Ensure imports point to a file/module that can be resolved.
|
|
1297
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-unresolved.md
|
|
1298
|
-
*/
|
|
1299
|
-
"import/no-unresolved"?: Linter.RuleEntry<ImportNoUnresolved>;
|
|
1300
|
-
/**
|
|
1301
|
-
* Forbid modules without exports, or exports without matching import in another module.
|
|
1302
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-unused-modules.md
|
|
1303
|
-
*/
|
|
1304
|
-
"import/no-unused-modules"?: Linter.RuleEntry<ImportNoUnusedModules>;
|
|
1305
|
-
/**
|
|
1306
|
-
* Forbid unnecessary path segments in import and require statements.
|
|
1307
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-useless-path-segments.md
|
|
1308
|
-
*/
|
|
1309
|
-
"import/no-useless-path-segments"?: Linter.RuleEntry<ImportNoUselessPathSegments>;
|
|
1310
|
-
/**
|
|
1311
|
-
* Forbid webpack loader syntax in imports.
|
|
1312
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/no-webpack-loader-syntax.md
|
|
1313
|
-
*/
|
|
1314
|
-
"import/no-webpack-loader-syntax"?: Linter.RuleEntry<[]>;
|
|
1315
|
-
/**
|
|
1316
|
-
* Enforce a convention in module import order.
|
|
1317
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/order.md
|
|
1318
|
-
*/
|
|
1319
|
-
"import/order"?: Linter.RuleEntry<ImportOrder>;
|
|
1320
|
-
/**
|
|
1321
|
-
* Prefer a default export if module exports a single name or multiple names.
|
|
1322
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/prefer-default-export.md
|
|
1323
|
-
*/
|
|
1324
|
-
"import/prefer-default-export"?: Linter.RuleEntry<ImportPreferDefaultExport>;
|
|
1325
|
-
/**
|
|
1326
|
-
* Enforce using namespace imports for specific modules, like `react`/`react-dom`, etc.
|
|
1327
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/prefer-namespace-import.md
|
|
1328
|
-
*/
|
|
1329
|
-
"import/prefer-namespace-import"?: Linter.RuleEntry<ImportPreferNamespaceImport>;
|
|
1330
|
-
/**
|
|
1331
|
-
* Forbid potentially ambiguous parse goal (`script` vs. `module`).
|
|
1332
|
-
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/unambiguous.md
|
|
1333
|
-
*/
|
|
1334
|
-
"import/unambiguous"?: Linter.RuleEntry<[]>;
|
|
1335
|
-
/**
|
|
1336
1135
|
* Enforce consistent indentation
|
|
1337
1136
|
* @see https://eslint.org/docs/latest/rules/indent
|
|
1338
1137
|
* @deprecated
|
|
@@ -7315,219 +7114,12 @@ type IdMatch = [] | [string] | [string, {
|
|
|
7315
7114
|
}];
|
|
7316
7115
|
type ImplicitArrowLinebreak = [] | [("beside" | "below")];
|
|
7317
7116
|
type ImportConsistentTypeSpecifierStyle = [] | [("prefer-top-level" | "prefer-inline")];
|
|
7318
|
-
type ImportDynamicImportChunkname = [] | [{
|
|
7319
|
-
importFunctions?: string[];
|
|
7320
|
-
allowEmpty?: boolean;
|
|
7321
|
-
webpackChunknameFormat?: string;
|
|
7322
|
-
[k: string]: unknown | undefined;
|
|
7323
|
-
}];
|
|
7324
|
-
type ImportExtensions = ([] | [("always" | "ignorePackages" | "never")] | [] | [("always" | "ignorePackages" | "never")] | [("always" | "ignorePackages" | "never"), {
|
|
7325
|
-
pattern?: {
|
|
7326
|
-
[k: string]: ("always" | "ignorePackages" | "never");
|
|
7327
|
-
};
|
|
7328
|
-
ignorePackages?: boolean;
|
|
7329
|
-
checkTypeImports?: boolean;
|
|
7330
|
-
pathGroupOverrides?: {
|
|
7331
|
-
pattern: string;
|
|
7332
|
-
patternOptions?: {
|
|
7333
|
-
[k: string]: unknown | undefined;
|
|
7334
|
-
};
|
|
7335
|
-
action: ("enforce" | "ignore");
|
|
7336
|
-
}[];
|
|
7337
|
-
fix?: boolean;
|
|
7338
|
-
[k: string]: unknown | undefined;
|
|
7339
|
-
}] | [] | [{
|
|
7340
|
-
pattern?: {
|
|
7341
|
-
[k: string]: ("always" | "ignorePackages" | "never");
|
|
7342
|
-
};
|
|
7343
|
-
ignorePackages?: boolean;
|
|
7344
|
-
checkTypeImports?: boolean;
|
|
7345
|
-
pathGroupOverrides?: {
|
|
7346
|
-
pattern: string;
|
|
7347
|
-
patternOptions?: {
|
|
7348
|
-
[k: string]: unknown | undefined;
|
|
7349
|
-
};
|
|
7350
|
-
action: ("enforce" | "ignore");
|
|
7351
|
-
}[];
|
|
7352
|
-
fix?: boolean;
|
|
7353
|
-
[k: string]: unknown | undefined;
|
|
7354
|
-
}] | [] | [("always" | "ignorePackages" | "never")] | [("always" | "ignorePackages" | "never"), {
|
|
7355
|
-
[k: string]: ("always" | "ignorePackages" | "never");
|
|
7356
|
-
}] | [] | [{
|
|
7357
|
-
[k: string]: ("always" | "ignorePackages" | "never");
|
|
7358
|
-
}]);
|
|
7359
7117
|
type ImportFirst = [] | [("absolute-first" | "disable-absolute-first")];
|
|
7360
|
-
type ImportImportsFirst = [] | [("absolute-first" | "disable-absolute-first")];
|
|
7361
|
-
type ImportMaxDependencies = [] | [{
|
|
7362
|
-
max?: number;
|
|
7363
|
-
ignoreTypeImports?: boolean;
|
|
7364
|
-
}];
|
|
7365
|
-
type ImportNamed = [] | [{
|
|
7366
|
-
commonjs?: boolean;
|
|
7367
|
-
}];
|
|
7368
|
-
type ImportNamespace = [] | [{
|
|
7369
|
-
allowComputed?: boolean;
|
|
7370
|
-
}];
|
|
7371
7118
|
type ImportNewlineAfterImport = [] | [{
|
|
7372
7119
|
count?: number;
|
|
7373
7120
|
exactCount?: boolean;
|
|
7374
7121
|
considerComments?: boolean;
|
|
7375
7122
|
}];
|
|
7376
|
-
type ImportNoAbsolutePath = [] | [{
|
|
7377
|
-
commonjs?: boolean;
|
|
7378
|
-
amd?: boolean;
|
|
7379
|
-
esmodule?: boolean;
|
|
7380
|
-
ignore?: [string, ...(string)[]];
|
|
7381
|
-
}];
|
|
7382
|
-
type ImportNoAnonymousDefaultExport = [] | [{
|
|
7383
|
-
allowArray?: boolean;
|
|
7384
|
-
allowArrowFunction?: boolean;
|
|
7385
|
-
allowCallExpression?: boolean;
|
|
7386
|
-
allowAnonymousClass?: boolean;
|
|
7387
|
-
allowAnonymousFunction?: boolean;
|
|
7388
|
-
allowLiteral?: boolean;
|
|
7389
|
-
allowObject?: boolean;
|
|
7390
|
-
allowNew?: boolean;
|
|
7391
|
-
}];
|
|
7392
|
-
type ImportNoCommonjs = ([] | ["allow-primitive-modules"] | [] | [{
|
|
7393
|
-
allowPrimitiveModules?: boolean;
|
|
7394
|
-
allowRequire?: boolean;
|
|
7395
|
-
allowConditionalRequire?: boolean;
|
|
7396
|
-
}]);
|
|
7397
|
-
type ImportNoCycle = [] | [{
|
|
7398
|
-
commonjs?: boolean;
|
|
7399
|
-
amd?: boolean;
|
|
7400
|
-
esmodule?: boolean;
|
|
7401
|
-
ignore?: [string, ...(string)[]];
|
|
7402
|
-
maxDepth?: (number | "∞");
|
|
7403
|
-
ignoreExternal?: boolean;
|
|
7404
|
-
allowUnsafeDynamicCyclicDependency?: boolean;
|
|
7405
|
-
}];
|
|
7406
|
-
type ImportNoDuplicates = [] | [{
|
|
7407
|
-
considerQueryString?: boolean;
|
|
7408
|
-
"prefer-inline"?: boolean;
|
|
7409
|
-
}];
|
|
7410
|
-
type ImportNoDynamicRequire = [] | [{
|
|
7411
|
-
esmodule?: boolean;
|
|
7412
|
-
}];
|
|
7413
|
-
type ImportNoExtraneousDependencies = [] | [{
|
|
7414
|
-
devDependencies?: (boolean | unknown[]);
|
|
7415
|
-
optionalDependencies?: (boolean | unknown[]);
|
|
7416
|
-
peerDependencies?: (boolean | unknown[]);
|
|
7417
|
-
bundledDependencies?: (boolean | unknown[]);
|
|
7418
|
-
packageDir?: (string | unknown[]);
|
|
7419
|
-
includeInternal?: boolean;
|
|
7420
|
-
includeTypes?: boolean;
|
|
7421
|
-
whitelist?: unknown[];
|
|
7422
|
-
}];
|
|
7423
|
-
type ImportNoImportModuleExports = [] | [{
|
|
7424
|
-
exceptions?: unknown[];
|
|
7425
|
-
}];
|
|
7426
|
-
type ImportNoInternalModules = [] | [({
|
|
7427
|
-
allow?: string[];
|
|
7428
|
-
} | {
|
|
7429
|
-
forbid?: string[];
|
|
7430
|
-
})];
|
|
7431
|
-
type ImportNoNamespace = [] | [{
|
|
7432
|
-
ignore?: string[];
|
|
7433
|
-
[k: string]: unknown | undefined;
|
|
7434
|
-
}];
|
|
7435
|
-
type ImportNoNodejsModules = [] | [{
|
|
7436
|
-
allow?: string[];
|
|
7437
|
-
}];
|
|
7438
|
-
type ImportNoRelativePackages = [] | [{
|
|
7439
|
-
commonjs?: boolean;
|
|
7440
|
-
amd?: boolean;
|
|
7441
|
-
esmodule?: boolean;
|
|
7442
|
-
ignore?: [string, ...(string)[]];
|
|
7443
|
-
}];
|
|
7444
|
-
type ImportNoRelativeParentImports = [] | [{
|
|
7445
|
-
commonjs?: boolean;
|
|
7446
|
-
amd?: boolean;
|
|
7447
|
-
esmodule?: boolean;
|
|
7448
|
-
ignore?: [string, ...(string)[]];
|
|
7449
|
-
}];
|
|
7450
|
-
type ImportNoRenameDefault = [] | [{
|
|
7451
|
-
commonjs?: boolean;
|
|
7452
|
-
preventRenamingBindings?: boolean;
|
|
7453
|
-
}];
|
|
7454
|
-
type ImportNoRestrictedPaths = [] | [{
|
|
7455
|
-
zones?: [{
|
|
7456
|
-
target?: (string | [string, ...(string)[]]);
|
|
7457
|
-
from?: (string | [string, ...(string)[]]);
|
|
7458
|
-
except?: string[];
|
|
7459
|
-
message?: string;
|
|
7460
|
-
}, ...({
|
|
7461
|
-
target?: (string | [string, ...(string)[]]);
|
|
7462
|
-
from?: (string | [string, ...(string)[]]);
|
|
7463
|
-
except?: string[];
|
|
7464
|
-
message?: string;
|
|
7465
|
-
})[]];
|
|
7466
|
-
basePath?: string;
|
|
7467
|
-
}];
|
|
7468
|
-
type ImportNoUnassignedImport = [] | [{
|
|
7469
|
-
devDependencies?: (boolean | unknown[]);
|
|
7470
|
-
optionalDependencies?: (boolean | unknown[]);
|
|
7471
|
-
peerDependencies?: (boolean | unknown[]);
|
|
7472
|
-
allow?: string[];
|
|
7473
|
-
}];
|
|
7474
|
-
type ImportNoUnresolved = [] | [{
|
|
7475
|
-
commonjs?: boolean;
|
|
7476
|
-
amd?: boolean;
|
|
7477
|
-
esmodule?: boolean;
|
|
7478
|
-
ignore?: [string, ...(string)[]];
|
|
7479
|
-
caseSensitive?: boolean;
|
|
7480
|
-
caseSensitiveStrict?: boolean;
|
|
7481
|
-
}];
|
|
7482
|
-
type ImportNoUnusedModules = [] | [({
|
|
7483
|
-
unusedExports: true;
|
|
7484
|
-
src?: [unknown, ...(unknown)[]];
|
|
7485
|
-
[k: string]: unknown | undefined;
|
|
7486
|
-
} | {
|
|
7487
|
-
missingExports: true;
|
|
7488
|
-
[k: string]: unknown | undefined;
|
|
7489
|
-
})];
|
|
7490
|
-
type ImportNoUselessPathSegments = [] | [{
|
|
7491
|
-
commonjs?: boolean;
|
|
7492
|
-
noUselessIndex?: boolean;
|
|
7493
|
-
}];
|
|
7494
|
-
type ImportOrder = [] | [{
|
|
7495
|
-
groups?: unknown[];
|
|
7496
|
-
pathGroupsExcludedImportTypes?: unknown[];
|
|
7497
|
-
distinctGroup?: boolean;
|
|
7498
|
-
pathGroups?: {
|
|
7499
|
-
pattern: string;
|
|
7500
|
-
patternOptions?: {
|
|
7501
|
-
[k: string]: unknown | undefined;
|
|
7502
|
-
};
|
|
7503
|
-
group: ("builtin" | "external" | "internal" | "unknown" | "parent" | "sibling" | "index" | "object" | "type");
|
|
7504
|
-
position?: ("after" | "before");
|
|
7505
|
-
}[];
|
|
7506
|
-
"newlines-between"?: ("ignore" | "always" | "always-and-inside-groups" | "never");
|
|
7507
|
-
"newlines-between-types"?: ("ignore" | "always" | "always-and-inside-groups" | "never");
|
|
7508
|
-
consolidateIslands?: ("inside-groups" | "never");
|
|
7509
|
-
sortTypesGroup?: boolean;
|
|
7510
|
-
named?: (boolean | {
|
|
7511
|
-
enabled?: boolean;
|
|
7512
|
-
import?: boolean;
|
|
7513
|
-
export?: boolean;
|
|
7514
|
-
require?: boolean;
|
|
7515
|
-
cjsExports?: boolean;
|
|
7516
|
-
types?: ("mixed" | "types-first" | "types-last");
|
|
7517
|
-
});
|
|
7518
|
-
alphabetize?: {
|
|
7519
|
-
caseInsensitive?: boolean;
|
|
7520
|
-
order?: ("ignore" | "asc" | "desc");
|
|
7521
|
-
orderImportKind?: ("ignore" | "asc" | "desc");
|
|
7522
|
-
};
|
|
7523
|
-
warnOnUnassignedImports?: boolean;
|
|
7524
|
-
}];
|
|
7525
|
-
type ImportPreferDefaultExport = [] | [{
|
|
7526
|
-
target?: ("single" | "any");
|
|
7527
|
-
}];
|
|
7528
|
-
type ImportPreferNamespaceImport = [] | [{
|
|
7529
|
-
patterns?: string[];
|
|
7530
|
-
}];
|
|
7531
7123
|
type Indent = [] | [("tab" | number)] | [("tab" | number), {
|
|
7532
7124
|
SwitchCase?: number;
|
|
7533
7125
|
VariableDeclarator?: ((number | ("first" | "off")) | {
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import pluginJsdoc from "eslint-plugin-jsdoc";
|
|
|
16
16
|
import pluginIgnore from "eslint-config-flat-gitignore";
|
|
17
17
|
import pluginDeMorgan from "eslint-plugin-de-morgan";
|
|
18
18
|
import pluginPnpm from "eslint-plugin-pnpm";
|
|
19
|
-
import pluginImport from "eslint-plugin-
|
|
19
|
+
import pluginImport from "eslint-plugin-importer";
|
|
20
20
|
const pluginJsonc = __cjs_require("eslint-plugin-jsonc");
|
|
21
21
|
const pluginYml = __cjs_require("eslint-plugin-yml");
|
|
22
22
|
const configJs = __cjs_require("@eslint/js");
|
|
@@ -155,11 +155,8 @@ const imports = () => [{
|
|
|
155
155
|
"antfu/import-dedupe": "error",
|
|
156
156
|
"import/first": "error",
|
|
157
157
|
"import/no-default-export": "error",
|
|
158
|
-
"import/no-duplicates": "error",
|
|
159
158
|
"import/no-mutable-exports": "error",
|
|
160
|
-
"import/no-named-default": "error"
|
|
161
|
-
"import/no-self-import": "error",
|
|
162
|
-
"import/no-webpack-loader-syntax": "error"
|
|
159
|
+
"import/no-named-default": "error"
|
|
163
160
|
}
|
|
164
161
|
}];
|
|
165
162
|
|
|
@@ -411,42 +408,44 @@ const sortPackageJson = () => [{
|
|
|
411
408
|
"error",
|
|
412
409
|
{
|
|
413
410
|
order: [
|
|
411
|
+
"publisher",
|
|
414
412
|
"name",
|
|
413
|
+
"displayName",
|
|
414
|
+
"type",
|
|
415
415
|
"version",
|
|
416
416
|
"private",
|
|
417
417
|
"packageManager",
|
|
418
418
|
"description",
|
|
419
|
-
"type",
|
|
420
|
-
"keywords",
|
|
421
|
-
"license",
|
|
422
|
-
"homepage",
|
|
423
|
-
"bugs",
|
|
424
|
-
"repository",
|
|
425
419
|
"author",
|
|
426
420
|
"contributors",
|
|
421
|
+
"license",
|
|
427
422
|
"funding",
|
|
428
|
-
"
|
|
423
|
+
"homepage",
|
|
424
|
+
"repository",
|
|
425
|
+
"bugs",
|
|
426
|
+
"keywords",
|
|
427
|
+
"categories",
|
|
428
|
+
"sideEffects",
|
|
429
|
+
"imports",
|
|
430
|
+
"exports",
|
|
429
431
|
"main",
|
|
430
432
|
"module",
|
|
431
|
-
"types",
|
|
432
|
-
"exports",
|
|
433
|
-
"typesVersions",
|
|
434
|
-
"sideEffects",
|
|
435
433
|
"unpkg",
|
|
436
434
|
"jsdelivr",
|
|
437
|
-
"
|
|
435
|
+
"types",
|
|
436
|
+
"typesVersions",
|
|
438
437
|
"bin",
|
|
439
|
-
"
|
|
440
|
-
"
|
|
441
|
-
"
|
|
438
|
+
"icon",
|
|
439
|
+
"files",
|
|
440
|
+
"engines",
|
|
441
|
+
"activationEvents",
|
|
442
|
+
"contributes",
|
|
442
443
|
"scripts",
|
|
443
444
|
"peerDependencies",
|
|
444
445
|
"peerDependenciesMeta",
|
|
445
|
-
"optionalDependencies",
|
|
446
446
|
"dependencies",
|
|
447
|
+
"optionalDependencies",
|
|
447
448
|
"devDependencies",
|
|
448
|
-
"engines",
|
|
449
|
-
"config",
|
|
450
449
|
"pnpm",
|
|
451
450
|
"overrides",
|
|
452
451
|
"resolutions",
|
|
@@ -480,7 +479,7 @@ const sortPackageJson = () => [{
|
|
|
480
479
|
}
|
|
481
480
|
}];
|
|
482
481
|
const sortTsconfig = () => [{
|
|
483
|
-
files: ["**/
|
|
482
|
+
files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
|
|
484
483
|
name: "sxzz/sort/tsconfig",
|
|
485
484
|
rules: { "jsonc/sort-keys": [
|
|
486
485
|
"error",
|
|
@@ -515,6 +514,7 @@ const sortTsconfig = () => [{
|
|
|
515
514
|
"useDefineForClassFields",
|
|
516
515
|
"emitDecoratorMetadata",
|
|
517
516
|
"experimentalDecorators",
|
|
517
|
+
"libReplacement",
|
|
518
518
|
"baseUrl",
|
|
519
519
|
"rootDir",
|
|
520
520
|
"rootDirs",
|
|
@@ -564,7 +564,6 @@ const sortTsconfig = () => [{
|
|
|
564
564
|
"importsNotUsedAsValues",
|
|
565
565
|
"inlineSourceMap",
|
|
566
566
|
"inlineSources",
|
|
567
|
-
"isolatedDeclarations",
|
|
568
567
|
"mapRoot",
|
|
569
568
|
"newLine",
|
|
570
569
|
"noEmit",
|
|
@@ -579,12 +578,13 @@ const sortTsconfig = () => [{
|
|
|
579
578
|
"sourceRoot",
|
|
580
579
|
"stripInternal",
|
|
581
580
|
"allowSyntheticDefaultImports",
|
|
582
|
-
"erasableSyntaxOnly",
|
|
583
581
|
"esModuleInterop",
|
|
584
582
|
"forceConsistentCasingInFileNames",
|
|
583
|
+
"isolatedDeclarations",
|
|
585
584
|
"isolatedModules",
|
|
586
585
|
"preserveSymlinks",
|
|
587
586
|
"verbatimModuleSyntax",
|
|
587
|
+
"erasableSyntaxOnly",
|
|
588
588
|
"skipDefaultLibCheck",
|
|
589
589
|
"skipLibCheck"
|
|
590
590
|
],
|
|
@@ -625,6 +625,10 @@ const sortImports = () => [{
|
|
|
625
625
|
name: "sxzz/sort/imports",
|
|
626
626
|
plugins: { perfectionist: pluginPerfectionist },
|
|
627
627
|
rules: {
|
|
628
|
+
"perfectionist/sort-exports": ["error", {
|
|
629
|
+
groups: ["value-export", "type-export"],
|
|
630
|
+
type: "natural"
|
|
631
|
+
}],
|
|
628
632
|
"perfectionist/sort-imports": ["warn", {
|
|
629
633
|
groups: [
|
|
630
634
|
"builtin",
|
|
@@ -643,10 +647,17 @@ const sortImports = () => [{
|
|
|
643
647
|
"side-effect-style"
|
|
644
648
|
],
|
|
645
649
|
internalPattern: ["^[~@#]/.*"],
|
|
646
|
-
newlinesBetween: "ignore"
|
|
650
|
+
newlinesBetween: "ignore",
|
|
651
|
+
type: "natural"
|
|
652
|
+
}],
|
|
653
|
+
"perfectionist/sort-named-exports": ["warn", {
|
|
654
|
+
groupKind: "values-first",
|
|
655
|
+
type: "natural"
|
|
647
656
|
}],
|
|
648
|
-
"perfectionist/sort-named-
|
|
649
|
-
|
|
657
|
+
"perfectionist/sort-named-imports": ["warn", {
|
|
658
|
+
groupKind: "values-first",
|
|
659
|
+
type: "natural"
|
|
660
|
+
}]
|
|
650
661
|
}
|
|
651
662
|
}];
|
|
652
663
|
|
package/package.json
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sxzz/eslint-config",
|
|
3
|
-
"version": "7.4.0",
|
|
4
|
-
"description": "ESLint config for @sxzz.",
|
|
5
3
|
"type": "module",
|
|
4
|
+
"version": "7.4.2",
|
|
5
|
+
"description": "ESLint config for @sxzz.",
|
|
6
|
+
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
6
7
|
"license": "MIT",
|
|
8
|
+
"funding": "https://github.com/sponsors/sxzz",
|
|
7
9
|
"homepage": "https://github.com/sxzz/eslint-config#readme",
|
|
8
|
-
"bugs": {
|
|
9
|
-
"url": "https://github.com/sxzz/eslint-config/issues"
|
|
10
|
-
},
|
|
11
10
|
"repository": {
|
|
12
11
|
"type": "git",
|
|
13
12
|
"url": "git+https://github.com/sxzz/eslint-config.git"
|
|
14
13
|
},
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"dist"
|
|
19
|
-
],
|
|
20
|
-
"main": "./dist/index.mjs",
|
|
21
|
-
"module": "./dist/index.mjs",
|
|
22
|
-
"types": "./dist/index.d.mts",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/sxzz/eslint-config/issues"
|
|
16
|
+
},
|
|
23
17
|
"exports": {
|
|
24
18
|
".": "./dist/index.mjs",
|
|
25
19
|
"./package.json": "./package.json"
|
|
26
20
|
},
|
|
21
|
+
"main": "./dist/index.mjs",
|
|
22
|
+
"module": "./dist/index.mjs",
|
|
23
|
+
"types": "./dist/index.d.mts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20.0.0"
|
|
32
|
+
},
|
|
30
33
|
"peerDependencies": {
|
|
31
34
|
"@unocss/eslint-plugin": ">=65.0.0",
|
|
32
35
|
"eslint": "^9.5.0"
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
"eslint-plugin-baseline-js": "^0.4.2",
|
|
48
51
|
"eslint-plugin-command": "^3.3.1",
|
|
49
52
|
"eslint-plugin-de-morgan": "^2.0.0",
|
|
50
|
-
"eslint-plugin-
|
|
53
|
+
"eslint-plugin-importer": "^0.1.0",
|
|
51
54
|
"eslint-plugin-jsdoc": "^61.4.1",
|
|
52
55
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
53
56
|
"eslint-plugin-n": "^17.23.1",
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
"globals": "^16.5.0",
|
|
64
67
|
"jsonc-eslint-parser": "^2.4.1",
|
|
65
68
|
"local-pkg": "^1.1.2",
|
|
66
|
-
"typescript-eslint": "^8.48.
|
|
69
|
+
"typescript-eslint": "^8.48.1",
|
|
67
70
|
"vue-eslint-parser": "^10.2.0",
|
|
68
71
|
"yaml-eslint-parser": "^1.3.1"
|
|
69
72
|
},
|
|
@@ -71,18 +74,16 @@
|
|
|
71
74
|
"@eslint/config-inspector": "^1.4.2",
|
|
72
75
|
"@sxzz/prettier-config": "^2.2.6",
|
|
73
76
|
"@types/node": "^24.10.1",
|
|
74
|
-
"@
|
|
77
|
+
"@typescript/native-preview": "7.0.0-dev.20251202.1",
|
|
78
|
+
"@unocss/eslint-plugin": "^66.5.10",
|
|
75
79
|
"bumpp": "^10.3.2",
|
|
76
80
|
"eslint": "^9.39.1",
|
|
77
81
|
"eslint-typegen": "^2.3.0",
|
|
78
|
-
"prettier": "^3.7.
|
|
79
|
-
"rolldown-plugin-require-cjs": "^0.3.
|
|
80
|
-
"tsdown": "^0.
|
|
82
|
+
"prettier": "^3.7.3",
|
|
83
|
+
"rolldown-plugin-require-cjs": "^0.3.2",
|
|
84
|
+
"tsdown": "^0.17.0-beta.5",
|
|
81
85
|
"typescript": "^5.9.3",
|
|
82
|
-
"unrun": "^0.2.
|
|
83
|
-
},
|
|
84
|
-
"engines": {
|
|
85
|
-
"node": ">=20.0.0"
|
|
86
|
+
"unrun": "^0.2.15"
|
|
86
87
|
},
|
|
87
88
|
"resolutions": {
|
|
88
89
|
"@types/eslint": "-"
|
|
@@ -97,6 +98,6 @@
|
|
|
97
98
|
"lint": "eslint --max-warnings=0",
|
|
98
99
|
"lint:fix": "pnpm run lint --fix",
|
|
99
100
|
"release": "bumpp",
|
|
100
|
-
"typecheck": "
|
|
101
|
+
"typecheck": "tsgo --noEmit"
|
|
101
102
|
}
|
|
102
103
|
}
|