@jimmy.codes/eslint-config 7.4.0 → 7.5.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/{astro-qFFNUM9D.mjs → astro-BW3KYEZm.mjs} +2 -5
- package/dist/globs.mjs +1 -2
- package/dist/{has-dependency-B4KAkcAy.mjs → has-dependency-BB12gGNt.mjs} +1 -3
- package/dist/index.d.mts +35 -29
- package/dist/index.mjs +12 -37
- package/dist/{interop-default-DtvCAAmD.mjs → interop-default-BHC7xltH.mjs} +1 -3
- package/dist/{jest-BYBtWryE.mjs → jest-D8LgvYvq.mjs} +2 -5
- package/dist/{nextjs-Q8LOBFAI.mjs → nextjs-DVffcTz_.mjs} +3 -6
- package/dist/{playwright-CiUISnDl.mjs → playwright-B1Eb5eas.mjs} +4 -9
- package/dist/{react-BkGA0owG.mjs → react-B-iC8XkH.mjs} +4 -7
- package/dist/{storybook-vSHixqw5.mjs → storybook-DC1i76Qv.mjs} +3 -5
- package/dist/{tanstack-query-CJMINud2.mjs → tanstack-query-Iadbe54U.mjs} +2 -4
- package/dist/{testing-library-DAOq7Q2E.mjs → testing-library-Dm05DzKm.mjs} +2 -5
- package/dist/{typescript-Cae66DX9.mjs → typescript-BGCHPtPk.mjs} +2 -5
- package/dist/{vitest-CHcEa7vN.mjs → vitest-KcLI3D-I.mjs} +2 -5
- package/package.json +13 -13
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GLOB_ASTRO } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
3
3
|
import globals from "globals";
|
|
4
|
-
|
|
5
4
|
//#region src/configs/astro.ts
|
|
6
5
|
async function astroConfig(options) {
|
|
7
6
|
const extractedOptions = extractOptions(options);
|
|
@@ -65,7 +64,6 @@ async function astroConfig(options) {
|
|
|
65
64
|
}
|
|
66
65
|
];
|
|
67
66
|
}
|
|
68
|
-
|
|
69
67
|
//#endregion
|
|
70
68
|
//#region src/utils/upwarn.ts
|
|
71
69
|
/**
|
|
@@ -80,6 +78,5 @@ const upwarn = (rules = {}) => {
|
|
|
80
78
|
return [rule, option === "warn" ? "error" : option];
|
|
81
79
|
}));
|
|
82
80
|
};
|
|
83
|
-
|
|
84
81
|
//#endregion
|
|
85
|
-
export { astroConfig as default, upwarn as t };
|
|
82
|
+
export { astroConfig as default, upwarn as t };
|
package/dist/globs.mjs
CHANGED
|
@@ -75,6 +75,5 @@ const GLOB_IGNORES = [
|
|
|
75
75
|
"**/*.gen.*",
|
|
76
76
|
"!.storybook"
|
|
77
77
|
];
|
|
78
|
-
|
|
79
78
|
//#endregion
|
|
80
|
-
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
|
|
79
|
+
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_TYPE_TESTS };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isPackageExists } from "local-pkg";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/has-dependency.ts
|
|
4
3
|
const hasTypescript = () => {
|
|
5
4
|
return isPackageExists("typescript");
|
|
@@ -34,6 +33,5 @@ const hasNext = () => {
|
|
|
34
33
|
const hasVite = () => {
|
|
35
34
|
return isPackageExists("vite");
|
|
36
35
|
};
|
|
37
|
-
|
|
38
36
|
//#endregion
|
|
39
|
-
export { hasReact as a, hasTestingLibrary as c, hasVitest as d, hasPlaywright as i, hasTypescript as l, hasJest as n, hasReactQuery as o, hasNext as r, hasStorybook as s, hasAstro as t, hasVite as u };
|
|
37
|
+
export { hasReact as a, hasTestingLibrary as c, hasVitest as d, hasPlaywright as i, hasTypescript as l, hasJest as n, hasReactQuery as o, hasNext as r, hasStorybook as s, hasAstro as t, hasVite as u };
|
package/dist/index.d.mts
CHANGED
|
@@ -30,6 +30,7 @@ interface RuleOptions {
|
|
|
30
30
|
/**
|
|
31
31
|
* disallow unused `eslint-disable` comments
|
|
32
32
|
* @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
|
|
33
|
+
* @deprecated
|
|
33
34
|
*/
|
|
34
35
|
'@eslint-community/eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>;
|
|
35
36
|
/**
|
|
@@ -7607,33 +7608,33 @@ type StylisticExpListStyle = [] | [{
|
|
|
7607
7608
|
singleLine?: _StylisticExpListStyle_SingleLineConfig;
|
|
7608
7609
|
multiLine?: _StylisticExpListStyle_MultiLineConfig;
|
|
7609
7610
|
overrides?: {
|
|
7610
|
-
"()"?: _StylisticExpListStyle_BaseConfig;
|
|
7611
|
-
"[]"?: _StylisticExpListStyle_BaseConfig;
|
|
7612
|
-
"{}"?: _StylisticExpListStyle_BaseConfig;
|
|
7613
|
-
"<>"?: _StylisticExpListStyle_BaseConfig;
|
|
7614
|
-
ArrayExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7615
|
-
ArrayPattern?: _StylisticExpListStyle_BaseConfig;
|
|
7616
|
-
ArrowFunctionExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7617
|
-
CallExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7618
|
-
ExportNamedDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
7619
|
-
FunctionDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
7620
|
-
FunctionExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7621
|
-
IfStatement?: _StylisticExpListStyle_BaseConfig;
|
|
7622
|
-
ImportAttributes?: _StylisticExpListStyle_BaseConfig;
|
|
7623
|
-
ImportDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
7624
|
-
JSONArrayExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7625
|
-
JSONObjectExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7626
|
-
NewExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7627
|
-
ObjectExpression?: _StylisticExpListStyle_BaseConfig;
|
|
7628
|
-
ObjectPattern?: _StylisticExpListStyle_BaseConfig;
|
|
7629
|
-
TSDeclareFunction?: _StylisticExpListStyle_BaseConfig;
|
|
7630
|
-
TSEnumBody?: _StylisticExpListStyle_BaseConfig;
|
|
7631
|
-
TSFunctionType?: _StylisticExpListStyle_BaseConfig;
|
|
7632
|
-
TSInterfaceBody?: _StylisticExpListStyle_BaseConfig;
|
|
7633
|
-
TSTupleType?: _StylisticExpListStyle_BaseConfig;
|
|
7634
|
-
TSTypeLiteral?: _StylisticExpListStyle_BaseConfig;
|
|
7635
|
-
TSTypeParameterDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
7636
|
-
TSTypeParameterInstantiation?: _StylisticExpListStyle_BaseConfig;
|
|
7611
|
+
"()"?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7612
|
+
"[]"?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7613
|
+
"{}"?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7614
|
+
"<>"?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7615
|
+
ArrayExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7616
|
+
ArrayPattern?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7617
|
+
ArrowFunctionExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7618
|
+
CallExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7619
|
+
ExportNamedDeclaration?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7620
|
+
FunctionDeclaration?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7621
|
+
FunctionExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7622
|
+
IfStatement?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7623
|
+
ImportAttributes?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7624
|
+
ImportDeclaration?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7625
|
+
JSONArrayExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7626
|
+
JSONObjectExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7627
|
+
NewExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7628
|
+
ObjectExpression?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7629
|
+
ObjectPattern?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7630
|
+
TSDeclareFunction?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7631
|
+
TSEnumBody?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7632
|
+
TSFunctionType?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7633
|
+
TSInterfaceBody?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7634
|
+
TSTupleType?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7635
|
+
TSTypeLiteral?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7636
|
+
TSTypeParameterDeclaration?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7637
|
+
TSTypeParameterInstantiation?: (_StylisticExpListStyle_BaseConfig | "off");
|
|
7637
7638
|
};
|
|
7638
7639
|
}];
|
|
7639
7640
|
interface _StylisticExpListStyle_SingleLineConfig {
|
|
@@ -8494,13 +8495,18 @@ type StylisticPaddedBlocks = [] | [(("always" | "never" | "start" | "end") | {
|
|
|
8494
8495
|
allowSingleLineBlocks?: boolean;
|
|
8495
8496
|
}]; // ----- @stylistic/padding-line-between-statements -----
|
|
8496
8497
|
type _StylisticPaddingLineBetweenStatementsPaddingType = ("any" | "never" | "always");
|
|
8497
|
-
type _StylisticPaddingLineBetweenStatementsStatementOption = (
|
|
8498
|
+
type _StylisticPaddingLineBetweenStatementsStatementOption = (_StylisticPaddingLineBetweenStatementsStatementMatcher | [_StylisticPaddingLineBetweenStatementsStatementMatcher, ...(_StylisticPaddingLineBetweenStatementsStatementMatcher)[]]);
|
|
8499
|
+
type _StylisticPaddingLineBetweenStatementsStatementMatcher = (_StylisticPaddingLineBetweenStatementsStatementType | _StylisticPaddingLineBetweenStatements_SelectorOption);
|
|
8498
8500
|
type _StylisticPaddingLineBetweenStatementsStatementType = ("*" | "exports" | "require" | "directive" | "iife" | "block" | "empty" | "function" | "ts-method" | "break" | "case" | "class" | "continue" | "debugger" | "default" | "do" | "for" | "if" | "import" | "switch" | "throw" | "try" | "while" | "with" | "cjs-export" | "cjs-import" | "enum" | "interface" | "function-overload" | "block-like" | "singleline-block-like" | "multiline-block-like" | "expression" | "singleline-expression" | "multiline-expression" | "return" | "singleline-return" | "multiline-return" | "export" | "singleline-export" | "multiline-export" | "var" | "singleline-var" | "multiline-var" | "let" | "singleline-let" | "multiline-let" | "const" | "singleline-const" | "multiline-const" | "using" | "singleline-using" | "multiline-using" | "type" | "singleline-type" | "multiline-type");
|
|
8499
8501
|
type StylisticPaddingLineBetweenStatements = {
|
|
8500
8502
|
blankLine: _StylisticPaddingLineBetweenStatementsPaddingType;
|
|
8501
8503
|
prev: _StylisticPaddingLineBetweenStatementsStatementOption;
|
|
8502
8504
|
next: _StylisticPaddingLineBetweenStatementsStatementOption;
|
|
8503
|
-
}[];
|
|
8505
|
+
}[];
|
|
8506
|
+
interface _StylisticPaddingLineBetweenStatements_SelectorOption {
|
|
8507
|
+
selector: string;
|
|
8508
|
+
lineMode?: ("any" | "singleline" | "multiline");
|
|
8509
|
+
} // ----- @stylistic/quote-props -----
|
|
8504
8510
|
type StylisticQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
8505
8511
|
keywords?: boolean;
|
|
8506
8512
|
unnecessary?: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GLOB_CJS, GLOB_IGNORES, GLOB_TESTS } from "./globs.mjs";
|
|
2
|
-
import { a as hasReact, c as hasTestingLibrary, d as hasVitest, i as hasPlaywright, l as hasTypescript, n as hasJest, o as hasReactQuery, r as hasNext, s as hasStorybook, t as hasAstro } from "./has-dependency-
|
|
2
|
+
import { a as hasReact, c as hasTestingLibrary, d as hasVitest, i as hasPlaywright, l as hasTypescript, n as hasJest, o as hasReactQuery, r as hasNext, s as hasStorybook, t as hasAstro } from "./has-dependency-BB12gGNt.mjs";
|
|
3
3
|
import gitignoreConfig from "eslint-config-flat-gitignore";
|
|
4
4
|
import globals from "globals";
|
|
5
5
|
import { recommended } from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
@@ -15,7 +15,6 @@ import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
|
15
15
|
import * as regexpPlugin from "eslint-plugin-regexp";
|
|
16
16
|
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
17
17
|
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
18
|
-
|
|
19
18
|
//#region src/configs/commonjs.ts
|
|
20
19
|
const commonjsConfig = () => {
|
|
21
20
|
return [{
|
|
@@ -24,7 +23,6 @@ const commonjsConfig = () => {
|
|
|
24
23
|
name: "jimmy.codes/commonjs"
|
|
25
24
|
}];
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
27
|
//#region src/rules/eslint-comments.ts
|
|
30
28
|
const eslintCommentsRules = {
|
|
@@ -32,7 +30,6 @@ const eslintCommentsRules = {
|
|
|
32
30
|
"@eslint-community/eslint-comments/no-unused-disable": "off",
|
|
33
31
|
"@eslint-community/eslint-comments/require-description": "error"
|
|
34
32
|
};
|
|
35
|
-
|
|
36
33
|
//#endregion
|
|
37
34
|
//#region src/configs/eslint-comments.ts
|
|
38
35
|
const eslintCommentsConfig = () => {
|
|
@@ -42,7 +39,6 @@ const eslintCommentsConfig = () => {
|
|
|
42
39
|
rules: eslintCommentsRules
|
|
43
40
|
}];
|
|
44
41
|
};
|
|
45
|
-
|
|
46
42
|
//#endregion
|
|
47
43
|
//#region src/configs/ignores.ts
|
|
48
44
|
const ignoresConfig = (ignores) => {
|
|
@@ -51,7 +47,6 @@ const ignoresConfig = (ignores) => {
|
|
|
51
47
|
name: "jimmy.codes/ignores"
|
|
52
48
|
}];
|
|
53
49
|
};
|
|
54
|
-
|
|
55
50
|
//#endregion
|
|
56
51
|
//#region src/rules/imports.ts
|
|
57
52
|
const importsRules = {
|
|
@@ -77,7 +72,6 @@ const importsRules = {
|
|
|
77
72
|
"import-x/no-unresolved": ["error", { ignore: [String.raw`\.svg$`] }],
|
|
78
73
|
"import-x/no-useless-path-segments": "error"
|
|
79
74
|
};
|
|
80
|
-
|
|
81
75
|
//#endregion
|
|
82
76
|
//#region src/configs/imports.ts
|
|
83
77
|
const importsTypescriptConfig = () => {
|
|
@@ -103,7 +97,6 @@ const importsConfig = ({ isTypescriptEnabled = false } = {}) => {
|
|
|
103
97
|
rules: importsRules
|
|
104
98
|
}, ...isTypescriptEnabled ? importsTypescriptConfig() : []];
|
|
105
99
|
};
|
|
106
|
-
|
|
107
100
|
//#endregion
|
|
108
101
|
//#region src/rules/javascript.ts
|
|
109
102
|
const additionalRules = {
|
|
@@ -179,7 +172,6 @@ const javascriptRules = {
|
|
|
179
172
|
...additionalRules,
|
|
180
173
|
...configs$1.recommended.rules
|
|
181
174
|
};
|
|
182
|
-
|
|
183
175
|
//#endregion
|
|
184
176
|
//#region src/configs/javascript.ts
|
|
185
177
|
const javascriptConfig = () => {
|
|
@@ -197,7 +189,6 @@ const javascriptConfig = () => {
|
|
|
197
189
|
rules: { "no-magic-numbers": "off" }
|
|
198
190
|
}];
|
|
199
191
|
};
|
|
200
|
-
|
|
201
192
|
//#endregion
|
|
202
193
|
//#region src/rules/jsdoc.ts
|
|
203
194
|
const jsdocRules = () => {
|
|
@@ -221,7 +212,6 @@ const jsdocRules = () => {
|
|
|
221
212
|
]
|
|
222
213
|
};
|
|
223
214
|
};
|
|
224
|
-
|
|
225
215
|
//#endregion
|
|
226
216
|
//#region src/configs/jsdoc.ts
|
|
227
217
|
const jsdocConfig = () => {
|
|
@@ -231,7 +221,6 @@ const jsdocConfig = () => {
|
|
|
231
221
|
rules: jsdocRules()
|
|
232
222
|
}];
|
|
233
223
|
};
|
|
234
|
-
|
|
235
224
|
//#endregion
|
|
236
225
|
//#region src/rules/node.ts
|
|
237
226
|
const nodeRules = {
|
|
@@ -254,7 +243,6 @@ const nodeRules = {
|
|
|
254
243
|
"n/prefer-node-protocol": "error",
|
|
255
244
|
"n/process-exit-as-throw": "error"
|
|
256
245
|
};
|
|
257
|
-
|
|
258
246
|
//#endregion
|
|
259
247
|
//#region src/configs/node.ts
|
|
260
248
|
const nodeConfig = () => {
|
|
@@ -264,7 +252,6 @@ const nodeConfig = () => {
|
|
|
264
252
|
rules: nodeRules
|
|
265
253
|
}];
|
|
266
254
|
};
|
|
267
|
-
|
|
268
255
|
//#endregion
|
|
269
256
|
//#region src/rules/perfectionist.ts
|
|
270
257
|
const perfectionistRules = {
|
|
@@ -319,7 +306,6 @@ const perfectionistRules = {
|
|
|
319
306
|
type: "natural"
|
|
320
307
|
}]
|
|
321
308
|
};
|
|
322
|
-
|
|
323
309
|
//#endregion
|
|
324
310
|
//#region src/configs/perfectionist.ts
|
|
325
311
|
const perfectionistConfig = () => {
|
|
@@ -329,7 +315,6 @@ const perfectionistConfig = () => {
|
|
|
329
315
|
rules: perfectionistRules
|
|
330
316
|
}];
|
|
331
317
|
};
|
|
332
|
-
|
|
333
318
|
//#endregion
|
|
334
319
|
//#region src/configs/prettier.ts
|
|
335
320
|
const prettierConfig = () => {
|
|
@@ -338,7 +323,6 @@ const prettierConfig = () => {
|
|
|
338
323
|
name: "jimmy.codes/prettier"
|
|
339
324
|
}];
|
|
340
325
|
};
|
|
341
|
-
|
|
342
326
|
//#endregion
|
|
343
327
|
//#region src/rules/regexp.ts
|
|
344
328
|
const regexpRules = {
|
|
@@ -350,7 +334,6 @@ const regexpRules = {
|
|
|
350
334
|
"regexp/no-useless-flag": "error",
|
|
351
335
|
"regexp/optimal-lookaround-quantifier": "error"
|
|
352
336
|
};
|
|
353
|
-
|
|
354
337
|
//#endregion
|
|
355
338
|
//#region src/configs/regexp.ts
|
|
356
339
|
const regexpConfig = () => {
|
|
@@ -360,7 +343,6 @@ const regexpConfig = () => {
|
|
|
360
343
|
rules: regexpRules
|
|
361
344
|
}];
|
|
362
345
|
};
|
|
363
|
-
|
|
364
346
|
//#endregion
|
|
365
347
|
//#region src/rules/stylistic.ts
|
|
366
348
|
const stylisticRules = {
|
|
@@ -461,7 +443,6 @@ const stylisticRules = {
|
|
|
461
443
|
}
|
|
462
444
|
]
|
|
463
445
|
};
|
|
464
|
-
|
|
465
446
|
//#endregion
|
|
466
447
|
//#region src/configs/stylistic.ts
|
|
467
448
|
function stylisticConfig() {
|
|
@@ -471,7 +452,6 @@ function stylisticConfig() {
|
|
|
471
452
|
rules: stylisticRules
|
|
472
453
|
}];
|
|
473
454
|
}
|
|
474
|
-
|
|
475
455
|
//#endregion
|
|
476
456
|
//#region src/rules/unicorn.ts
|
|
477
457
|
const unicornRules = {
|
|
@@ -488,7 +468,6 @@ const unicornRules = {
|
|
|
488
468
|
"unicorn/prefer-node-protocol": "off",
|
|
489
469
|
"unicorn/prevent-abbreviations": "off"
|
|
490
470
|
};
|
|
491
|
-
|
|
492
471
|
//#endregion
|
|
493
472
|
//#region src/configs/unicorn.ts
|
|
494
473
|
const unicornConfig = () => {
|
|
@@ -498,7 +477,6 @@ const unicornConfig = () => {
|
|
|
498
477
|
rules: unicornRules
|
|
499
478
|
}];
|
|
500
479
|
};
|
|
501
|
-
|
|
502
480
|
//#endregion
|
|
503
481
|
//#region src/utils/create-featured.ts
|
|
504
482
|
/**
|
|
@@ -514,7 +492,6 @@ const createFeatured = (autoDetect) => {
|
|
|
514
492
|
return explicit || autoDetect && detector();
|
|
515
493
|
};
|
|
516
494
|
};
|
|
517
|
-
|
|
518
495
|
//#endregion
|
|
519
496
|
//#region src/utils/unwrap.ts
|
|
520
497
|
/**
|
|
@@ -542,7 +519,6 @@ const unwrap = async (module, ...args) => {
|
|
|
542
519
|
if (typeof resolved.default === "function") return resolved.default(...args);
|
|
543
520
|
return resolved;
|
|
544
521
|
};
|
|
545
|
-
|
|
546
522
|
//#endregion
|
|
547
523
|
//#region src/factory.ts
|
|
548
524
|
/**
|
|
@@ -579,16 +555,16 @@ const defineConfig = async ({ astro = false, autoDetect = true, gitignore = fals
|
|
|
579
555
|
stylisticConfig()
|
|
580
556
|
];
|
|
581
557
|
const featureConfigs = await Promise.all([
|
|
582
|
-
isTypescriptEnabled && unwrap(import("./typescript-
|
|
583
|
-
isReactEnabled && unwrap(import("./react-
|
|
584
|
-
isTanstackQueryEnabled && unwrap(import("./tanstack-query-
|
|
585
|
-
isAstroEnabled && unwrap(import("./astro-
|
|
586
|
-
isJestEnabled && unwrap(import("./jest-
|
|
587
|
-
isVitestEnabled && unwrap(import("./vitest-
|
|
588
|
-
isTestingLibraryEnabled && unwrap(import("./testing-library-
|
|
589
|
-
isPlaywrightEnabled && unwrap(import("./playwright-
|
|
590
|
-
isStorybookEnabled && unwrap(import("./storybook-
|
|
591
|
-
isNextjsEnabled && unwrap(import("./nextjs-
|
|
558
|
+
isTypescriptEnabled && unwrap(import("./typescript-BGCHPtPk.mjs"), typescript),
|
|
559
|
+
isReactEnabled && unwrap(import("./react-B-iC8XkH.mjs"), react),
|
|
560
|
+
isTanstackQueryEnabled && unwrap(import("./tanstack-query-Iadbe54U.mjs"), tanstackQuery),
|
|
561
|
+
isAstroEnabled && unwrap(import("./astro-BW3KYEZm.mjs"), astro),
|
|
562
|
+
isJestEnabled && unwrap(import("./jest-D8LgvYvq.mjs"), jest),
|
|
563
|
+
isVitestEnabled && unwrap(import("./vitest-KcLI3D-I.mjs"), vitest),
|
|
564
|
+
isTestingLibraryEnabled && unwrap(import("./testing-library-Dm05DzKm.mjs"), testingLibrary),
|
|
565
|
+
isPlaywrightEnabled && unwrap(import("./playwright-B1Eb5eas.mjs"), playwright),
|
|
566
|
+
isStorybookEnabled && unwrap(import("./storybook-DC1i76Qv.mjs"), storybook),
|
|
567
|
+
isNextjsEnabled && unwrap(import("./nextjs-DVffcTz_.mjs"), nextjs)
|
|
592
568
|
]);
|
|
593
569
|
return [
|
|
594
570
|
...gitignore ? [gitignoreConfig({ strict: false })] : [],
|
|
@@ -601,6 +577,5 @@ const defineConfig = async ({ astro = false, autoDetect = true, gitignore = fals
|
|
|
601
577
|
moreOverrides
|
|
602
578
|
].flat();
|
|
603
579
|
};
|
|
604
|
-
|
|
605
580
|
//#endregion
|
|
606
|
-
export { defineConfig };
|
|
581
|
+
export { defineConfig };
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
const extractOptions = (options) => {
|
|
10
10
|
if (typeof options !== "boolean") return options;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
12
|
//#endregion
|
|
14
13
|
//#region src/utils/interop-default.ts
|
|
15
14
|
/**
|
|
@@ -25,6 +24,5 @@ const interopDefault = async (module) => {
|
|
|
25
24
|
const resolved = await module;
|
|
26
25
|
return resolved?.default ?? resolved;
|
|
27
26
|
};
|
|
28
|
-
|
|
29
27
|
//#endregion
|
|
30
|
-
export { extractOptions as n, interopDefault as t };
|
|
28
|
+
export { extractOptions as n, interopDefault as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GLOB_E2E, GLOB_TESTS } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
3
|
-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
4
3
|
//#region src/rules/jest.ts
|
|
5
4
|
const jestRules = async (options) => {
|
|
6
5
|
const jestPlugin = await interopDefault(import("eslint-plugin-jest"));
|
|
@@ -54,7 +53,6 @@ const jestRules = async (options) => {
|
|
|
54
53
|
...options?.overrides
|
|
55
54
|
};
|
|
56
55
|
};
|
|
57
|
-
|
|
58
56
|
//#endregion
|
|
59
57
|
//#region src/configs/jest.ts
|
|
60
58
|
async function jestConfig(options) {
|
|
@@ -67,6 +65,5 @@ async function jestConfig(options) {
|
|
|
67
65
|
rules: await jestRules(extractedOptions)
|
|
68
66
|
}];
|
|
69
67
|
}
|
|
70
|
-
|
|
71
68
|
//#endregion
|
|
72
|
-
export { jestConfig as default };
|
|
69
|
+
export { jestConfig as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GLOB_NEXTJS } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
3
|
-
import { t as upwarn } from "./astro-
|
|
4
|
-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
3
|
+
import { t as upwarn } from "./astro-BW3KYEZm.mjs";
|
|
5
4
|
//#region src/rules/nextjs.ts
|
|
6
5
|
const nextjsRules = async (options) => {
|
|
7
6
|
return {
|
|
@@ -9,7 +8,6 @@ const nextjsRules = async (options) => {
|
|
|
9
8
|
...options?.overrides
|
|
10
9
|
};
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
//#endregion
|
|
14
12
|
//#region src/configs/nextjs.ts
|
|
15
13
|
async function nextjsConfig(options) {
|
|
@@ -22,6 +20,5 @@ async function nextjsConfig(options) {
|
|
|
22
20
|
rules: await nextjsRules(extractedOptions)
|
|
23
21
|
}];
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
//#endregion
|
|
27
|
-
export { nextjsConfig as default };
|
|
24
|
+
export { nextjsConfig as default };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { GLOB_PLAYWRIGHT } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
3
|
-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
3
|
+
import { t as upwarn } from "./astro-BW3KYEZm.mjs";
|
|
4
4
|
//#region src/rules/playwright.ts
|
|
5
5
|
const playwrightRules = async (options) => {
|
|
6
6
|
return {
|
|
7
|
-
...(await interopDefault(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules,
|
|
7
|
+
...upwarn((await interopDefault(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules),
|
|
8
8
|
"playwright/consistent-spacing-between-blocks": "error",
|
|
9
9
|
"playwright/expect-expect": "error",
|
|
10
10
|
"playwright/max-nested-describe": "error",
|
|
11
11
|
"playwright/no-commented-out-tests": "error",
|
|
12
12
|
"playwright/no-conditional-expect": "error",
|
|
13
13
|
"playwright/no-conditional-in-test": "error",
|
|
14
|
-
"playwright/no-duplicate-slow": "error",
|
|
15
14
|
"playwright/no-element-handle": "error",
|
|
16
15
|
"playwright/no-eval": "error",
|
|
17
16
|
"playwright/no-force-option": "error",
|
|
@@ -26,15 +25,12 @@ const playwrightRules = async (options) => {
|
|
|
26
25
|
"playwright/prefer-strict-equal": "error",
|
|
27
26
|
"playwright/prefer-to-be": "error",
|
|
28
27
|
"playwright/prefer-to-contain": "error",
|
|
29
|
-
"playwright/prefer-to-have-count": "error",
|
|
30
|
-
"playwright/prefer-to-have-length": "error",
|
|
31
28
|
"playwright/require-to-pass-timeout": "error",
|
|
32
29
|
"playwright/require-to-throw-message": "error",
|
|
33
30
|
"playwright/valid-title": "off",
|
|
34
31
|
...options?.overrides
|
|
35
32
|
};
|
|
36
33
|
};
|
|
37
|
-
|
|
38
34
|
//#endregion
|
|
39
35
|
//#region src/configs/playwright.ts
|
|
40
36
|
async function playwrightConfig(options) {
|
|
@@ -46,6 +42,5 @@ async function playwrightConfig(options) {
|
|
|
46
42
|
rules: await playwrightRules(extractedOptions)
|
|
47
43
|
}];
|
|
48
44
|
}
|
|
49
|
-
|
|
50
45
|
//#endregion
|
|
51
|
-
export { playwrightConfig as default };
|
|
46
|
+
export { playwrightConfig as default };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { GLOB_JSX, GLOB_TSX } from "./globs.mjs";
|
|
2
|
-
import { l as hasTypescript, r as hasNext, u as hasVite } from "./has-dependency-
|
|
3
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
4
|
-
import { t as upwarn } from "./astro-
|
|
2
|
+
import { l as hasTypescript, r as hasNext, u as hasVite } from "./has-dependency-BB12gGNt.mjs";
|
|
3
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
4
|
+
import { t as upwarn } from "./astro-BW3KYEZm.mjs";
|
|
5
5
|
import globals from "globals";
|
|
6
|
-
|
|
7
6
|
//#region src/rules/react.ts
|
|
8
7
|
const nextAllowedExportNames = [
|
|
9
8
|
"dynamic",
|
|
@@ -85,7 +84,6 @@ const reactRules = async (options) => {
|
|
|
85
84
|
...options?.overrides
|
|
86
85
|
};
|
|
87
86
|
};
|
|
88
|
-
|
|
89
87
|
//#endregion
|
|
90
88
|
//#region src/configs/react.ts
|
|
91
89
|
async function reactConfig(options) {
|
|
@@ -128,6 +126,5 @@ async function reactConfig(options) {
|
|
|
128
126
|
settings: { react: { version: "detect" } }
|
|
129
127
|
}];
|
|
130
128
|
}
|
|
131
|
-
|
|
132
129
|
//#endregion
|
|
133
|
-
export { reactConfig as default };
|
|
130
|
+
export { reactConfig as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
2
|
-
import { t as upwarn } from "./astro-
|
|
3
|
-
|
|
1
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
2
|
+
import { t as upwarn } from "./astro-BW3KYEZm.mjs";
|
|
4
3
|
//#region src/configs/storybook.ts
|
|
5
4
|
async function storybookConfig(options) {
|
|
6
5
|
const extractedOptions = extractOptions(options);
|
|
@@ -29,6 +28,5 @@ async function storybookConfig(options) {
|
|
|
29
28
|
}
|
|
30
29
|
];
|
|
31
30
|
}
|
|
32
|
-
|
|
33
31
|
//#endregion
|
|
34
|
-
export { storybookConfig as default };
|
|
32
|
+
export { storybookConfig as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GLOB_JSX, GLOB_TSX } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
3
|
-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
4
3
|
//#region src/configs/tanstack-query.ts
|
|
5
4
|
async function tanstackQueryConfig(options) {
|
|
6
5
|
const extractedOptions = extractOptions(options);
|
|
@@ -21,6 +20,5 @@ async function tanstackQueryConfig(options) {
|
|
|
21
20
|
}
|
|
22
21
|
}];
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
//#endregion
|
|
26
|
-
export { tanstackQueryConfig as default };
|
|
24
|
+
export { tanstackQueryConfig as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GLOB_E2E, GLOB_TESTS } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
3
|
-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
4
3
|
//#region src/rules/testing-library.ts
|
|
5
4
|
const testingLibraryRules = async (options) => {
|
|
6
5
|
const [jestDom, testingLibrary] = await Promise.all([import("eslint-plugin-jest-dom"), interopDefault(import("eslint-plugin-testing-library"))]);
|
|
@@ -11,7 +10,6 @@ const testingLibraryRules = async (options) => {
|
|
|
11
10
|
...options?.overrides
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
|
-
|
|
15
13
|
//#endregion
|
|
16
14
|
//#region src/configs/testing-library.ts
|
|
17
15
|
async function testingLibraryConfig(options) {
|
|
@@ -28,6 +26,5 @@ async function testingLibraryConfig(options) {
|
|
|
28
26
|
rules: await testingLibraryRules(extractedOptions)
|
|
29
27
|
}];
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
//#endregion
|
|
33
|
-
export { testingLibraryConfig as default };
|
|
30
|
+
export { testingLibraryConfig as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GLOB_JS, GLOB_JSX, GLOB_TESTS } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
3
|
-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
4
3
|
//#region src/rules/typescript.ts
|
|
5
4
|
const disabledEslintRules = {
|
|
6
5
|
"no-unused-private-class-members": "off",
|
|
@@ -36,7 +35,6 @@ const typescriptRules = (options) => {
|
|
|
36
35
|
...options?.overrides
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
39
|
//#region src/configs/typescript.ts
|
|
42
40
|
async function typescriptConfig(options) {
|
|
@@ -84,6 +82,5 @@ async function typescriptConfig(options) {
|
|
|
84
82
|
}] : []
|
|
85
83
|
];
|
|
86
84
|
}
|
|
87
|
-
|
|
88
85
|
//#endregion
|
|
89
|
-
export { typescriptConfig as default };
|
|
86
|
+
export { typescriptConfig as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GLOB_E2E, GLOB_TESTS, GLOB_TYPE_TESTS } from "./globs.mjs";
|
|
2
|
-
import { n as extractOptions, t as interopDefault } from "./interop-default-
|
|
3
|
-
|
|
2
|
+
import { n as extractOptions, t as interopDefault } from "./interop-default-BHC7xltH.mjs";
|
|
4
3
|
//#region src/rules/vitest.ts
|
|
5
4
|
const vitestRules = async (options) => {
|
|
6
5
|
return {
|
|
@@ -64,7 +63,6 @@ const vitestRules = async (options) => {
|
|
|
64
63
|
...options?.overrides
|
|
65
64
|
};
|
|
66
65
|
};
|
|
67
|
-
|
|
68
66
|
//#endregion
|
|
69
67
|
//#region src/configs/vitest.ts
|
|
70
68
|
async function vitestConfig(options) {
|
|
@@ -79,6 +77,5 @@ async function vitestConfig(options) {
|
|
|
79
77
|
settings: { vitest: { typecheck: extractedOptions?.typecheck ?? false } }
|
|
80
78
|
}];
|
|
81
79
|
}
|
|
82
|
-
|
|
83
80
|
//#endregion
|
|
84
|
-
export { vitestConfig as default };
|
|
81
|
+
export { vitestConfig as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "A simple, modern ESLint config that covers most use cases.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -39,37 +39,37 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
43
|
-
"@eslint/js": "^9.39.
|
|
42
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
43
|
+
"@eslint/js": "^9.39.4",
|
|
44
44
|
"@next/eslint-plugin-next": "^16.1.6",
|
|
45
|
-
"@stylistic/eslint-plugin": "^5.
|
|
45
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
46
46
|
"@tanstack/eslint-plugin-query": "^5.91.4",
|
|
47
47
|
"@types/eslint": "9.6.1",
|
|
48
|
-
"@typescript-eslint/parser": "^8.56.
|
|
49
|
-
"@typescript-eslint/utils": "^8.56.
|
|
48
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
49
|
+
"@typescript-eslint/utils": "^8.56.1",
|
|
50
50
|
"@vitest/eslint-plugin": "^1.6.9",
|
|
51
51
|
"astro-eslint-parser": "^1.3.0",
|
|
52
|
-
"eslint-config-flat-gitignore": "^2.1
|
|
52
|
+
"eslint-config-flat-gitignore": "^2.2.1",
|
|
53
53
|
"eslint-config-prettier": "^10.1.8",
|
|
54
54
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
55
55
|
"eslint-plugin-arrow-return-style-x": "^1.2.6",
|
|
56
56
|
"eslint-plugin-astro": "^1.6.0",
|
|
57
|
-
"eslint-plugin-de-morgan": "^2.
|
|
57
|
+
"eslint-plugin-de-morgan": "^2.1.1",
|
|
58
58
|
"eslint-plugin-erasable-syntax-only": "0.4.0",
|
|
59
59
|
"eslint-plugin-import-x": "^4.16.1",
|
|
60
60
|
"eslint-plugin-jest": "^29.15.0",
|
|
61
61
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
62
|
-
"eslint-plugin-jsdoc": "^62.
|
|
62
|
+
"eslint-plugin-jsdoc": "^62.7.1",
|
|
63
63
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
64
64
|
"eslint-plugin-n": "^17.24.0",
|
|
65
65
|
"eslint-plugin-perfectionist": "^5.6.0",
|
|
66
|
-
"eslint-plugin-playwright": "^2.
|
|
66
|
+
"eslint-plugin-playwright": "^2.9.0",
|
|
67
67
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
68
68
|
"eslint-plugin-react-dom": "^2.13.0",
|
|
69
69
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
70
70
|
"eslint-plugin-react-hooks-extra": "^2.13.0",
|
|
71
71
|
"eslint-plugin-react-naming-convention": "^2.13.0",
|
|
72
|
-
"eslint-plugin-react-refresh": "0.5.
|
|
72
|
+
"eslint-plugin-react-refresh": "0.5.2",
|
|
73
73
|
"eslint-plugin-react-rsc": "^2.13.0",
|
|
74
74
|
"eslint-plugin-react-web-api": "^2.13.0",
|
|
75
75
|
"eslint-plugin-react-x": "^2.13.0",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"eslint-plugin-storybook": "0.12.0",
|
|
78
78
|
"eslint-plugin-testing-library": "^7.16.0",
|
|
79
79
|
"eslint-plugin-unicorn": "^63.0.0",
|
|
80
|
-
"globals": "^17.
|
|
80
|
+
"globals": "^17.4.0",
|
|
81
81
|
"local-pkg": "^1.1.2",
|
|
82
|
-
"typescript-eslint": "^8.56.
|
|
82
|
+
"typescript-eslint": "^8.56.1"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"eslint": ">=9.38.0"
|