feat(react): rules of hooks (#117)

Co-authored-by: nnmax <hi.max@foxemail.com>
This commit is contained in:
max 2022-09-19 10:24:45 +08:00 committed by GitHub
parent e9f0988b4d
commit ae904df91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,7 @@
module.exports = { module.exports = {
extends: [ extends: [
'plugin:react/recommended', 'plugin:react/recommended',
'plugin:react-hooks/recommended',
'@antfu/eslint-config-ts', '@antfu/eslint-config-ts',
], ],
settings: { settings: {

View File

@ -20,7 +20,8 @@
}, },
"dependencies": { "dependencies": {
"@antfu/eslint-config-ts": "workspace:*", "@antfu/eslint-config-ts": "workspace:*",
"eslint-plugin-react": "^7.31.1" "eslint-plugin-react": "^7.31.1",
"eslint-plugin-react-hooks": "^4.6.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.23.0", "eslint": "^8.23.0",

View File

@ -100,11 +100,13 @@ importers:
'@antfu/eslint-config-ts': workspace:* '@antfu/eslint-config-ts': workspace:*
eslint: ^8.23.0 eslint: ^8.23.0
eslint-plugin-react: ^7.31.1 eslint-plugin-react: ^7.31.1
eslint-plugin-react-hooks: ^4.6.0
react: ^18.2.0 react: ^18.2.0
typescript: ^4.8.2 typescript: ^4.8.2
dependencies: dependencies:
'@antfu/eslint-config-ts': link:../typescript '@antfu/eslint-config-ts': link:../typescript
eslint-plugin-react: 7.31.1_eslint@8.23.0 eslint-plugin-react: 7.31.1_eslint@8.23.0
eslint-plugin-react-hooks: 4.6.0_eslint@8.23.0
devDependencies: devDependencies:
eslint: 8.23.0 eslint: 8.23.0
react: 18.2.0 react: 18.2.0
@ -1858,6 +1860,15 @@ packages:
eslint: 8.23.0 eslint: 8.23.0
dev: false dev: false
/eslint-plugin-react-hooks/4.6.0_eslint@8.23.0:
resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==}
engines: {node: '>=10'}
peerDependencies:
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
dependencies:
eslint: 8.23.0
dev: false
/eslint-plugin-react/7.31.1_eslint@8.23.0: /eslint-plugin-react/7.31.1_eslint@8.23.0:
resolution: {integrity: sha512-j4/2xWqt/R7AZzG8CakGHA6Xa/u7iR8Q3xCxY+AUghdT92bnIDOBEefV456OeH0QvBcroVc0eyvrrLSyQGYIfg==} resolution: {integrity: sha512-j4/2xWqt/R7AZzG8CakGHA6Xa/u7iR8Q3xCxY+AUghdT92bnIDOBEefV456OeH0QvBcroVc0eyvrrLSyQGYIfg==}
engines: {node: '>=4'} engines: {node: '>=4'}