From ec7908c9363aaa22fdb6d7a61161bbb8b671afc8 Mon Sep 17 00:00:00 2001 From: kangod Date: Sun, 18 Feb 2024 15:52:04 +0800 Subject: [PATCH] =?UTF-8?q?config:=20=E5=AE=89=E8=A3=85=20eslint-plugin-re?= =?UTF-8?q?act-refresh=20=E6=8F=92=E4=BB=B6=EF=BC=8C=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E4=BB=85=E5=AF=BC=E5=87=BA=20react=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 2 ++ package.json | 1 + pnpm-lock.yaml | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 375883e..3c0aef8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -42,6 +42,7 @@ module.exports = { 'prettier', 'react', 'react-hooks', + 'react-refresh', 'jsx-a11y', 'import', 'unused-imports', @@ -72,6 +73,7 @@ module.exports = { 'react/require-default-props': 'off', 'react/no-array-index-key': 'off', 'react/jsx-props-no-spreading': 'off', + 'react-refresh/only-export-components': 'warn', 'react/function-component-definition': [ 2, { diff --git a/package.json b/package.json index fda77a5..b7d240f 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.5", "eslint-plugin-unused-imports": "^2.0.0", "lint-staged": "^13.3.0", "msw": "^1.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d2d61e..2137d87 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -235,6 +235,9 @@ devDependencies: eslint-plugin-react-hooks: specifier: ^4.6.0 version: 4.6.0(eslint@8.51.0) + eslint-plugin-react-refresh: + specifier: ^0.4.5 + version: 0.4.5(eslint@8.51.0) eslint-plugin-unused-imports: specifier: ^2.0.0 version: 2.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint@8.51.0) @@ -5167,6 +5170,14 @@ packages: eslint: 8.51.0 dev: true + /eslint-plugin-react-refresh@0.4.5(eslint@8.51.0): + resolution: {integrity: sha512-D53FYKJa+fDmZMtriODxvhwrO+IOqrxoEo21gMA0sjHdU6dPVH4OhyFip9ypl8HOF5RV5KdTo+rBQLvnY2cO8w==} + peerDependencies: + eslint: '>=7' + dependencies: + eslint: 8.51.0 + dev: true + /eslint-plugin-react@7.33.2(eslint@8.51.0): resolution: {integrity: sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==} engines: {node: '>=4'}