/
.eslintrc.js
60 lines (59 loc) · 2.07 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
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:react/recommended', 'prettier'],
parser: '@typescript-eslint/parser',
plugins: ['react-hooks', 'no-only-tests', 'prettier'],
settings: {
react: {
version: 'detect',
},
},
rules: {
'no-shadow': 'error',
'sort-imports': 'error',
'no-only-tests/no-only-tests': 'error',
'no-console': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/prop-types': 'off',
'prettier/prettier': 'error',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
parserOptions: {
project: './tsconfig.json',
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
rules: {
'no-shadow': 'off',
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
},
],
// note you must disable the base rule as it can report incorrect errors
'init-declarations': 'off',
'@typescript-eslint/init-declarations': 'off', // ['error', 'always'],
},
},
],
};