@forthtilliath/eslint-config 0.6.0 → 0.8.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.
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,0FAHW,OAAO,WAAW,EAAE,iBAAiB,GAAG,kBAAkB,GACxD,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CA8E5C;AAED;;;;8CAI8C;AAC9C,0BADU,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CACK"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.js"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,0FAHW,OAAO,WAAW,EAAE,iBAAiB,GAAG,kBAAkB,GACxD,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAwF5C;AAED;;;;8CAI8C;AAC9C,0BADU,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CACK"}
package/dist/react.js CHANGED
@@ -16,6 +16,23 @@ import { createBaseConfig, createNamingConventionRule } from "./base.js";
16
16
  * @type {string[]}
17
17
  */
18
18
  const TEST_FILE_GLOBS = ["**/*.{test,spec}.{ts,tsx,js,jsx}"];
19
+ /**
20
+ * eslint-plugin-react-hooks rules that @eslint-react also implements, under
21
+ * the same name. Only the @eslint-react version is kept (see the rules block
22
+ * below); `src/nextjs.test.js` fails if a new overlap appears.
23
+ * @type {string[]}
24
+ */
25
+ const RULES_COVERED_BY_ESLINT_REACT = [
26
+ "rules-of-hooks",
27
+ "exhaustive-deps",
28
+ "static-components",
29
+ "use-memo",
30
+ "set-state-in-effect",
31
+ "error-boundaries",
32
+ "purity",
33
+ "set-state-in-render",
34
+ "unsupported-syntax",
35
+ ];
19
36
  /**
20
37
  * @typedef {object} ReactConfigOptions
21
38
  * @property {boolean} [a11y=true] - Enable eslint-plugin-jsx-a11y's
@@ -79,6 +96,14 @@ export function createReactConfig({ a11y = true, i18n = false, testingLibrary =
79
96
  settings: { react: { version: "19" } },
80
97
  rules: {
81
98
  ...pluginReactHooks.configs.recommended.rules,
99
+ // Already covered by @eslint-react's recommended-type-checked preset
100
+ // (sometimes more thoroughly: its `purity` flags `new Date()`, the
101
+ // react-hooks one doesn't). Left on, every problem is reported twice
102
+ // and every disable comment has to name both plugins.
103
+ ...Object.fromEntries(RULES_COVERED_BY_ESLINT_REACT.map((rule) => [
104
+ `react-hooks/${rule}`,
105
+ "off",
106
+ ])),
82
107
  // React scope no longer necessary with new JSX transform.
83
108
  "react/react-in-jsx-scope": "off",
84
109
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forthtilliath/eslint-config",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -34,14 +34,14 @@
34
34
  "eslint-plugin-react-native": "^5.0.0",
35
35
  "eslint-plugin-react-refresh": "^0.5.4",
36
36
  "eslint-plugin-simple-import-sort": "^13.0.0",
37
- "eslint-plugin-storybook": "^9.1.20",
37
+ "eslint-plugin-storybook": "^10.6.1",
38
38
  "eslint-plugin-testing-library": "^7.16.2",
39
39
  "eslint-plugin-turbo": "^2.10.9",
40
40
  "globals": "^17.9.0",
41
41
  "typescript-eslint": "^8.67.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "eslint": ">=9.0.0",
44
+ "eslint": "^9.0.0 || ^10.0.0",
45
45
  "typescript": ">=5.0.0"
46
46
  },
47
47
  "devDependencies": {
@@ -49,13 +49,13 @@
49
49
  "eslint": "10.7.0",
50
50
  "rxjs": "^7.8.0",
51
51
  "typescript": "^5.9.3",
52
- "vitest": "^4.1.10",
53
- "@forthtilliath/typescript-config": "0.1.0"
52
+ "vitest": "^5.0.2",
53
+ "@forthtilliath/typescript-config": "0.1.1"
54
54
  },
55
55
  "scripts": {
56
56
  "dev": "tsc --watch -p tsconfig.build.json",
57
57
  "build": "tsc -p tsconfig.build.json",
58
- "clean": "rm -rf dist",
58
+ "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
59
59
  "check-types": "tsc --noEmit",
60
60
  "lint": "eslint . --max-warnings 0",
61
61
  "test": "vitest run",