eslint-config-un 0.0.4 → 0.0.6
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 +34 -32
- package/dist/index.d.cts +1928 -3231
- package/dist/index.d.ts +1928 -3231
- package/dist/index.js +34 -32
- package/package.json +13 -13
package/dist/index.cjs
CHANGED
|
@@ -33,16 +33,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// node_modules/.pnpm/tsup@8.2.
|
|
36
|
+
// node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.39_tsx@4.16.2_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js
|
|
37
37
|
var init_cjs_shims = __esm({
|
|
38
|
-
"node_modules/.pnpm/tsup@8.2.
|
|
38
|
+
"node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.39_tsx@4.16.2_typescript@5.5.4_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js"() {
|
|
39
39
|
"use strict";
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
// node_modules/.pnpm/@eslint+js@9.
|
|
43
|
+
// node_modules/.pnpm/@eslint+js@9.8.0/node_modules/@eslint/js/src/configs/eslint-all.js
|
|
44
44
|
var require_eslint_all = __commonJS({
|
|
45
|
-
"node_modules/.pnpm/@eslint+js@9.
|
|
45
|
+
"node_modules/.pnpm/@eslint+js@9.8.0/node_modules/@eslint/js/src/configs/eslint-all.js"(exports2, module2) {
|
|
46
46
|
"use strict";
|
|
47
47
|
init_cjs_shims();
|
|
48
48
|
module2.exports = Object.freeze({
|
|
@@ -249,9 +249,9 @@ var require_eslint_all = __commonJS({
|
|
|
249
249
|
}
|
|
250
250
|
});
|
|
251
251
|
|
|
252
|
-
// node_modules/.pnpm/@eslint+js@9.
|
|
252
|
+
// node_modules/.pnpm/@eslint+js@9.8.0/node_modules/@eslint/js/src/configs/eslint-recommended.js
|
|
253
253
|
var require_eslint_recommended = __commonJS({
|
|
254
|
-
"node_modules/.pnpm/@eslint+js@9.
|
|
254
|
+
"node_modules/.pnpm/@eslint+js@9.8.0/node_modules/@eslint/js/src/configs/eslint-recommended.js"(exports2, module2) {
|
|
255
255
|
"use strict";
|
|
256
256
|
init_cjs_shims();
|
|
257
257
|
module2.exports = Object.freeze({
|
|
@@ -322,9 +322,9 @@ var require_eslint_recommended = __commonJS({
|
|
|
322
322
|
}
|
|
323
323
|
});
|
|
324
324
|
|
|
325
|
-
// node_modules/.pnpm/@eslint+js@9.
|
|
325
|
+
// node_modules/.pnpm/@eslint+js@9.8.0/node_modules/@eslint/js/src/index.js
|
|
326
326
|
var require_src = __commonJS({
|
|
327
|
-
"node_modules/.pnpm/@eslint+js@9.
|
|
327
|
+
"node_modules/.pnpm/@eslint+js@9.8.0/node_modules/@eslint/js/src/index.js"(exports2, module2) {
|
|
328
328
|
"use strict";
|
|
329
329
|
init_cjs_shims();
|
|
330
330
|
module2.exports = {
|
|
@@ -1211,7 +1211,7 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1211
1211
|
extraFileExtensions: options.extraFileExtensions?.map((ext) => `.${ext}`),
|
|
1212
1212
|
sourceType: "module",
|
|
1213
1213
|
...isTypeAware && {
|
|
1214
|
-
|
|
1214
|
+
projectService: true,
|
|
1215
1215
|
tsconfigRootDir: process.cwd()
|
|
1216
1216
|
},
|
|
1217
1217
|
...options.parserOptions
|
|
@@ -1223,17 +1223,16 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1223
1223
|
...import_typescript_eslint.plugin.configs?.stylistic?.rules,
|
|
1224
1224
|
// 🔵 Strict - overrides
|
|
1225
1225
|
// '@typescript-eslint/ban-ts-comment': ERROR,
|
|
1226
|
-
"@typescript-eslint/ban-types": [ERROR, { types: { object: false, "{}": false } }],
|
|
1227
1226
|
...overrideBaseRule2("no-array-constructor", ERROR),
|
|
1228
1227
|
// '@typescript-eslint/no-duplicate-enum-values': ERROR,
|
|
1229
1228
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-dynamic-delete"),
|
|
1229
|
+
"@typescript-eslint/no-empty-object-type": [ERROR, { allowInterfaces: "with-single-extends" }],
|
|
1230
1230
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-explicit-any", {
|
|
1231
1231
|
ignoreRestArgs: true
|
|
1232
1232
|
}),
|
|
1233
1233
|
// '@typescript-eslint/no-extra-non-null-assertion': ERROR,
|
|
1234
1234
|
// '@typescript-eslint/no-extraneous-class': ERROR,
|
|
1235
1235
|
// '@typescript-eslint/no-invalid-void-type': ERROR,
|
|
1236
|
-
...overrideBaseRule2("no-loss-of-precision", ERROR),
|
|
1237
1236
|
// '@typescript-eslint/no-misused-new': ERROR,
|
|
1238
1237
|
// '@typescript-eslint/no-namespace': ERROR,
|
|
1239
1238
|
// '@typescript-eslint/no-non-null-asserted-nullish-coalescing': ERROR,
|
|
@@ -1242,11 +1241,13 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1242
1241
|
// '@typescript-eslint/no-this-alias': ERROR,
|
|
1243
1242
|
// '@typescript-eslint/no-unnecessary-type-constraint': ERROR,
|
|
1244
1243
|
// '@typescript-eslint/no-unsafe-declaration-merging': ERROR,
|
|
1244
|
+
// '@typescript-eslint/no-unsafe-function-type': ERROR,
|
|
1245
1245
|
...overrideBaseRule2("no-unused-vars", ERROR, { ignoreRestSiblings: true }),
|
|
1246
1246
|
...overrideBaseRule2("no-useless-constructor", ERROR),
|
|
1247
|
-
// '@typescript-eslint/no-
|
|
1247
|
+
// '@typescript-eslint/no-wrapper-object-types': ERROR,
|
|
1248
1248
|
// '@typescript-eslint/prefer-as-const': ERROR,
|
|
1249
1249
|
"@typescript-eslint/prefer-literal-enum-member": [ERROR, { allowBitwiseExpressions: true }],
|
|
1250
|
+
// '@typescript-eslint/prefer-namespace-keyword': ERROR,
|
|
1250
1251
|
// '@typescript-eslint/triple-slash-reference': ERROR,
|
|
1251
1252
|
// '@typescript-eslint/unified-signatures': ERROR,
|
|
1252
1253
|
// 🔵 Stylistic - overrides
|
|
@@ -1260,11 +1261,9 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1260
1261
|
// '@typescript-eslint/consistent-type-definitions': ERROR,
|
|
1261
1262
|
// '@typescript-eslint/no-confusing-non-null-assertion': ERROR,
|
|
1262
1263
|
...overrideBaseRule2("no-empty-function", ERROR),
|
|
1263
|
-
"@typescript-eslint/no-empty-interface": [ERROR, { allowSingleExtends: true }],
|
|
1264
1264
|
// '@typescript-eslint/no-inferrable-types': ERROR,
|
|
1265
1265
|
// '@typescript-eslint/prefer-for-of': ERROR,
|
|
1266
1266
|
// '@typescript-eslint/prefer-function-type': ERROR,
|
|
1267
|
-
// '@typescript-eslint/prefer-namespace-keyword': ERROR,
|
|
1268
1267
|
// 🔵 Additional rules
|
|
1269
1268
|
...overrideBaseRule2("class-methods-use-this", ERROR, {
|
|
1270
1269
|
ignoreOverrideMethods: true,
|
|
@@ -1286,20 +1285,13 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1286
1285
|
// '@typescript-eslint/member-ordering': OFF, // ❄️
|
|
1287
1286
|
"@typescript-eslint/method-signature-style": ERROR,
|
|
1288
1287
|
// ...overrideBaseRule('no-dupe-class-members', OFF), // 👍
|
|
1289
|
-
"@typescript-eslint/no-empty-object-type": [
|
|
1290
|
-
ERROR,
|
|
1291
|
-
{
|
|
1292
|
-
allowInterfaces: "with-single-extends",
|
|
1293
|
-
allowObjectTypes: "always"
|
|
1294
|
-
}
|
|
1295
|
-
],
|
|
1296
1288
|
"@typescript-eslint/no-import-type-side-effects": ERROR,
|
|
1297
1289
|
// ...overrideBaseRule('no-invalid-this', OFF), // 👍
|
|
1298
1290
|
...overrideBaseRule2("no-loop-func", ERROR),
|
|
1299
1291
|
// ...overrideBaseRule('no-magic-numbers', OFF),
|
|
1300
1292
|
"no-redeclare": OFF,
|
|
1301
1293
|
// '@typescript-eslint/no-redeclare': OFF, // 👍
|
|
1302
|
-
|
|
1294
|
+
"@typescript-eslint/no-require-imports": OFF,
|
|
1303
1295
|
// ...overrideBaseRule('no-restricted-imports', OFF),
|
|
1304
1296
|
...overrideBaseRule2("no-shadow", ERROR),
|
|
1305
1297
|
"@typescript-eslint/no-unnecessary-parameter-property-assignment": ERROR,
|
|
@@ -1350,12 +1342,22 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1350
1342
|
// Reason for disabling autofix: could remove type aliases
|
|
1351
1343
|
...disableAutofixForRule("@typescript-eslint/no-unnecessary-type-arguments", ERROR),
|
|
1352
1344
|
// '@typescript-eslint/no-unnecessary-type-assertion': ERROR,
|
|
1345
|
+
// TODO avoid duplication?
|
|
1353
1346
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-unsafe-argument"),
|
|
1354
1347
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-unsafe-assignment"),
|
|
1355
1348
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-unsafe-call"),
|
|
1356
1349
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-unsafe-enum-comparison"),
|
|
1357
1350
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-unsafe-member-access"),
|
|
1358
1351
|
...warnUnlessForcedError(internalOptions, "@typescript-eslint/no-unsafe-return"),
|
|
1352
|
+
...options.disableNoUnsafeRules && {
|
|
1353
|
+
"@typescript-eslint/no-unsafe-argument": OFF,
|
|
1354
|
+
"@typescript-eslint/no-unsafe-assignment": OFF,
|
|
1355
|
+
"@typescript-eslint/no-unsafe-call": OFF,
|
|
1356
|
+
"@typescript-eslint/no-unsafe-enum-comparison": OFF,
|
|
1357
|
+
"@typescript-eslint/no-unsafe-member-access": OFF,
|
|
1358
|
+
"@typescript-eslint/no-unsafe-return": OFF
|
|
1359
|
+
},
|
|
1360
|
+
// '@typescript-eslint/no-unsafe-unary-minus': ERROR,
|
|
1359
1361
|
"no-throw-literal": OFF,
|
|
1360
1362
|
// Note: has different name
|
|
1361
1363
|
"@typescript-eslint/only-throw-error": [
|
|
@@ -1364,9 +1366,6 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1364
1366
|
allowThrowingUnknown: true
|
|
1365
1367
|
}
|
|
1366
1368
|
],
|
|
1367
|
-
"unicorn/prefer-includes": OFF,
|
|
1368
|
-
// Note: in Unicorn
|
|
1369
|
-
"@typescript-eslint/prefer-includes": ERROR,
|
|
1370
1369
|
...overrideBaseRule2("prefer-promise-reject-errors", ERROR),
|
|
1371
1370
|
// '@typescript-eslint/prefer-reduce-type-parameter': ERROR,
|
|
1372
1371
|
// '@typescript-eslint/prefer-return-this-type': ERROR,
|
|
@@ -1383,8 +1382,12 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1383
1382
|
allowIndexSignaturePropertyAccess: true
|
|
1384
1383
|
}),
|
|
1385
1384
|
// '@typescript-eslint/non-nullable-type-assertion-style': ERROR,
|
|
1385
|
+
// '@typescript-eslint/prefer-find': ERROR,
|
|
1386
|
+
"unicorn/prefer-includes": OFF,
|
|
1387
|
+
// '@typescript-eslint/prefer-includes': ERROR,
|
|
1386
1388
|
"@typescript-eslint/prefer-nullish-coalescing": OFF,
|
|
1387
1389
|
// '@typescript-eslint/prefer-optional-chain': ERROR,
|
|
1390
|
+
"@typescript-eslint/prefer-regexp-exec": OFF,
|
|
1388
1391
|
"@typescript-eslint/prefer-string-starts-ends-with": [
|
|
1389
1392
|
ERROR,
|
|
1390
1393
|
{
|
|
@@ -1399,18 +1402,16 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1399
1402
|
],
|
|
1400
1403
|
// '@typescript-eslint/naming-convention': OFF, // ❄️
|
|
1401
1404
|
// '@typescript-eslint/no-unnecessary-qualifier': OFF,
|
|
1402
|
-
"@typescript-eslint/no-unsafe-unary-minus": ERROR,
|
|
1403
1405
|
...overrideBaseRule2("prefer-destructuring", ERROR, RULE_PREFER_DESTRUCTURING_OPTIONS),
|
|
1404
1406
|
"unicorn/prefer-array-find": OFF,
|
|
1405
1407
|
// Note: in Unicorn
|
|
1406
|
-
"@typescript-eslint/prefer-find": ERROR,
|
|
1407
1408
|
"@typescript-eslint/prefer-readonly": ERROR,
|
|
1408
1409
|
// '@typescript-eslint/prefer-readonly-parameter-types': OFF,
|
|
1409
|
-
// '@typescript-eslint/prefer-regexp-exec': OFF,
|
|
1410
1410
|
// '@typescript-eslint/promise-function-async': OFF,
|
|
1411
1411
|
// '@typescript-eslint/require-array-sort-compare': OFF,
|
|
1412
1412
|
// Note: has different name. Also note that the original rule is deprecated and not included in this config, but we disable it anyway just for safety
|
|
1413
1413
|
"no-return-await": OFF,
|
|
1414
|
+
// Disabled by default since v8
|
|
1414
1415
|
"@typescript-eslint/return-await": [ERROR, "always"],
|
|
1415
1416
|
// '@typescript-eslint/strict-boolean-expressions': OFF,
|
|
1416
1417
|
"@typescript-eslint/switch-exhaustiveness-check": ERROR,
|
|
@@ -1538,8 +1539,10 @@ var unicornEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1538
1539
|
// 'unicorn/no-invalid-fetch-options': ERROR,
|
|
1539
1540
|
// 'unicorn/no-invalid-remove-event-listener': ERROR,
|
|
1540
1541
|
// 'unicorn/no-keyword-prefix': OFF, // 🔴
|
|
1542
|
+
// 'unicorn/no-length-as-slice-end': OFF,
|
|
1541
1543
|
// 'unicorn/no-lonely-if': ERROR,
|
|
1542
|
-
// '
|
|
1544
|
+
// Passing `Infinity` doesn't work great with TypeScript
|
|
1545
|
+
"unicorn/no-magic-array-flat-depth": OFF,
|
|
1543
1546
|
// "This is an improved version of the no-negated-condition ESLint rule that makes it automatically fixable" - Unicorn docs
|
|
1544
1547
|
// 'no-negated-condition': OFF,
|
|
1545
1548
|
// 'unicorn/no-negated-condition': ERROR,
|
|
@@ -1607,12 +1610,13 @@ var unicornEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1607
1610
|
// 'unicorn/prefer-negative-index': ERROR,
|
|
1608
1611
|
"unicorn/prefer-node-protocol": OFF,
|
|
1609
1612
|
// `n/prefer-node-protocol` seem to be better as it checks supported node versions
|
|
1610
|
-
|
|
1613
|
+
"unicorn/prefer-number-properties": [ERROR, { checkInfinity: true }],
|
|
1611
1614
|
// 'unicorn/prefer-object-from-entries': ERROR,
|
|
1612
1615
|
// 'unicorn/prefer-optional-catch-binding': ERROR,
|
|
1613
1616
|
// 'unicorn/prefer-prototype-methods': ERROR,
|
|
1614
1617
|
"unicorn/prefer-query-selector": OFF,
|
|
1615
1618
|
// 'unicorn/prefer-reflect-apply': ERROR,
|
|
1619
|
+
// TODO disable when regexp is enabled?
|
|
1616
1620
|
// 'unicorn/prefer-regexp-test': ERROR,
|
|
1617
1621
|
// 'unicorn/prefer-set-has': ERROR,
|
|
1618
1622
|
// 'unicorn/prefer-set-size': ERROR,
|
|
@@ -1649,7 +1653,6 @@ var unicornEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1649
1653
|
...options.files && { files: options.files },
|
|
1650
1654
|
...options.ignores && { ignores: options.ignores },
|
|
1651
1655
|
rules: {
|
|
1652
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1653
1656
|
...import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules,
|
|
1654
1657
|
...rules,
|
|
1655
1658
|
...options.overrides
|
|
@@ -2279,7 +2282,6 @@ var eslintConfig = (options = {}) => {
|
|
|
2279
2282
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2280
2283
|
"disable-autofix": import_eslint_plugin_disable_autofix.default,
|
|
2281
2284
|
// Used in multiple configs and we can't define plugin multiple times
|
|
2282
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
2283
2285
|
unicorn: import_eslint_plugin_unicorn2.default,
|
|
2284
2286
|
"@stylistic": import_eslint_plugin.default
|
|
2285
2287
|
},
|