chore: extend linting to cover react hooks (#36725)

This commit is contained in:
Oliver Eyton-Williams
2019-08-30 17:40:23 +02:00
committed by mrugesh
parent 335600d91c
commit f50ac6e115
3 changed files with 11 additions and 2 deletions

View File

@ -1,13 +1,15 @@
{
"root": true,
"extends": ["@freecodecamp/eslint-config", "prettier", "prettier/react"],
"plugins": ["prettier"],
"plugins": ["prettier", "react-hooks"],
"rules": {
"max-len": [
"error",
{ "code": 80, "ignoreUrls": true, "ignoreTemplateLiterals": true }
],
"prettier/prettier": "error"
"prettier/prettier": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"settings": {
"react": {

6
package-lock.json generated
View File

@ -4640,6 +4640,12 @@
}
}
},
"eslint-plugin-react-hooks": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.0.1.tgz",
"integrity": "sha512-xir+3KHKo86AasxlCV8AHRtIZPHljqCRRUYgASkbatmt0fad4+5GgC7zkT7o/06hdKM6MIwp8giHVXqBPaarHQ==",
"dev": true
},
"eslint-rule-composer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",

View File

@ -60,6 +60,7 @@
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^2.0.1",
"faker": "^4.1.0",
"gray-matter": "^4.0.2",
"gulp": "^4.0.2",