Add eslint rules for React hooks
These make components with simple state (only a few variables) easier to read and maintain. See https://reactjs.org/docs/hooks-intro.html for details. Hook are available since React 16.8, and we already depend on 16.10. We can't use hooks in our actual code, as our only `Application` component needs a constructor. But this enables the ESLint plugin to guide developers to the right path if they use hooks. Closes #239
This commit is contained in:
parent
31d628cffc
commit
024b1a2b16
2 changed files with 5 additions and 1 deletions
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["flowtype", "react"],
|
||||
"plugins": ["flowtype", "react", "react-hooks"],
|
||||
"rules": {
|
||||
"indent": ["error", 4,
|
||||
{
|
||||
|
|
@ -28,6 +28,9 @@
|
|||
"react/jsx-indent": ["error", 4],
|
||||
"semi": ["error", "always", { "omitLastInOneLineBlock": true }],
|
||||
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "error",
|
||||
|
||||
"camelcase": "off",
|
||||
"comma-dangle": "off",
|
||||
"curly": "off",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue