mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-23 22:17:00 +02:00
chore: Enable ESLint rules of hooks + fix new lint errors (#5714)
This commit is contained in:
parent
3db4fcaec7
commit
098f210890
16 changed files with 110 additions and 48 deletions
|
@ -28,6 +28,7 @@ module.exports = {
|
|||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:react-hooks/recommended',
|
||||
'airbnb',
|
||||
'prettier',
|
||||
'prettier/react',
|
||||
|
@ -41,6 +42,8 @@ module.exports = {
|
|||
},
|
||||
plugins: ['react-hooks', 'header'],
|
||||
rules: {
|
||||
'react-hooks/rules-of-hooks': ERROR,
|
||||
'react-hooks/exhaustive-deps': ERROR,
|
||||
'class-methods-use-this': OFF, // It's a way of allowing private variables.
|
||||
'func-names': OFF,
|
||||
// Ignore certain webpack alias because it can't be resolved
|
||||
|
@ -77,7 +80,6 @@ module.exports = {
|
|||
'react/destructuring-assignment': OFF, // Too many lines.
|
||||
'react/prefer-stateless-function': WARNING,
|
||||
'react/jsx-props-no-spreading': OFF,
|
||||
'react-hooks/rules-of-hooks': ERROR,
|
||||
'react/require-default-props': [ERROR, {ignoreFunctionalComponents: true}],
|
||||
'@typescript-eslint/no-inferrable-types': OFF,
|
||||
'import/first': OFF,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue