@ncontiero/eslint-config 8.2.1 → 8.3.0-beta.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/index.d.mts +401 -183
- package/dist/index.mjs +22 -4
- package/package.json +47 -45
package/dist/index.mjs
CHANGED
|
@@ -920,6 +920,7 @@ const ReactRouterPackages = [
|
|
|
920
920
|
"@react-router/serve",
|
|
921
921
|
"@react-router/dev"
|
|
922
922
|
];
|
|
923
|
+
const TanstackRouterPackages = ["@tanstack/react-router"];
|
|
923
924
|
const NextJsPackages = ["next"];
|
|
924
925
|
async function react(options = {}) {
|
|
925
926
|
const { files = [GLOB_SRC], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`], overrides = {}, tsconfigPath } = options;
|
|
@@ -931,6 +932,7 @@ async function react(options = {}) {
|
|
|
931
932
|
const [pluginReact, pluginReactRefresh] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin")), interopDefault(import("eslint-plugin-react-refresh"))]);
|
|
932
933
|
const isAllowConstantExport = ReactRefreshAllowPackages.some((i) => isPackageExists(i));
|
|
933
934
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
935
|
+
const isUsingTanstackRouter = TanstackRouterPackages.some((i) => isPackageExists(i));
|
|
934
936
|
const isUsingNextJs = NextJsPackages.some((i) => isPackageExists(i));
|
|
935
937
|
return [
|
|
936
938
|
{
|
|
@@ -977,6 +979,15 @@ async function react(options = {}) {
|
|
|
977
979
|
"clientAction",
|
|
978
980
|
"handle",
|
|
979
981
|
"shouldRevalidate"
|
|
982
|
+
] : []],
|
|
983
|
+
extraHOCs: [...isUsingTanstackRouter ? [
|
|
984
|
+
"createFileRoute",
|
|
985
|
+
"createLazyFileRoute",
|
|
986
|
+
"createRootRoute",
|
|
987
|
+
"createRootRouteWithContext",
|
|
988
|
+
"createLink",
|
|
989
|
+
"createRoute",
|
|
990
|
+
"createLazyRoute"
|
|
980
991
|
] : []]
|
|
981
992
|
}],
|
|
982
993
|
"react/dom-no-missing-button-type": "warn",
|
|
@@ -1521,29 +1532,34 @@ async function typescript(options = {}) {
|
|
|
1521
1532
|
//#endregion
|
|
1522
1533
|
//#region src/configs/unicorn.ts
|
|
1523
1534
|
function unicorn(options = {}) {
|
|
1524
|
-
const { allRecommended, overrides = {}
|
|
1535
|
+
const { allRecommended, overrides = {} } = options;
|
|
1525
1536
|
return [{
|
|
1526
1537
|
name: "ncontiero/unicorn/rules",
|
|
1527
1538
|
plugins: { unicorn: pluginUnicorn },
|
|
1528
1539
|
rules: {
|
|
1529
1540
|
...allRecommended ? pluginUnicorn.configs.recommended.rules : {
|
|
1530
|
-
"unicorn/better-
|
|
1541
|
+
"unicorn/better-dom-traversing": "error",
|
|
1531
1542
|
"unicorn/catch-error-name": "error",
|
|
1532
1543
|
"unicorn/consistent-date-clone": "error",
|
|
1533
1544
|
"unicorn/consistent-empty-array-spread": "error",
|
|
1534
1545
|
"unicorn/consistent-existence-index-check": "error",
|
|
1535
1546
|
"unicorn/consistent-function-scoping": "error",
|
|
1536
1547
|
"unicorn/custom-error-definition": "error",
|
|
1548
|
+
"unicorn/dom-node-dataset": "error",
|
|
1537
1549
|
"unicorn/error-message": "error",
|
|
1538
1550
|
"unicorn/escape-case": "error",
|
|
1539
1551
|
"unicorn/explicit-length-check": "error",
|
|
1540
1552
|
"unicorn/new-for-builtins": "error",
|
|
1541
1553
|
"unicorn/no-array-callback-reference": "error",
|
|
1554
|
+
"unicorn/no-array-fill-with-reference-type": "error",
|
|
1555
|
+
"unicorn/no-array-from-fill": "error",
|
|
1542
1556
|
"unicorn/no-array-method-this-argument": "error",
|
|
1543
1557
|
"unicorn/no-await-in-promise-methods": "error",
|
|
1558
|
+
"unicorn/no-blob-to-file": "error",
|
|
1544
1559
|
"unicorn/no-console-spaces": "error",
|
|
1545
1560
|
"unicorn/no-for-loop": "error",
|
|
1546
1561
|
"unicorn/no-hex-escape": "error",
|
|
1562
|
+
"unicorn/no-incorrect-query-selector": "error",
|
|
1547
1563
|
"unicorn/no-instanceof-builtins": "error",
|
|
1548
1564
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1549
1565
|
"unicorn/no-lonely-if": "error",
|
|
@@ -1555,7 +1571,9 @@ function unicorn(options = {}) {
|
|
|
1555
1571
|
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
1556
1572
|
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
1557
1573
|
"unicorn/no-unnecessary-await": "error",
|
|
1574
|
+
"unicorn/no-unnecessary-nested-ternary": "error",
|
|
1558
1575
|
"unicorn/no-unnecessary-slice-end": "error",
|
|
1576
|
+
"unicorn/no-unused-array-method-return": "error",
|
|
1559
1577
|
"unicorn/no-useless-iterator-to-array": "error",
|
|
1560
1578
|
"unicorn/no-zero-fractions": "error",
|
|
1561
1579
|
"unicorn/number-literal-case": "error",
|
|
@@ -1563,13 +1581,13 @@ function unicorn(options = {}) {
|
|
|
1563
1581
|
"unicorn/prefer-array-find": "error",
|
|
1564
1582
|
"unicorn/prefer-array-flat-map": "error",
|
|
1565
1583
|
"unicorn/prefer-array-index-of": "error",
|
|
1584
|
+
"unicorn/prefer-array-last-methods": "error",
|
|
1566
1585
|
"unicorn/prefer-array-some": "error",
|
|
1567
1586
|
"unicorn/prefer-at": "error",
|
|
1568
1587
|
"unicorn/prefer-blob-reading-methods": "error",
|
|
1569
1588
|
"unicorn/prefer-class-fields": "error",
|
|
1570
1589
|
"unicorn/prefer-date-now": "error",
|
|
1571
1590
|
"unicorn/prefer-dom-node-append": "error",
|
|
1572
|
-
"unicorn/prefer-dom-node-dataset": "error",
|
|
1573
1591
|
"unicorn/prefer-dom-node-remove": "error",
|
|
1574
1592
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
1575
1593
|
"unicorn/prefer-includes": "error",
|
|
@@ -1750,7 +1768,7 @@ function ncontiero(options = {}, ...userConfigs) {
|
|
|
1750
1768
|
}));
|
|
1751
1769
|
if (enableDeMorgan) configs.push(deMorgan());
|
|
1752
1770
|
if (enableE18e) configs.push(e18e(enableE18e === true ? {} : enableE18e));
|
|
1753
|
-
if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {
|
|
1771
|
+
if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
1754
1772
|
if (enableJsx) configs.push(jsx(enableJsx === true ? {} : enableJsx));
|
|
1755
1773
|
if (enableTypescript) configs.push(typescript({
|
|
1756
1774
|
...typescriptOptions,
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncontiero/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.3.0-beta.0",
|
|
5
|
+
"packageManager": "pnpm@11.5.2",
|
|
5
6
|
"description": "Nicolas's ESLint config.",
|
|
6
7
|
"author": {
|
|
7
8
|
"name": "Nicolas Contiero",
|
|
@@ -27,6 +28,20 @@
|
|
|
27
28
|
"publishConfig": {
|
|
28
29
|
"access": "public"
|
|
29
30
|
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "pnpm typegen && tsdown",
|
|
33
|
+
"dev": "pnpm inspector",
|
|
34
|
+
"build:inspector": "pnpm build && pnpm inspector build --outDir .eslint-config-inspector",
|
|
35
|
+
"typegen": "tsx scripts/typegen.ts",
|
|
36
|
+
"inspector": "eslint-config-inspector --config eslint-inspector.config.ts",
|
|
37
|
+
"test": "vitest",
|
|
38
|
+
"lint": "eslint .",
|
|
39
|
+
"lint:fix": "pnpm lint --fix",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"check": "pnpm lint && pnpm typecheck",
|
|
42
|
+
"release": "changeset publish",
|
|
43
|
+
"prepare": "husky"
|
|
44
|
+
},
|
|
30
45
|
"peerDependencies": {
|
|
31
46
|
"@tanstack/eslint-plugin-query": ">=5.50.0",
|
|
32
47
|
"eslint": ">=9.20.0"
|
|
@@ -38,14 +53,14 @@
|
|
|
38
53
|
},
|
|
39
54
|
"dependencies": {
|
|
40
55
|
"@e18e/eslint-plugin": "^0.5.0",
|
|
41
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.
|
|
42
|
-
"@eslint-react/eslint-plugin": "^5.
|
|
43
|
-
"@eslint/markdown": "^8.0.
|
|
44
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
45
|
-
"@html-eslint/parser": "^0.
|
|
46
|
-
"@next/eslint-plugin-next": "^16.2.
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
48
|
-
"@typescript-eslint/parser": "^8.
|
|
56
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
57
|
+
"@eslint-react/eslint-plugin": "^5.8.16",
|
|
58
|
+
"@eslint/markdown": "^8.0.2",
|
|
59
|
+
"@html-eslint/eslint-plugin": "^0.62.0",
|
|
60
|
+
"@html-eslint/parser": "^0.62.0",
|
|
61
|
+
"@next/eslint-plugin-next": "^16.2.7",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.61.0",
|
|
63
|
+
"@typescript-eslint/parser": "^8.61.0",
|
|
49
64
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
50
65
|
"eslint-merge-processors": "^2.0.0",
|
|
51
66
|
"eslint-plugin-antfu": "^3.2.3",
|
|
@@ -53,45 +68,45 @@
|
|
|
53
68
|
"eslint-plugin-command": "^3.5.2",
|
|
54
69
|
"eslint-plugin-de-morgan": "^2.1.2",
|
|
55
70
|
"eslint-plugin-import-x": "^4.16.2",
|
|
56
|
-
"eslint-plugin-jsdoc": "^
|
|
57
|
-
"eslint-plugin-jsonc": "^3.
|
|
71
|
+
"eslint-plugin-jsdoc": "^63.0.2",
|
|
72
|
+
"eslint-plugin-jsonc": "^3.2.0",
|
|
58
73
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
59
|
-
"eslint-plugin-n": "^18.0
|
|
74
|
+
"eslint-plugin-n": "^18.1.0",
|
|
60
75
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
61
|
-
"eslint-plugin-prettier": "^5.5.
|
|
76
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
62
77
|
"eslint-plugin-promise": "^7.3.0",
|
|
63
78
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
64
79
|
"eslint-plugin-regexp": "^3.1.0",
|
|
65
|
-
"eslint-plugin-toml": "^1.
|
|
66
|
-
"eslint-plugin-unicorn": "^
|
|
80
|
+
"eslint-plugin-toml": "^1.4.0",
|
|
81
|
+
"eslint-plugin-unicorn": "^65.0.1",
|
|
67
82
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
68
|
-
"eslint-plugin-yml": "^3.
|
|
83
|
+
"eslint-plugin-yml": "^3.4.0",
|
|
69
84
|
"globals": "^17.6.0",
|
|
70
|
-
"local-pkg": "^1.1
|
|
71
|
-
"prettier": "^3.8.
|
|
85
|
+
"local-pkg": "^1.2.1",
|
|
86
|
+
"prettier": "^3.8.4",
|
|
72
87
|
"toml-eslint-parser": "^1.0.3",
|
|
73
88
|
"yaml-eslint-parser": "^2.0.0"
|
|
74
89
|
},
|
|
75
90
|
"devDependencies": {
|
|
76
91
|
"@changesets/cli": "^2.31.0",
|
|
77
|
-
"@commitlint/cli": "^21.0.
|
|
78
|
-
"@commitlint/config-conventional": "^21.0.
|
|
79
|
-
"@eslint/config-inspector": "^3.0.
|
|
80
|
-
"@ncontiero/changelog-github": "^2.1.
|
|
92
|
+
"@commitlint/cli": "^21.0.2",
|
|
93
|
+
"@commitlint/config-conventional": "^21.0.2",
|
|
94
|
+
"@eslint/config-inspector": "^3.0.4",
|
|
95
|
+
"@ncontiero/changelog-github": "^2.1.4",
|
|
81
96
|
"@ncontiero/prettier-config": "^1.0.0",
|
|
82
|
-
"@tanstack/eslint-plugin-query": "^5.
|
|
97
|
+
"@tanstack/eslint-plugin-query": "^5.101.0",
|
|
83
98
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
84
|
-
"@types/node": "^25.
|
|
85
|
-
"eslint": "^10.
|
|
99
|
+
"@types/node": "^25.9.2",
|
|
100
|
+
"eslint": "^10.4.1",
|
|
86
101
|
"eslint-typegen": "^2.3.1",
|
|
87
102
|
"husky": "^9.1.7",
|
|
88
103
|
"nano-staged": "^1.0.2",
|
|
89
|
-
"tinyexec": "^1.
|
|
90
|
-
"tinyglobby": "^0.2.
|
|
91
|
-
"tsdown": "^0.22.
|
|
92
|
-
"tsx": "^4.
|
|
104
|
+
"tinyexec": "^1.2.4",
|
|
105
|
+
"tinyglobby": "^0.2.17",
|
|
106
|
+
"tsdown": "^0.22.2",
|
|
107
|
+
"tsx": "^4.22.4",
|
|
93
108
|
"typescript": "^6.0.3",
|
|
94
|
-
"vitest": "^4.1.
|
|
109
|
+
"vitest": "^4.1.8"
|
|
95
110
|
},
|
|
96
111
|
"engines": {
|
|
97
112
|
"node": ">=20.19.0"
|
|
@@ -99,18 +114,5 @@
|
|
|
99
114
|
"nano-staged": {
|
|
100
115
|
"*": "pnpm lint:fix"
|
|
101
116
|
},
|
|
102
|
-
"prettier": "@ncontiero/prettier-config"
|
|
103
|
-
|
|
104
|
-
"build": "pnpm typegen && tsdown",
|
|
105
|
-
"dev": "pnpm inspector",
|
|
106
|
-
"build:inspector": "pnpm build && pnpm inspector build --outDir .eslint-config-inspector",
|
|
107
|
-
"typegen": "tsx scripts/typegen.ts",
|
|
108
|
-
"inspector": "eslint-config-inspector --config eslint-inspector.config.ts",
|
|
109
|
-
"test": "vitest",
|
|
110
|
-
"lint": "eslint .",
|
|
111
|
-
"lint:fix": "pnpm lint --fix",
|
|
112
|
-
"typecheck": "tsc --noEmit",
|
|
113
|
-
"check": "pnpm lint && pnpm typecheck",
|
|
114
|
-
"release": "changeset publish"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
+
"prettier": "@ncontiero/prettier-config"
|
|
118
|
+
}
|