Skip to content

Commit

Permalink
config: 安装 eslint-plugin-react-refresh 插件,检测是否仅导出 react 组件
Browse files Browse the repository at this point in the history
  • Loading branch information
kangood committed Feb 18, 2024
1 parent 3ae8aa8 commit ec7908c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
'prettier',
'react',
'react-hooks',
'react-refresh',
'jsx-a11y',
'import',
'unused-imports',
Expand Down Expand Up @@ -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,
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ec7908c

Please sign in to comment.