-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
81 lines (74 loc) · 1.66 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const jest = {
files: ['src/**/*.test.{ts,tsx}'],
env: {
jest: true,
node: true,
browser: false,
},
}
const build = {
files: ['webpack.config.js', 'babel.config.js'],
env: {
node: true,
browser: false,
},
rules: {
'@typescript-eslint/no-var-requires': 0,
},
}
module.exports = {
env: {
es6: true,
browser: true,
},
parser: '@typescript-eslint/parser',
extends: [
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/warnings',
],
plugins: ['react-hooks'],
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
moduleDirectory: ['node_modules', 'src'],
},
},
},
rules: {
'no-console': 0,
'no-var': 2,
'no-void': 2,
'no-with': 2,
'object-shorthand': 1,
'prefer-arrow-callback': 2,
'prefer-const': 2,
'prefer-rest-params': 2,
'prefer-spread': 2,
'react-hooks/rules-of-hooks': 2,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/indent': [2, 2],
'@typescript-eslint/member-ordering': 2,
'@typescript-eslint/explicit-member-accessibility': 0,
'import/first': 2,
'import/newline-after-import': 2,
},
overrides: [jest, build],
}