@will-stone/eslint-config 25.2.0 → 25.2.1
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.js +138 -195
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import b from "typescript-eslint";
|
|
2
2
|
import g from "@typescript-eslint/parser";
|
|
3
|
-
import
|
|
3
|
+
import h from "confusing-browser-globals";
|
|
4
4
|
import c from "globals";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { globbySync as
|
|
5
|
+
import k from "eslint-config-flat-gitignore";
|
|
6
|
+
import q from "eslint-plugin-jsdoc";
|
|
7
|
+
import P from "eslint-plugin-n";
|
|
8
|
+
import O from "eslint-plugin-package-json";
|
|
9
|
+
import _ from "eslint-plugin-perfectionist";
|
|
10
|
+
import D from "@stylistic/eslint-plugin";
|
|
11
|
+
import w from "@typescript-eslint/eslint-plugin";
|
|
12
|
+
import C from "eslint-plugin-unicorn";
|
|
13
|
+
import { globbySync as N } from "globby";
|
|
14
14
|
import { readFileSync as L } from "node:fs";
|
|
15
|
-
import
|
|
16
|
-
const i = "?([cm])[jt]s?(x)", d = `**/*.${i}`,
|
|
15
|
+
import E from "debug";
|
|
16
|
+
const i = "?([cm])[jt]s?(x)", d = `**/*.${i}`, j = "**/*.?([cm])ts", x = "**/*.?([cm])tsx", S = [
|
|
17
17
|
`**/__tests__/**/*.${i}`,
|
|
18
18
|
`**/*.spec.${i}`,
|
|
19
19
|
`**/*.test.${i}`,
|
|
20
20
|
`**/*.bench.${i}`,
|
|
21
21
|
`**/*.benchmark.${i}`
|
|
22
|
-
],
|
|
22
|
+
], T = "**/*.astro", A = "**/*.astro/*.ts", I = "**/*.{jsx,tsx,astro}", B = [
|
|
23
23
|
"**/node_modules",
|
|
24
24
|
"**/dist",
|
|
25
25
|
"**/package-lock.json",
|
|
@@ -49,14 +49,14 @@ async function s(r) {
|
|
|
49
49
|
const e = await r;
|
|
50
50
|
return e.default || e;
|
|
51
51
|
}
|
|
52
|
-
async function
|
|
52
|
+
async function G(r) {
|
|
53
53
|
const [e, o] = await Promise.all([
|
|
54
54
|
s(import("eslint-plugin-astro")),
|
|
55
55
|
s(import("astro-eslint-parser"))
|
|
56
56
|
]);
|
|
57
57
|
return [
|
|
58
58
|
{
|
|
59
|
-
files: [
|
|
59
|
+
files: [T],
|
|
60
60
|
languageOptions: {
|
|
61
61
|
globals: e.environments.astro.globals,
|
|
62
62
|
parser: o,
|
|
@@ -134,7 +134,7 @@ async function B(r) {
|
|
|
134
134
|
}
|
|
135
135
|
];
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function K() {
|
|
138
138
|
return [
|
|
139
139
|
{
|
|
140
140
|
languageOptions: {
|
|
@@ -285,7 +285,7 @@ function G() {
|
|
|
285
285
|
"no-redeclare": "error",
|
|
286
286
|
"no-regex-spaces": "warn",
|
|
287
287
|
"no-restricted-exports": "off",
|
|
288
|
-
"no-restricted-globals": ["error", ...
|
|
288
|
+
"no-restricted-globals": ["error", ...h],
|
|
289
289
|
"no-restricted-imports": "off",
|
|
290
290
|
"no-restricted-properties": "off",
|
|
291
291
|
"no-restricted-syntax": "off",
|
|
@@ -387,14 +387,14 @@ function G() {
|
|
|
387
387
|
}
|
|
388
388
|
];
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function $() {
|
|
391
391
|
return [
|
|
392
392
|
{
|
|
393
|
-
ignores:
|
|
393
|
+
ignores: B,
|
|
394
394
|
name: "will-stone/ignores"
|
|
395
395
|
},
|
|
396
396
|
{
|
|
397
|
-
...
|
|
397
|
+
...k({
|
|
398
398
|
// Prevent throw if gitignore not found.
|
|
399
399
|
strict: !1
|
|
400
400
|
}),
|
|
@@ -402,12 +402,12 @@ function K() {
|
|
|
402
402
|
}
|
|
403
403
|
];
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function R() {
|
|
406
406
|
return [
|
|
407
407
|
{
|
|
408
|
-
files: [
|
|
408
|
+
files: [j, x],
|
|
409
409
|
name: "will-stone/jsdoc",
|
|
410
|
-
plugins: { jsdoc:
|
|
410
|
+
plugins: { jsdoc: q },
|
|
411
411
|
rules: {
|
|
412
412
|
"jsdoc/check-access": "off",
|
|
413
413
|
"jsdoc/check-alignment": "warn",
|
|
@@ -496,7 +496,7 @@ function U() {
|
|
|
496
496
|
{
|
|
497
497
|
languageOptions: { globals: c.node },
|
|
498
498
|
name: "will-stone/node",
|
|
499
|
-
plugins: { n:
|
|
499
|
+
plugins: { n: P },
|
|
500
500
|
rules: {
|
|
501
501
|
"n/callback-return": "error",
|
|
502
502
|
"n/global-require": "error",
|
|
@@ -549,7 +549,7 @@ function U() {
|
|
|
549
549
|
function F() {
|
|
550
550
|
return [
|
|
551
551
|
{
|
|
552
|
-
...
|
|
552
|
+
...O.configs.recommended,
|
|
553
553
|
name: "will-stone/package.json",
|
|
554
554
|
rules: {
|
|
555
555
|
"package-json/bin-name-casing": "error",
|
|
@@ -644,12 +644,12 @@ const y = [
|
|
|
644
644
|
type: "natural"
|
|
645
645
|
}
|
|
646
646
|
];
|
|
647
|
-
function
|
|
647
|
+
function J() {
|
|
648
648
|
return [
|
|
649
649
|
{
|
|
650
650
|
name: "will-stone/perfectionist",
|
|
651
651
|
plugins: {
|
|
652
|
-
perfectionist:
|
|
652
|
+
perfectionist: _
|
|
653
653
|
},
|
|
654
654
|
rules: {
|
|
655
655
|
"perfectionist/sort-array-includes": "off",
|
|
@@ -678,7 +678,7 @@ function R() {
|
|
|
678
678
|
}
|
|
679
679
|
];
|
|
680
680
|
}
|
|
681
|
-
async function
|
|
681
|
+
async function z(r) {
|
|
682
682
|
const [e, o, t] = await Promise.all([
|
|
683
683
|
// @ts-expect-error -- no types
|
|
684
684
|
s(import("eslint-plugin-jsx-a11y")),
|
|
@@ -952,12 +952,12 @@ async function J(r) {
|
|
|
952
952
|
}
|
|
953
953
|
];
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function M() {
|
|
956
956
|
return [
|
|
957
957
|
{
|
|
958
958
|
name: "will-stone/style",
|
|
959
959
|
plugins: {
|
|
960
|
-
"@stylistic":
|
|
960
|
+
"@stylistic": D
|
|
961
961
|
},
|
|
962
962
|
rules: {
|
|
963
963
|
"@stylistic/array-bracket-newline": "off",
|
|
@@ -1062,7 +1062,7 @@ function z() {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
];
|
|
1064
1064
|
}
|
|
1065
|
-
async function
|
|
1065
|
+
async function V({
|
|
1066
1066
|
options: { tailwind: r }
|
|
1067
1067
|
}) {
|
|
1068
1068
|
const e = !r || r === !0 ? {} : r, o = await s(
|
|
@@ -1071,7 +1071,7 @@ async function M({
|
|
|
1071
1071
|
);
|
|
1072
1072
|
return [
|
|
1073
1073
|
{
|
|
1074
|
-
files: [
|
|
1074
|
+
files: [I],
|
|
1075
1075
|
name: "will-stone/tailwind",
|
|
1076
1076
|
plugins: { tailwindcss: o },
|
|
1077
1077
|
rules: {
|
|
@@ -1100,10 +1100,15 @@ async function M({
|
|
|
1100
1100
|
}
|
|
1101
1101
|
];
|
|
1102
1102
|
}
|
|
1103
|
-
|
|
1103
|
+
const v = {};
|
|
1104
|
+
for (const r of w.configs["flat/all"])
|
|
1105
|
+
for (const [e, o] of Object.entries(r.rules || {}))
|
|
1106
|
+
!e.startsWith("@typescript") && // Deprecated rules.
|
|
1107
|
+
!["no-new-symbol", "no-return-await"].includes(e) && (v[e] = o);
|
|
1108
|
+
function X() {
|
|
1104
1109
|
return [
|
|
1105
1110
|
{
|
|
1106
|
-
files: [
|
|
1111
|
+
files: [A, j, x],
|
|
1107
1112
|
languageOptions: {
|
|
1108
1113
|
parser: g,
|
|
1109
1114
|
parserOptions: {
|
|
@@ -1112,75 +1117,98 @@ function V() {
|
|
|
1112
1117
|
},
|
|
1113
1118
|
name: "will-stone/typescript",
|
|
1114
1119
|
plugins: {
|
|
1115
|
-
"@typescript-eslint":
|
|
1120
|
+
"@typescript-eslint": w
|
|
1116
1121
|
},
|
|
1117
1122
|
rules: {
|
|
1118
|
-
|
|
1119
|
-
* Recommended to turn off these eslint built-in rules.
|
|
1120
|
-
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/eslint-recommended.ts
|
|
1121
|
-
*/
|
|
1122
|
-
// ts(2335) & ts(2377)
|
|
1123
|
-
"constructor-super": "off",
|
|
1124
|
-
// ts(2378)
|
|
1125
|
-
"getter-return": "off",
|
|
1126
|
-
// ts(2588)
|
|
1127
|
-
"no-const-assign": "off",
|
|
1128
|
-
// ts(2300)
|
|
1129
|
-
"no-dupe-args": "off",
|
|
1130
|
-
// ts(2393) & ts(2300)
|
|
1131
|
-
"no-dupe-class-members": "off",
|
|
1132
|
-
// ts(1117)
|
|
1133
|
-
"no-dupe-keys": "off",
|
|
1134
|
-
// ts(2539)
|
|
1135
|
-
"no-func-assign": "off",
|
|
1136
|
-
// ts(2539) & ts(2540)
|
|
1137
|
-
"no-import-assign": "off",
|
|
1138
|
-
// ts(2349)
|
|
1139
|
-
"no-obj-calls": "off",
|
|
1140
|
-
// ts(2408)
|
|
1141
|
-
"no-setter-return": "off",
|
|
1142
|
-
// ts(2376)
|
|
1143
|
-
"no-this-before-super": "off",
|
|
1144
|
-
// ts(2304)
|
|
1145
|
-
"no-undef": "off",
|
|
1146
|
-
// ts(7027)
|
|
1147
|
-
"no-unreachable": "off",
|
|
1148
|
-
// ts(2365) & ts(2360) & ts(2358)
|
|
1149
|
-
"no-unsafe-negation": "off",
|
|
1150
|
-
// ts transpiles let/const to var, so no need for vars any more
|
|
1151
|
-
"no-var": "error",
|
|
1152
|
-
// ts provides better types with const
|
|
1153
|
-
"prefer-const": "warn",
|
|
1154
|
-
// ts provides better types with rest args over arguments
|
|
1155
|
-
"prefer-rest-params": "error",
|
|
1156
|
-
// ts transpiles spread to apply, so no need for manual apply
|
|
1157
|
-
"prefer-spread": "error",
|
|
1158
|
-
// ts(2367)
|
|
1159
|
-
"valid-typeof": "off",
|
|
1123
|
+
...v,
|
|
1160
1124
|
/**
|
|
1161
1125
|
* TS Recommended.
|
|
1162
1126
|
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.ts
|
|
1163
1127
|
*/
|
|
1164
1128
|
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
1129
|
+
"@typescript-eslint/array-type": ["warn", { default: "array" }],
|
|
1165
1130
|
"@typescript-eslint/ban-ts-comment": "error",
|
|
1131
|
+
"@typescript-eslint/ban-tslint-comment": "warn",
|
|
1132
|
+
"@typescript-eslint/class-literal-property-style": "warn",
|
|
1133
|
+
"@typescript-eslint/class-methods-use-this": "off",
|
|
1134
|
+
"@typescript-eslint/consistent-generic-constructors": "warn",
|
|
1135
|
+
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
1136
|
+
"@typescript-eslint/consistent-type-assertions": "error",
|
|
1137
|
+
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
|
|
1138
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
1139
|
+
"warn",
|
|
1140
|
+
{
|
|
1141
|
+
fixStyle: "separate-type-imports",
|
|
1142
|
+
prefer: "type-imports"
|
|
1143
|
+
}
|
|
1144
|
+
],
|
|
1145
|
+
"@typescript-eslint/default-param-last": ["error"],
|
|
1146
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1147
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
1148
|
+
"warn",
|
|
1149
|
+
{ accessibility: "no-public" }
|
|
1150
|
+
],
|
|
1166
1151
|
"@typescript-eslint/explicit-module-boundary-types": "warn",
|
|
1152
|
+
"@typescript-eslint/init-declarations": "off",
|
|
1153
|
+
"@typescript-eslint/max-params": "off",
|
|
1154
|
+
"@typescript-eslint/member-ordering": "error",
|
|
1155
|
+
"@typescript-eslint/method-signature-style": "warn",
|
|
1167
1156
|
"@typescript-eslint/no-array-constructor": "error",
|
|
1157
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
|
|
1158
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1159
|
+
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
1160
|
+
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1168
1161
|
"@typescript-eslint/no-empty-function": "error",
|
|
1169
1162
|
"@typescript-eslint/no-empty-object-type": "error",
|
|
1170
1163
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
1164
|
+
"@typescript-eslint/no-extra-non-null-assertion": "warn",
|
|
1165
|
+
"@typescript-eslint/no-extraneous-class": "error",
|
|
1166
|
+
"@typescript-eslint/no-import-type-side-effects": "warn",
|
|
1171
1167
|
"@typescript-eslint/no-inferrable-types": "error",
|
|
1168
|
+
"@typescript-eslint/no-invalid-this": "error",
|
|
1169
|
+
"@typescript-eslint/no-invalid-void-type": "error",
|
|
1170
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
1171
|
+
"@typescript-eslint/no-magic-numbers": "off",
|
|
1172
1172
|
"@typescript-eslint/no-misused-new": "error",
|
|
1173
1173
|
"@typescript-eslint/no-namespace": "error",
|
|
1174
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
1174
1175
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
1175
1176
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
1177
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
1178
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
1179
|
+
"@typescript-eslint/no-restricted-imports": "off",
|
|
1180
|
+
"@typescript-eslint/no-restricted-types": "off",
|
|
1181
|
+
"@typescript-eslint/no-shadow": ["error"],
|
|
1176
1182
|
"@typescript-eslint/no-this-alias": "error",
|
|
1183
|
+
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
|
|
1184
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
1185
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "error",
|
|
1177
1186
|
"@typescript-eslint/no-unsafe-function-type": "warn",
|
|
1187
|
+
"@typescript-eslint/no-unused-expressions": ["error"],
|
|
1188
|
+
"@typescript-eslint/no-unused-private-class-members": "error",
|
|
1189
|
+
"@typescript-eslint/no-unused-vars": [
|
|
1190
|
+
"error",
|
|
1191
|
+
{
|
|
1192
|
+
// Useful for extracting args from props and ignoring them:
|
|
1193
|
+
// { style: _style, ...restProps }
|
|
1194
|
+
argsIgnorePattern: "^_",
|
|
1195
|
+
varsIgnorePattern: "[iI]gnored"
|
|
1196
|
+
}
|
|
1197
|
+
],
|
|
1198
|
+
"@typescript-eslint/no-use-before-define": "error",
|
|
1199
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
1200
|
+
"@typescript-eslint/no-useless-empty-export": "warn",
|
|
1178
1201
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
1202
|
+
"@typescript-eslint/parameter-properties": "off",
|
|
1179
1203
|
"@typescript-eslint/prefer-as-const": "error",
|
|
1204
|
+
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
1205
|
+
// Unicorn does this better by providing a fixer
|
|
1206
|
+
"@typescript-eslint/prefer-for-of": "off",
|
|
1207
|
+
"@typescript-eslint/prefer-function-type": "warn",
|
|
1208
|
+
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
1180
1209
|
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
1181
1210
|
"@typescript-eslint/triple-slash-reference": "error",
|
|
1182
|
-
"
|
|
1183
|
-
"no-empty-function": "off",
|
|
1211
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
1184
1212
|
/**
|
|
1185
1213
|
* These require type checking.
|
|
1186
1214
|
*/
|
|
@@ -1244,101 +1272,16 @@ function V() {
|
|
|
1244
1272
|
"@typescript-eslint/strict-void-return": "off",
|
|
1245
1273
|
"@typescript-eslint/switch-exhaustiveness-check": "off",
|
|
1246
1274
|
"@typescript-eslint/unbound-method": "off",
|
|
1247
|
-
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off"
|
|
1248
|
-
/**
|
|
1249
|
-
* Superseded by TS rules below.
|
|
1250
|
-
*/
|
|
1251
|
-
"class-methods-use-this": "off",
|
|
1252
|
-
"default-param-last": "off",
|
|
1253
|
-
"no-duplicate-imports": "off",
|
|
1254
|
-
"no-invalid-this": "off",
|
|
1255
|
-
"no-loop-func": "off",
|
|
1256
|
-
"no-redeclare": "off",
|
|
1257
|
-
"no-restricted-imports": "off",
|
|
1258
|
-
"no-shadow": "off",
|
|
1259
|
-
"no-unused-expressions": "off",
|
|
1260
|
-
"no-unused-private-class-members": "off",
|
|
1261
|
-
"no-unused-vars": "off",
|
|
1262
|
-
"no-use-before-define": "off",
|
|
1263
|
-
"no-useless-constructor": "off",
|
|
1264
|
-
/**
|
|
1265
|
-
* The rest.
|
|
1266
|
-
*/
|
|
1267
|
-
"@typescript-eslint/array-type": ["warn", { default: "array" }],
|
|
1268
|
-
"@typescript-eslint/ban-tslint-comment": "warn",
|
|
1269
|
-
"@typescript-eslint/class-literal-property-style": "warn",
|
|
1270
|
-
"@typescript-eslint/class-methods-use-this": "off",
|
|
1271
|
-
"@typescript-eslint/consistent-generic-constructors": "warn",
|
|
1272
|
-
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
1273
|
-
"@typescript-eslint/consistent-type-assertions": "error",
|
|
1274
|
-
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
|
|
1275
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
1276
|
-
"warn",
|
|
1277
|
-
{
|
|
1278
|
-
fixStyle: "separate-type-imports",
|
|
1279
|
-
prefer: "type-imports"
|
|
1280
|
-
}
|
|
1281
|
-
],
|
|
1282
|
-
"@typescript-eslint/default-param-last": ["error"],
|
|
1283
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1284
|
-
"@typescript-eslint/explicit-member-accessibility": [
|
|
1285
|
-
"warn",
|
|
1286
|
-
{ accessibility: "no-public" }
|
|
1287
|
-
],
|
|
1288
|
-
"@typescript-eslint/init-declarations": "off",
|
|
1289
|
-
"@typescript-eslint/max-params": "off",
|
|
1290
|
-
"@typescript-eslint/member-ordering": "error",
|
|
1291
|
-
"@typescript-eslint/method-signature-style": "warn",
|
|
1292
|
-
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
|
|
1293
|
-
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1294
|
-
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
1295
|
-
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1296
|
-
"@typescript-eslint/no-extra-non-null-assertion": "warn",
|
|
1297
|
-
"@typescript-eslint/no-extraneous-class": "error",
|
|
1298
|
-
"@typescript-eslint/no-import-type-side-effects": "warn",
|
|
1299
|
-
"@typescript-eslint/no-invalid-this": "error",
|
|
1300
|
-
"@typescript-eslint/no-invalid-void-type": "error",
|
|
1301
|
-
"@typescript-eslint/no-loop-func": "error",
|
|
1302
|
-
"@typescript-eslint/no-magic-numbers": "off",
|
|
1303
|
-
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
1304
|
-
"@typescript-eslint/no-redeclare": "error",
|
|
1305
|
-
"@typescript-eslint/no-require-imports": "error",
|
|
1306
|
-
"@typescript-eslint/no-restricted-imports": "off",
|
|
1307
|
-
"@typescript-eslint/no-restricted-types": "off",
|
|
1308
|
-
"@typescript-eslint/no-shadow": ["error"],
|
|
1309
|
-
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
|
|
1310
|
-
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
1311
|
-
"@typescript-eslint/no-unsafe-declaration-merging": "error",
|
|
1312
|
-
"@typescript-eslint/no-unused-expressions": ["error"],
|
|
1313
|
-
"@typescript-eslint/no-unused-private-class-members": "error",
|
|
1314
|
-
"@typescript-eslint/no-unused-vars": [
|
|
1315
|
-
"error",
|
|
1316
|
-
{
|
|
1317
|
-
// Useful for extracting args from props and ignoring them:
|
|
1318
|
-
// { style: _style, ...restProps }
|
|
1319
|
-
argsIgnorePattern: "^_",
|
|
1320
|
-
varsIgnorePattern: "[iI]gnored"
|
|
1321
|
-
}
|
|
1322
|
-
],
|
|
1323
|
-
"@typescript-eslint/no-use-before-define": "error",
|
|
1324
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
|
1325
|
-
"@typescript-eslint/no-useless-empty-export": "warn",
|
|
1326
|
-
"@typescript-eslint/parameter-properties": "off",
|
|
1327
|
-
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
1328
|
-
// Unicorn does this better by providing a fixer
|
|
1329
|
-
"@typescript-eslint/prefer-for-of": "off",
|
|
1330
|
-
"@typescript-eslint/prefer-function-type": "warn",
|
|
1331
|
-
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
1332
|
-
"@typescript-eslint/unified-signatures": "error"
|
|
1275
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off"
|
|
1333
1276
|
}
|
|
1334
1277
|
}
|
|
1335
1278
|
];
|
|
1336
1279
|
}
|
|
1337
|
-
function
|
|
1280
|
+
function H() {
|
|
1338
1281
|
return [
|
|
1339
1282
|
{
|
|
1340
1283
|
name: "will-stone/unicorn",
|
|
1341
|
-
plugins: { unicorn:
|
|
1284
|
+
plugins: { unicorn: C },
|
|
1342
1285
|
rules: {
|
|
1343
1286
|
// This rule is superseded by the unicorn version below
|
|
1344
1287
|
"no-nested-ternary": "off",
|
|
@@ -1509,11 +1452,11 @@ function X() {
|
|
|
1509
1452
|
}
|
|
1510
1453
|
];
|
|
1511
1454
|
}
|
|
1512
|
-
async function
|
|
1455
|
+
async function W(r) {
|
|
1513
1456
|
const e = await s(import("@vitest/eslint-plugin"));
|
|
1514
1457
|
return [
|
|
1515
1458
|
{
|
|
1516
|
-
files:
|
|
1459
|
+
files: S,
|
|
1517
1460
|
name: "will-stone/vitest",
|
|
1518
1461
|
plugins: { vitest: e },
|
|
1519
1462
|
rules: {
|
|
@@ -1611,73 +1554,73 @@ async function H(r) {
|
|
|
1611
1554
|
}
|
|
1612
1555
|
];
|
|
1613
1556
|
}
|
|
1614
|
-
const
|
|
1615
|
-
{ config:
|
|
1616
|
-
{ config:
|
|
1617
|
-
{ config:
|
|
1557
|
+
const Q = [
|
|
1558
|
+
{ config: $, name: "Ignores" },
|
|
1559
|
+
{ config: K, name: "Base" },
|
|
1560
|
+
{ config: H, name: "Unicorn" },
|
|
1618
1561
|
{ config: U, name: "Node" },
|
|
1619
1562
|
{ config: F, name: "package.json" },
|
|
1620
|
-
{ config:
|
|
1621
|
-
{ config:
|
|
1622
|
-
{ config:
|
|
1623
|
-
{ config:
|
|
1563
|
+
{ config: R, name: "JSDoc" },
|
|
1564
|
+
{ config: M, name: "Style" },
|
|
1565
|
+
{ config: J, name: "Perfectionist" },
|
|
1566
|
+
{ config: X, name: "Typescript" }
|
|
1624
1567
|
], m = [
|
|
1625
1568
|
{
|
|
1626
|
-
config:
|
|
1569
|
+
config: G,
|
|
1627
1570
|
dep: "astro",
|
|
1628
1571
|
name: "Astro.js",
|
|
1629
1572
|
optionName: "astro"
|
|
1630
1573
|
},
|
|
1631
1574
|
{
|
|
1632
|
-
config:
|
|
1575
|
+
config: z,
|
|
1633
1576
|
dep: "react",
|
|
1634
1577
|
name: "React",
|
|
1635
1578
|
optionName: "react"
|
|
1636
1579
|
},
|
|
1637
1580
|
{
|
|
1638
|
-
config:
|
|
1581
|
+
config: V,
|
|
1639
1582
|
dep: "tailwindcss",
|
|
1640
1583
|
name: "Tailwind",
|
|
1641
1584
|
optionName: "tailwind"
|
|
1642
1585
|
},
|
|
1643
1586
|
{
|
|
1644
|
-
config:
|
|
1587
|
+
config: W,
|
|
1645
1588
|
dep: "vitest",
|
|
1646
1589
|
name: "Vitest",
|
|
1647
1590
|
optionName: "vitest"
|
|
1648
1591
|
}
|
|
1649
1592
|
];
|
|
1650
|
-
function
|
|
1651
|
-
const e =
|
|
1593
|
+
function Y(r) {
|
|
1594
|
+
const e = N(["**/package.json", "!**/node_modules/**"]), o = {}, t = () => Object.values(o).every(Boolean);
|
|
1652
1595
|
for (const a of r)
|
|
1653
1596
|
o[a] = !1;
|
|
1654
1597
|
for (const a of e) {
|
|
1655
|
-
const
|
|
1598
|
+
const p = L(a), l = new TextDecoder().decode(p), f = JSON.parse(l);
|
|
1656
1599
|
for (const n of r)
|
|
1657
|
-
if (
|
|
1600
|
+
if (f && (f.dependencies?.[n] || f.devDependencies?.[n]) && (o[n] = !0, t()))
|
|
1658
1601
|
break;
|
|
1659
1602
|
if (t())
|
|
1660
1603
|
break;
|
|
1661
1604
|
}
|
|
1662
1605
|
return o;
|
|
1663
1606
|
}
|
|
1664
|
-
const
|
|
1665
|
-
async function
|
|
1666
|
-
const e = [], o = Object.values(m).map(({ dep: n }) => n), t =
|
|
1607
|
+
const Z = E("eslint:ws"), ee = {};
|
|
1608
|
+
async function re(r = ee) {
|
|
1609
|
+
const e = [], o = Object.values(m).map(({ dep: n }) => n), t = Y(o), a = m.filter(({ dep: n, optionName: u }) => (
|
|
1667
1610
|
// Is forced on.
|
|
1668
1611
|
r?.[u] || // Is present and not forced off.
|
|
1669
1612
|
t[n] && r?.[u] !== !1
|
|
1670
|
-
)),
|
|
1613
|
+
)), p = {
|
|
1671
1614
|
options: r
|
|
1672
1615
|
};
|
|
1673
|
-
for (const n of
|
|
1674
|
-
e.push(n.config(
|
|
1616
|
+
for (const n of Q)
|
|
1617
|
+
e.push(n.config(p));
|
|
1675
1618
|
const l = await Promise.all(
|
|
1676
|
-
a.map((n) => (
|
|
1619
|
+
a.map((n) => (Z(`Auto-configured ${n.name} plugin`), n.config(p)))
|
|
1677
1620
|
);
|
|
1678
1621
|
return e.push(...l), e.flat();
|
|
1679
1622
|
}
|
|
1680
|
-
const
|
|
1623
|
+
const we = async (r, ...e) => b.config(await re(r), ...e);
|
|
1681
1624
|
export {
|
|
1682
|
-
|
|
1625
|
+
we as default
|
|
1683
1626
|
};
|