-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
80 lines (78 loc) · 2.24 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
module.exports = {
extends: [
'airbnb-base',
'airbnb-typescript',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
project: 'tsconfig.json',
tsconfigRootDir: './',
},
plugins: ['@typescript-eslint', 'prettier'],
env: {
node: true,
es6: true,
browser: true,
},
overrides: [
// TS files
{
files: ['*.ts'],
rules: {
'no-console': [
'error',
{
allow: ['error'],
},
],
'@typescript-eslint/no-magic-numbers': [
'error',
{
ignoreEnums: true,
ignoreNumericLiteralTypes: true,
},
],
'import/prefer-default-export': 'off',
'@typescript-eslint/indent': 'off',
'arrow-body-style': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/consistent-type-imports': ['error'],
'react/jsx-filename-extension': 'off',
'no-plusplus': [
2,
{
allowForLoopAfterthoughts: true,
},
],
},
},
// JS files
{
files: ['*.js'],
rules: {
'react/jsx-filename-extension': 'off',
'import/extensions': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
// Test files
{
files: ['*.test.ts', '*.spec.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
],
};