Skip to content

Commit

Permalink
feat(eslint): add react hooks rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed Jun 4, 2024
1 parent a3173c0 commit f52c00e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/eslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export const eslint = {
'no-empty': 'warn',
'no-extra-boolean-cast': 'warn',
'no-unused-vars': 0,
'react/display-name': 0,
'react/prop-types': 0,
'react/react-in-jsx-scope': 0,
'unicorn/explicit-length-check': 'warn',
'unicorn/filename-case': 0,
'unicorn/no-array-for-each': 'warn',
Expand Down Expand Up @@ -75,14 +72,22 @@ export const eslint = {
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'react/jsx-sort-props': 'warn',
'react/jsx-no-useless-fragment': 'off',
'array-callback-return': 'warn',
'guard-for-in': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': 'warn',
'react/display-name': 0,
'react/prop-types': 0,
'react/react-in-jsx-scope': 0,
'react/jsx-key': 'error',
'react/jsx-no-useless-fragment': 'off',
'react/jsx-sort-props': 'warn',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-unescaped-entities': 'warn',
'react/no-unknown-property': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// ~ merge from eslint-config-tenx
'unicorn/prefer-node-protocol': 0,
'unicorn/consistent-destructuring': 0,
Expand Down Expand Up @@ -126,9 +131,6 @@ export const eslint = {
allowEmptyReject: true,
},
],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-key': 'error',
...eslintConfigPrettier.rules,
},
overrides: [
Expand Down

0 comments on commit f52c00e

Please sign in to comment.