Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit 75f628f

Browse files
author
Robert S
committed
update eslint rules
1 parent 57cbd37 commit 75f628f

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

‎.eslintrc.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
module.exports = {
55
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
6+
plugins: [
7+
'react-hooks', // Uses eslint-plugin-react-hooks
8+
],
69
extends: [
710
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
811
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
@@ -26,7 +29,9 @@ module.exports = {
2629
'@typescript-eslint/no-explicit-any': 0,
2730
'@typescript-eslint/no-inferrable-types': 0,
2831
'@typescript-eslint/no-non-null-assertion': 0,
29-
'@typescript-eslint/explicit-function-return-type': 0,
32+
'@typescript-eslint/no-use-before-define': 0,
33+
'react-hooks/rules-of-hooks': 2,
34+
'react-hooks/exhaustive-deps': 1,
3035
},
3136
settings: {
3237
react: {

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"eslint-config-prettier": "6.7.0",
8181
"eslint-plugin-prettier": "3.1.1",
8282
"eslint-plugin-react": "7.17.0",
83+
"eslint-plugin-react-hooks": "2.3.0",
8384
"generate-template-files": "2.2.0",
8485
"gh-pages": "2.1.1",
8586
"husky": "3.1.0",

‎yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -4735,6 +4735,11 @@ eslint-plugin-prettier@3.1.1:
47354735
dependencies:
47364736
prettier-linter-helpers "^1.0.0"
47374737

4738+
eslint-plugin-react-hooks@2.3.0:
4739+
version "2.3.0"
4740+
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.3.0.tgz#53e073961f1f5ccf8dd19558036c1fac8c29d99a"
4741+
integrity sha512-gLKCa52G4ee7uXzdLiorca7JIQZPPXRAQDXV83J4bUEeUuc5pIEyZYAZ45Xnxe5IuupxEqHS+hUhSLIimK1EMw==
4742+
47384743
eslint-plugin-react-hooks@^1.6.1:
47394744
version "1.7.0"
47404745
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04"

0 commit comments

Comments
 (0)