@ncontiero/eslint-config 8.2.2 → 8.3.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.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 = {}, regexp = false } = options;
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-regex": regexp ? "off" : "error",
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 ? { regexp: !!enableRegexp } : enableUnicorn));
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,7 @@
1
1
  {
2
2
  "name": "@ncontiero/eslint-config",
3
3
  "type": "module",
4
- "version": "8.2.2",
4
+ "version": "8.3.0",
5
5
  "description": "Nicolas's ESLint config.",
6
6
  "author": {
7
7
  "name": "Nicolas Contiero",
@@ -39,13 +39,13 @@
39
39
  "dependencies": {
40
40
  "@e18e/eslint-plugin": "^0.5.0",
41
41
  "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
42
- "@eslint-react/eslint-plugin": "^5.8.8",
42
+ "@eslint-react/eslint-plugin": "^5.8.16",
43
43
  "@eslint/markdown": "^8.0.2",
44
- "@html-eslint/eslint-plugin": "^0.61.0",
45
- "@html-eslint/parser": "^0.61.0",
46
- "@next/eslint-plugin-next": "^16.2.6",
47
- "@typescript-eslint/eslint-plugin": "^8.60.0",
48
- "@typescript-eslint/parser": "^8.60.0",
44
+ "@html-eslint/eslint-plugin": "^0.62.0",
45
+ "@html-eslint/parser": "^0.62.0",
46
+ "@next/eslint-plugin-next": "^16.2.7",
47
+ "@typescript-eslint/eslint-plugin": "^8.61.0",
48
+ "@typescript-eslint/parser": "^8.61.0",
49
49
  "eslint-config-flat-gitignore": "^2.3.0",
50
50
  "eslint-merge-processors": "^2.0.0",
51
51
  "eslint-plugin-antfu": "^3.2.3",
@@ -53,22 +53,22 @@
53
53
  "eslint-plugin-command": "^3.5.2",
54
54
  "eslint-plugin-de-morgan": "^2.1.2",
55
55
  "eslint-plugin-import-x": "^4.16.2",
56
- "eslint-plugin-jsdoc": "^63.0.0",
56
+ "eslint-plugin-jsdoc": "^63.0.2",
57
57
  "eslint-plugin-jsonc": "^3.2.0",
58
58
  "eslint-plugin-jsx-a11y": "^6.10.2",
59
- "eslint-plugin-n": "^18.0.1",
59
+ "eslint-plugin-n": "^18.1.0",
60
60
  "eslint-plugin-perfectionist": "^5.9.0",
61
61
  "eslint-plugin-prettier": "^5.5.6",
62
62
  "eslint-plugin-promise": "^7.3.0",
63
63
  "eslint-plugin-react-refresh": "^0.5.2",
64
64
  "eslint-plugin-regexp": "^3.1.0",
65
65
  "eslint-plugin-toml": "^1.4.0",
66
- "eslint-plugin-unicorn": "^64.0.0",
66
+ "eslint-plugin-unicorn": "^65.0.1",
67
67
  "eslint-plugin-unused-imports": "^4.4.1",
68
68
  "eslint-plugin-yml": "^3.4.0",
69
69
  "globals": "^17.6.0",
70
70
  "local-pkg": "^1.2.1",
71
- "prettier": "^3.8.3",
71
+ "prettier": "^3.8.4",
72
72
  "toml-eslint-parser": "^1.0.3",
73
73
  "yaml-eslint-parser": "^2.0.0"
74
74
  },
@@ -79,19 +79,19 @@
79
79
  "@eslint/config-inspector": "^3.0.4",
80
80
  "@ncontiero/changelog-github": "^2.1.4",
81
81
  "@ncontiero/prettier-config": "^1.0.0",
82
- "@tanstack/eslint-plugin-query": "^5.100.14",
82
+ "@tanstack/eslint-plugin-query": "^5.101.0",
83
83
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
84
- "@types/node": "^25.9.1",
84
+ "@types/node": "^25.9.2",
85
85
  "eslint": "^10.4.1",
86
86
  "eslint-typegen": "^2.3.1",
87
87
  "husky": "^9.1.7",
88
88
  "nano-staged": "^1.0.2",
89
89
  "tinyexec": "^1.2.4",
90
90
  "tinyglobby": "^0.2.17",
91
- "tsdown": "^0.22.1",
91
+ "tsdown": "^0.22.2",
92
92
  "tsx": "^4.22.4",
93
93
  "typescript": "^6.0.3",
94
- "vitest": "^4.1.7"
94
+ "vitest": "^4.1.8"
95
95
  },
96
96
  "engines": {
97
97
  "node": ">=20.19.0"