Skip to content

Commit cb9e808

Browse files
committed
feat: add back react-hooks-extra plugin for backward compatibility
1 parent 01cb3f9 commit cb9e808

File tree

52 files changed

+5706
-505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5706
-505
lines changed

.pkgs/eslint-plugin-local/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@stylistic/eslint-plugin": "^4.4.0",
3131
"@typescript-eslint/scope-manager": "^8.32.1",
3232
"@typescript-eslint/type-utils": "^8.32.1",
33-
"@typescript-eslint/types": "^8.32.1",
33+
"@typescript-eslint/types": "^8.33.0",
3434
"@typescript-eslint/utils": "^8.32.1",
3535
"eslint-plugin-de-morgan": "^1.2.1",
3636
"eslint-plugin-jsdoc": "^50.6.17",
@@ -47,7 +47,7 @@
4747
"tsup": "^8.5.0"
4848
},
4949
"peerDependencies": {
50-
"eslint": "^9.26.0",
50+
"eslint": "^9.27.0",
5151
"typescript": "^4.9.5 || ^5.4.5"
5252
},
5353
"engines": {

apps/website/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"@eslint-react/eff": "workspace:*",
1515
"bsky-react-post": "^0.1.7",
1616
"clsx": "^2.1.1",
17-
"fumadocs-core": "15.3.0",
17+
"fumadocs-core": "15.4.1",
1818
"fumadocs-docgen": "2.0.0",
19-
"fumadocs-mdx": "11.6.3",
20-
"fumadocs-twoslash": "3.1.2",
21-
"fumadocs-typescript": "4.0.3",
22-
"fumadocs-ui": "15.3.0",
19+
"fumadocs-mdx": "11.6.6",
20+
"fumadocs-twoslash": "3.1.3",
21+
"fumadocs-typescript": "4.0.5",
22+
"fumadocs-ui": "15.4.1",
2323
"lucide-react": "^0.511.0",
2424
"next": "^15.3.2",
2525
"next-view-transitions": "^0.3.4",
@@ -51,7 +51,7 @@
5151
"dedent": "^1.6.0",
5252
"eslint": "^9.27.0",
5353
"eslint-plugin-de-morgan": "^1.2.1",
54-
"eslint-plugin-import-x": "^4.13.1",
54+
"eslint-plugin-import-x": "^4.13.3",
5555
"eslint-plugin-perfectionist": "^4.13.0",
5656
"eslint-plugin-react-hooks": "^5.2.0",
5757
"eslint-plugin-react-refresh": "^0.4.20",

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/react-dom": "^19.1.5",
6464
"@typescript-eslint/parser": "^8.32.1",
6565
"@typescript-eslint/rule-tester": "^8.32.1",
66-
"@typescript-eslint/types": "^8.32.1",
66+
"@typescript-eslint/types": "^8.33.0",
6767
"ansis": "^4.0.0",
6868
"cspell": "^9.0.2",
6969
"dedent": "^1.6.0",
@@ -87,7 +87,7 @@
8787
"tsup": "^8.5.0",
8888
"tsx": "^4.19.4",
8989
"type-fest": "^4.41.0",
90-
"typedoc": "^0.28.4",
90+
"typedoc": "^0.28.5",
9191
"typedoc-plugin-markdown": "^4.6.3",
9292
"typedoc-plugin-mdn-links": "^5.0.2",
9393
"typescript": "^5.8.3",
@@ -110,6 +110,7 @@
110110
"overrides": {
111111
"@types/react": "^19.1.5",
112112
"@types/react-dom": "^19.1.5",
113+
"@typescript-eslint/types": "8.32.1",
113114
"cross-spawn": "^7.0.6",
114115
"esbuild": "^0.25.4",
115116
"lucide-react": "^0.511.0",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@eslint-react/var": "workspace:*",
4242
"@typescript-eslint/scope-manager": "^8.32.1",
4343
"@typescript-eslint/type-utils": "^8.32.1",
44-
"@typescript-eslint/types": "^8.32.1",
44+
"@typescript-eslint/types": "^8.33.0",
4545
"@typescript-eslint/utils": "^8.32.1",
4646
"birecord": "^0.1.1",
4747
"ts-pattern": "^5.7.1"

packages/plugins/eslint-plugin-react-debug/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@eslint-react/var": "workspace:*",
5050
"@typescript-eslint/scope-manager": "^8.32.1",
5151
"@typescript-eslint/type-utils": "^8.32.1",
52-
"@typescript-eslint/types": "^8.32.1",
52+
"@typescript-eslint/types": "^8.33.0",
5353
"@typescript-eslint/utils": "^8.32.1",
5454
"string-ts": "^2.2.1",
5555
"ts-pattern": "^5.7.1"
@@ -61,7 +61,7 @@
6161
"tsup": "^8.5.0"
6262
},
6363
"peerDependencies": {
64-
"eslint": "^9.26.0",
64+
"eslint": "^9.27.0",
6565
"typescript": "^4.9.5 || ^5.4.5"
6666
},
6767
"peerDependenciesMeta": {

packages/plugins/eslint-plugin-react-dom/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@eslint-react/shared": "workspace:*",
4949
"@eslint-react/var": "workspace:*",
5050
"@typescript-eslint/scope-manager": "^8.32.1",
51-
"@typescript-eslint/types": "^8.32.1",
51+
"@typescript-eslint/types": "^8.33.0",
5252
"@typescript-eslint/utils": "^8.32.1",
5353
"compare-versions": "^6.1.1",
5454
"string-ts": "^2.2.1",
@@ -61,7 +61,7 @@
6161
"tsup": "^8.5.0"
6262
},
6363
"peerDependencies": {
64-
"eslint": "^9.26.0",
64+
"eslint": "^9.27.0",
6565
"typescript": "^4.9.5 || ^5.4.5"
6666
},
6767
"peerDependenciesMeta": {
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# eslint-plugin-react-hooks-extra
2+
3+
Extra rules for React Hooks.
4+
5+
## Install
6+
7+
```sh
8+
# npm
9+
npm install --save-dev eslint-plugin-react-hooks-extra
10+
```
11+
12+
## Setup
13+
14+
```js
15+
// eslint.config.js
16+
17+
// @ts-check
18+
import js from "@eslint/js";
19+
import reactHooksExtra from "eslint-plugin-react-hooks-extra";
20+
import tseslint from "typescript-eslint";
21+
22+
export default tseslint.config({
23+
files: ["**/*.ts", "**/*.tsx"],
24+
extends: [
25+
js.configs.recommended,
26+
tseslint.configs.recommended,
27+
reactHooksExtra.configs.recommended,
28+
],
29+
languageOptions: {
30+
parser: tseslint.parser,
31+
parserOptions: {
32+
projectService: true,
33+
tsconfigRootDir: import.meta.dirname,
34+
},
35+
},
36+
rules: {
37+
// Put rules you want to override here
38+
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
39+
"react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
40+
},
41+
});
42+
```
43+
44+
## Rules
45+
46+
<https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"name": "eslint-plugin-react-hooks-extra",
3+
"version": "2.0.0-next.25",
4+
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
5+
"keywords": [
6+
"react",
7+
"hooks",
8+
"hooks-extra",
9+
"eslint",
10+
"eslint-react",
11+
"eslint-plugin",
12+
"eslint-plugin-react-hooks-extra"
13+
],
14+
"homepage": "https://github.com/Rel1cx/eslint-react",
15+
"bugs": {
16+
"url": "https://github.com/Rel1cx/eslint-react/issues"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/Rel1cx/eslint-react.git",
21+
"directory": "packages/plugins/eslint-plugin-react-hooks-extra"
22+
},
23+
"license": "MIT",
24+
"author": "Rel1cx<[email protected]>",
25+
"sideEffects": false,
26+
"type": "module",
27+
"exports": {
28+
".": {
29+
"types": "./dist/index.d.ts",
30+
"import": "./dist/index.js"
31+
},
32+
"./package.json": "./package.json"
33+
},
34+
"files": [
35+
"dist",
36+
"./package.json"
37+
],
38+
"scripts": {
39+
"build": "tsup --dts-resolve",
40+
"lint:publish": "publint",
41+
"lint:ts": "tsc --noEmit",
42+
"publish": "pnpm run build && pnpm run lint:publish"
43+
},
44+
"dependencies": {
45+
"@eslint-react/ast": "workspace:*",
46+
"@eslint-react/core": "workspace:*",
47+
"@eslint-react/eff": "workspace:*",
48+
"@eslint-react/kit": "workspace:*",
49+
"@eslint-react/shared": "workspace:*",
50+
"@eslint-react/var": "workspace:*",
51+
"@typescript-eslint/scope-manager": "^8.32.1",
52+
"@typescript-eslint/type-utils": "^8.32.1",
53+
"@typescript-eslint/types": "^8.33.0",
54+
"@typescript-eslint/utils": "^8.32.1",
55+
"string-ts": "^2.2.1",
56+
"ts-pattern": "^5.7.1"
57+
},
58+
"devDependencies": {
59+
"@local/configs": "workspace:*",
60+
"@types/react": "^19.1.5",
61+
"@types/react-dom": "^19.1.5",
62+
"tsup": "^8.5.0"
63+
},
64+
"peerDependencies": {
65+
"eslint": "^8.57.0 || ^9.0.0",
66+
"typescript": "^4.9.5 || ^5.3.3"
67+
},
68+
"peerDependenciesMeta": {
69+
"eslint": {
70+
"optional": false
71+
},
72+
"typescript": {
73+
"optional": true
74+
}
75+
},
76+
"engines": {
77+
"bun": ">=1.0.15",
78+
"node": ">=18.18.0"
79+
},
80+
"publishConfig": {
81+
"access": "public"
82+
}
83+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { RulePreset } from "@eslint-react/kit";
2+
3+
export const name = "react-hooks-extra/recommended";
4+
5+
export const rules = {
6+
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
7+
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
8+
"react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
9+
} as const satisfies RulePreset;

0 commit comments

Comments
 (0)