@ethang/eslint-config 19.4.2 → 19.4.4

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 CHANGED
@@ -29,9 +29,10 @@
29
29
  - 51 rules for **Astro**
30
30
  - `import astroConfig from "@ethang/eslint-config/config.astro.js";`
31
31
  - 51 rules from [eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)
32
- - 71 rules for **React**
32
+ - 73 rules for **React**
33
33
  - `import reactConfig from "@ethang/eslint-config/config.react.js";`
34
34
  - 71 rules from [@eslint-react/eslint-plugin](https://eslint-react.xyz/)
35
+ - 2 rules from [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
35
36
  - 18 rules for **Solid**
36
37
  - `import solidConfig from "@ethang/eslint-config/config.solid.js";`
37
38
  - 18 rules from [eslint-plugin-solid](https://github.com/solidjs-community/eslint-plugin-solid)
@@ -226,7 +226,7 @@ export const ruleList = [
226
226
  type: "react",
227
227
  importString: 'import reactHooks from "eslint-plugin-react-hooks";',
228
228
  pluginName: "react-hooks",
229
- pluginValue: "reactHooks",
229
+ pluginValue: "fixupPluginRules(reactHooks)",
230
230
  },
231
231
  {
232
232
  list: solidRules,
@@ -43,7 +43,10 @@ const reactFile = [
43
43
  includeReactVersion: true,
44
44
  includeIgnores: true,
45
45
  includeLanguageOptions: true,
46
- extraImports: ['import tseslint from "typescript-eslint";'],
46
+ extraImports: [
47
+ 'import tseslint from "typescript-eslint";',
48
+ 'import { fixupPluginRules } from "@eslint/compat";',
49
+ ],
47
50
  },
48
51
  },
49
52
  ];
package/config.react.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { fixupPluginRules } from "@eslint/compat";
1
2
  import { ignores, languageOptions } from "./constants.js";
2
3
  import react from "@eslint-react/eslint-plugin";
3
4
  import reactHooks from "eslint-plugin-react-hooks";
@@ -12,7 +13,7 @@ export default tseslint.config({
12
13
  },
13
14
  plugins: {
14
15
  react: react,
15
- "react-hooks": reactHooks,
16
+ "react-hooks": fixupPluginRules(reactHooks),
16
17
  },
17
18
  rules: {
18
19
  "react/avoid-shorthand-boolean": "off",
@@ -93,7 +94,7 @@ export default tseslint.config({
93
94
  "react/debug/hook": "off",
94
95
  "react/debug/is-from-react": "off",
95
96
  "react/debug/react-hooks": "off",
96
- "react-hooks/rules-of-hooks": "off",
97
- "react-hooks/exhaustive-deps": "off",
97
+ "react-hooks/rules-of-hooks": "error",
98
+ "react-hooks/exhaustive-deps": "error",
98
99
  },
99
100
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethang/eslint-config",
3
- "version": "19.4.2",
3
+ "version": "19.4.4",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/eglove/eslint-config-ethang.git"
6
6
  },
@@ -13,7 +13,8 @@
13
13
  "lint": "prettier . -w"
14
14
  },
15
15
  "dependencies": {
16
- "@eslint-react/eslint-plugin": "^1.13.0",
16
+ "@eslint-react/eslint-plugin": "^1.13.1",
17
+ "@eslint/compat": "^1.1.1",
17
18
  "@eslint/js": "^9.10.0",
18
19
  "@eslint/json": "^0.4.0",
19
20
  "@eslint/markdown": "^6.1.0",
@@ -40,13 +41,14 @@
40
41
  },
41
42
  "devDependencies": {
42
43
  "@ethang/markdown-generator": "^1.1.1",
43
- "@ethang/project-builder": "^2.5.9",
44
+ "@ethang/project-builder": "^2.5.10",
44
45
  "@tsconfig/node-lts": "^20.1.3",
45
46
  "@tsconfig/strictest": "^2.0.5",
46
47
  "prettier": "^3.3.3"
47
48
  },
48
49
  "peerDependencies": {
49
- "@eslint-react/eslint-plugin": "^1.13.0",
50
+ "@eslint-react/eslint-plugin": "^1.13.1",
51
+ "@eslint/compat": "^1.1.1",
50
52
  "@eslint/js": "^9.10.0",
51
53
  "@eslint/json": "^0.4.0",
52
54
  "@eslint/markdown": "^6.1.0",
package/setup/react.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import react from "@eslint-react/eslint-plugin";
2
2
  import reactHooks from "eslint-plugin-react-hooks";
3
3
  import { genRules } from "./gen-rules.js";
4
+ import { fixupPluginRules } from "@eslint/compat";
4
5
 
5
6
  const reactRuleNames = Object.keys(react.rules);
6
7
  const customReactRules = [
@@ -20,8 +21,8 @@ const reactGen = genRules(reactRuleNames, customReactRules, "react");
20
21
 
21
22
  const reactHookRuleNames = Object.keys(reactHooks.rules);
22
23
  const customHookRules = [
23
- { name: "exhaustive-deps", rule: "off" }, // TODO fix w/ v9 compatibility
24
- { name: "rules-of-hooks", rule: "off" }, // TODO fix w/ v9 compatibility
24
+ { name: "exhaustive-deps", rule: "error" },
25
+ { name: "rules-of-hooks", rule: "error" },
25
26
  ];
26
27
  const hookGen = genRules(reactHookRuleNames, customHookRules, "react-hooks");
27
28