Skip to content

Commit 2788a0e

Browse files
author
devgioele
committed
update eslint config to be more comprehensive
1 parent 7511dc1 commit 2788a0e

2 files changed

Lines changed: 52 additions & 32 deletions

File tree

.eslintrc.json

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,54 @@
11
{
2-
"parser": "@typescript-eslint/parser",
3-
"env": {
4-
"browser": true,
5-
"node": true
6-
},
7-
"plugins": [
8-
"prettier",
9-
"@typescript-eslint",
10-
"jest",
11-
"import"
2+
"parser": "@typescript-eslint/parser",
3+
"env": {
4+
"browser": true,
5+
"node": true
6+
},
7+
"plugins": ["@typescript-eslint", "react", "react-hooks", "jest"],
8+
"extends": [
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:import/recommended",
11+
"plugin:import/typescript",
12+
"plugin:jest/recommended",
13+
"plugin:prettier/recommended"
14+
],
15+
"parserOptions": {
16+
"sourceType": "module",
17+
"ecmaVersion": 2018
18+
},
19+
"rules": {
20+
"react-hooks/rules-of-hooks": "error",
21+
"react-hooks/exhaustive-deps": "error",
22+
"@typescript-eslint/no-unused-vars": [
23+
"error",
24+
{
25+
"ignoreRestSiblings": true,
26+
"varsIgnorePattern": "^[iI]gnored",
27+
"argsIgnorePattern": "^_",
28+
"caughtErrorsIgnorePattern": "^ignore"
29+
}
1230
],
13-
"extends": [
14-
"prettier",
15-
"plugin:prettier/recommended",
16-
"plugin:@typescript-eslint/recommended",
17-
"plugin:import/typescript",
18-
"plugin:jest/recommended"
31+
"@typescript-eslint/member-delimiter-style": "off",
32+
"@typescript-eslint/explicit-function-return-type": "off",
33+
"@next/next/no-img-element": "off",
34+
"import/order": [
35+
"error",
36+
{
37+
"groups": [
38+
"builtin",
39+
"external",
40+
"unknown",
41+
"parent",
42+
"sibling",
43+
"index"
44+
]
45+
}
1946
],
20-
"parserOptions": {
21-
"sourceType": "module",
22-
"ecmaVersion": 2018
23-
},
24-
"rules": {
25-
"import/namespace": "off",
26-
"import/order": [
27-
"error"
28-
],
29-
"no-unused-vars": "off",
30-
"@typescript-eslint/no-unused-vars": "error",
31-
"@typescript-eslint/member-delimiter-style": "off",
32-
"@typescript-eslint/no-var-requires": "off",
33-
"@typescript-eslint/no-extra-semi": "off",
34-
"@typescript-eslint/no-explicit-any": "off"
35-
}
47+
"no-console": [
48+
"error",
49+
{
50+
"allow": ["warn", "error", "assert"]
51+
}
52+
]
53+
}
3654
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
"eslint-plugin-import": "^2.26.0",
5959
"eslint-plugin-jest": "^26.5.3",
6060
"eslint-plugin-prettier": "^4.1.0",
61+
"eslint-plugin-react": "^7.32.2",
62+
"eslint-plugin-react-hooks": "^4.6.0",
6163
"jest": "^28.1.1",
6264
"jest-environment-jsdom": "^28.1.1",
6365
"next": "^13.1.3",

0 commit comments

Comments
 (0)