Skip to content

Commit

Permalink
feat(eslint-config): add react rules
Browse files Browse the repository at this point in the history
* react/jsx-fragments
* react/jsx-no-useless-fragment
* react/hook-use-state
* react/jsx-handler-names
* react/no-unstable-nested-components
  • Loading branch information
andrepolischuk committed Aug 13, 2024
1 parent 8d7fb50 commit 977b7ba
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/eslint-config/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,31 @@ module.exports = {
rules: {
'react/prop-types': 'off',
'react/jsx-pascal-case': 'error',
'react/jsx-fragments': 'error',
'react/jsx-no-useless-fragment': 'error',
'react/no-multi-comp': 'error',
'react/hook-use-state': 'error',
'react/jsx-handler-names': [
'error',
{
eventHandlerPrefix: 'handle',
eventHandlerPropPrefix: 'on',
checkLocalVariables: true,
checkInlineFunction: true
}
],
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks: '(useDeferCallback)'
}
],
'react/no-unstable-nested-components': [
'error',
{
allowAsProps: true
}
],
'jsx-a11y/no-autofocus': [
'error',
{
Expand Down

0 comments on commit 977b7ba

Please sign in to comment.