@jimmy.codes/eslint-config 5.3.0 → 5.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/README.md +28 -73
- package/dist/index.d.ts +5789 -3915
- package/dist/index.js +78 -16
- package/dist/{tanstack-query-UHBVVQ7V.js → tanstack-query-P4IBOLDK.js} +4 -3
- package/package.json +12 -11
package/dist/index.js
CHANGED
|
@@ -432,6 +432,70 @@ var regexpConfig = () => {
|
|
|
432
432
|
];
|
|
433
433
|
};
|
|
434
434
|
|
|
435
|
+
// src/configs/stylistic.ts
|
|
436
|
+
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
437
|
+
|
|
438
|
+
// src/rules/stylistic.ts
|
|
439
|
+
var stylisticRules = {
|
|
440
|
+
"@stylistic/object-curly-newline": [
|
|
441
|
+
"error",
|
|
442
|
+
{
|
|
443
|
+
consistent: true,
|
|
444
|
+
multiline: true
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"@stylistic/object-property-newline": [
|
|
448
|
+
"error",
|
|
449
|
+
{ allowAllPropertiesOnSameLine: true }
|
|
450
|
+
],
|
|
451
|
+
"@stylistic/padding-line-between-statements": [
|
|
452
|
+
"error",
|
|
453
|
+
{
|
|
454
|
+
blankLine: "always",
|
|
455
|
+
next: "return",
|
|
456
|
+
prev: "*"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
blankLine: "always",
|
|
460
|
+
next: "*",
|
|
461
|
+
prev: ["const", "let", "var"]
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
blankLine: "any",
|
|
465
|
+
next: ["const", "let", "var"],
|
|
466
|
+
prev: ["const", "let", "var"]
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
blankLine: "always",
|
|
470
|
+
next: "*",
|
|
471
|
+
prev: "directive"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
blankLine: "any",
|
|
475
|
+
next: "directive",
|
|
476
|
+
prev: "directive"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
blankLine: "always",
|
|
480
|
+
next: "function",
|
|
481
|
+
prev: "*"
|
|
482
|
+
}
|
|
483
|
+
]
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
// src/configs/stylistic.ts
|
|
487
|
+
function stylisticConfig() {
|
|
488
|
+
return [
|
|
489
|
+
{
|
|
490
|
+
name: "jimmy.codes/stylistic",
|
|
491
|
+
plugins: {
|
|
492
|
+
"@stylistic": stylisticPlugin
|
|
493
|
+
},
|
|
494
|
+
rules: stylisticRules
|
|
495
|
+
}
|
|
496
|
+
];
|
|
497
|
+
}
|
|
498
|
+
|
|
435
499
|
// src/configs/unicorn.ts
|
|
436
500
|
import eslintPluginUnicorn2 from "eslint-plugin-unicorn";
|
|
437
501
|
|
|
@@ -492,22 +556,19 @@ var defineConfig = async ({
|
|
|
492
556
|
typescript = false,
|
|
493
557
|
vitest = false
|
|
494
558
|
} = {}, ...moreOverrides) => {
|
|
495
|
-
const
|
|
559
|
+
const getFlag = (explicit, detector) => {
|
|
496
560
|
return explicit || autoDetect && detector();
|
|
497
561
|
};
|
|
498
|
-
const isTypescriptEnabled =
|
|
499
|
-
const isReactEnabled =
|
|
500
|
-
const isAstroEnabled =
|
|
501
|
-
const isTanstackQueryEnabled =
|
|
502
|
-
const isTestingLibraryEnabled =
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
);
|
|
506
|
-
const
|
|
507
|
-
const
|
|
508
|
-
const isNextjsEnabled = resolveFlag(nextjs, hasNext);
|
|
509
|
-
const isJestEnabled = resolveFlag(jest, hasJest);
|
|
510
|
-
const isVitestEnabled = resolveFlag(vitest, hasVitest);
|
|
562
|
+
const isTypescriptEnabled = getFlag(typescript, hasTypescript);
|
|
563
|
+
const isReactEnabled = getFlag(react, hasReact);
|
|
564
|
+
const isAstroEnabled = getFlag(astro, hasAstro);
|
|
565
|
+
const isTanstackQueryEnabled = getFlag(tanstackQuery, hasReactQuery);
|
|
566
|
+
const isTestingLibraryEnabled = getFlag(testingLibrary, hasTestingLibrary);
|
|
567
|
+
const isPlaywrightEnabled = getFlag(playwright, hasPlaywright);
|
|
568
|
+
const isStorybookEnabled = getFlag(storybook, hasStorybook);
|
|
569
|
+
const isNextjsEnabled = getFlag(nextjs, hasNext);
|
|
570
|
+
const isJestEnabled = getFlag(jest, hasJest);
|
|
571
|
+
const isVitestEnabled = getFlag(vitest, hasVitest);
|
|
511
572
|
const baseConfigs = [
|
|
512
573
|
javascriptConfig(),
|
|
513
574
|
perfectionistConfig(),
|
|
@@ -516,12 +577,13 @@ var defineConfig = async ({
|
|
|
516
577
|
eslintCommentsConfig(),
|
|
517
578
|
regexpConfig(),
|
|
518
579
|
jsdocConfig(),
|
|
519
|
-
importsConfig({ typescript: isTypescriptEnabled })
|
|
580
|
+
importsConfig({ typescript: isTypescriptEnabled }),
|
|
581
|
+
stylisticConfig()
|
|
520
582
|
];
|
|
521
583
|
const featureConfigs = await Promise.all([
|
|
522
584
|
isTypescriptEnabled && unwrap(import("./typescript-IBCLQD7Q.js")),
|
|
523
585
|
isReactEnabled && unwrap(import("./react-X5DWOH4Y.js")),
|
|
524
|
-
isTanstackQueryEnabled && unwrap(import("./tanstack-query-
|
|
586
|
+
isTanstackQueryEnabled && unwrap(import("./tanstack-query-P4IBOLDK.js")),
|
|
525
587
|
isAstroEnabled && unwrap(import("./astro-Z5RFF624.js")),
|
|
526
588
|
isJestEnabled && unwrap(import("./jest-AHG2WRSU.js")),
|
|
527
589
|
isVitestEnabled && unwrap(import("./vitest-YI6KNRZE.js")),
|
|
@@ -14,14 +14,15 @@ async function tanstackQueryConfig() {
|
|
|
14
14
|
return [
|
|
15
15
|
{
|
|
16
16
|
files: [GLOB_JSX, GLOB_TSX],
|
|
17
|
-
name: "jimmy.codes/react
|
|
17
|
+
name: "jimmy.codes/tanstack/react-query",
|
|
18
18
|
plugins: {
|
|
19
|
-
// TODO: remove unknown conversion when Plugin type is exported by @tanstack/query
|
|
20
19
|
"@tanstack/query": queryPlugin
|
|
21
20
|
},
|
|
22
21
|
rules: {
|
|
23
22
|
"@tanstack/query/exhaustive-deps": "error",
|
|
24
|
-
"@tanstack/query/
|
|
23
|
+
"@tanstack/query/infinite-query-property-order": "error",
|
|
24
|
+
"@tanstack/query/no-rest-destructuring": "error",
|
|
25
|
+
"@tanstack/query/no-unstable-deps": "error",
|
|
25
26
|
"@tanstack/query/stable-query-client": "error"
|
|
26
27
|
}
|
|
27
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "A pragmatic and opinionated ESLint config for modern development.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -24,24 +24,25 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
27
|
-
"@eslint/js": "^9.
|
|
28
|
-
"@next/eslint-plugin-next": "^15.
|
|
29
|
-
"@
|
|
27
|
+
"@eslint/js": "^9.22.0",
|
|
28
|
+
"@next/eslint-plugin-next": "^15.2.3",
|
|
29
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
30
|
+
"@tanstack/eslint-plugin-query": "^5.68.0",
|
|
30
31
|
"@types/eslint": "9.6.1",
|
|
31
|
-
"@typescript-eslint/parser": "^8.
|
|
32
|
-
"@typescript-eslint/utils": "^8.
|
|
32
|
+
"@typescript-eslint/parser": "^8.27.0",
|
|
33
|
+
"@typescript-eslint/utils": "^8.27.0",
|
|
33
34
|
"@vitest/eslint-plugin": "^1.1.38",
|
|
34
35
|
"astro-eslint-parser": "^1.2.1",
|
|
35
36
|
"eslint-config-prettier": "^10.1.1",
|
|
36
|
-
"eslint-import-resolver-typescript": "^4.2.
|
|
37
|
+
"eslint-import-resolver-typescript": "^4.2.2",
|
|
37
38
|
"eslint-plugin-astro": "^1.3.1",
|
|
38
|
-
"eslint-plugin-import-x": "^4.
|
|
39
|
+
"eslint-plugin-import-x": "^4.9.1",
|
|
39
40
|
"eslint-plugin-jest": "^28.11.0",
|
|
40
41
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
41
42
|
"eslint-plugin-jsdoc": "^50.6.8",
|
|
42
43
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
43
44
|
"eslint-plugin-n": "^17.16.2",
|
|
44
|
-
"eslint-plugin-perfectionist": "^4.
|
|
45
|
+
"eslint-plugin-perfectionist": "^4.10.1",
|
|
45
46
|
"eslint-plugin-playwright": "^2.2.0",
|
|
46
47
|
"eslint-plugin-react": "^7.37.4",
|
|
47
48
|
"eslint-plugin-react-compiler": "19.0.0-beta-3229e95-20250315",
|
|
@@ -52,8 +53,8 @@
|
|
|
52
53
|
"eslint-plugin-testing-library": "^7.1.1",
|
|
53
54
|
"eslint-plugin-unicorn": "^57.0.0",
|
|
54
55
|
"globals": "^16.0.0",
|
|
55
|
-
"local-pkg": "^1.
|
|
56
|
-
"typescript-eslint": "^8.
|
|
56
|
+
"local-pkg": "^1.1.1",
|
|
57
|
+
"typescript-eslint": "^8.27.0"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
60
|
"eslint": "^9.10.0"
|