Skip to content

Commit

Permalink
chore: 升级 eslint 至 v8
Browse files Browse the repository at this point in the history
升级 eslint 相关依赖至最新版本
升级 eslint 基础配置文件至最新版本
解决 eslint 报错
  • Loading branch information
xyy94813 committed Mar 15, 2024
1 parent 5a07e8a commit e9a11e1
Show file tree
Hide file tree
Showing 4 changed files with 3,192 additions and 8,829 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ module.exports = {
extends: ['plugin:react/recommended', 'airbnb', 'plugin:storybook/recommended'],
plugins: ['react', 'react-hooks'],
rules: {
'no-restricted-exports': 'off',
'import/extensions': ['error', 'never'],
'import/no-extraneous-dependencies': ['error', { peerDependencies: true }],
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'react/state-in-constructor': ['error', 'never'],
'react/function-component-definition': ['error', {
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
}],
'react-hooks/rules-of-hooks': 'error', // check hook's rule
'react-hooks/exhaustive-deps': 'warn', // check effect's dependencies
},
Expand Down
Loading

0 comments on commit e9a11e1

Please sign in to comment.