chore: add react-hook eslint plugin (#22368)

This commit is contained in:
骗你是小猫咪 2020-03-19 11:12:58 +08:00 committed by GitHub
parent 0c32583ffc
commit f259be818c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,7 @@ const eslintrc = {
},
},
parser: '@typescript-eslint/parser',
plugins: ['markdown', 'react', 'babel', 'jest', '@typescript-eslint'],
plugins: ['markdown', 'react', 'babel', 'jest', '@typescript-eslint', 'react-hooks'],
// https://github.com/typescript-eslint/typescript-eslint/issues/46#issuecomment-470486034
overrides: [
{
@ -90,6 +90,7 @@ const eslintrc = {
'react/static-property-placement': 0,
'jest/no-test-callback': 0,
'jest/expect-expect': 0,
'react-hooks/rules-of-hooks': 2, // Checks rules of Hooks
},
globals: {
gtag: true,

View File

@ -190,6 +190,7 @@
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-react": "^7.14.2",
"eslint-plugin-react-hooks": "^2.5.0",
"eslint-tinker": "^0.5.0",
"fetch-jsonp": "^1.1.3",
"full-icu": "^1.3.0",