-
Notifications
You must be signed in to change notification settings - Fork 101
/
.eslintrc.js
90 lines (90 loc) · 2.89 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
82
83
84
85
86
87
88
89
90
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
settings: {
react: {
version: '14.18'
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
node: {
extensions: ['.ts', '.tsx']
},
alias: {
map: [
['@backend/db', './backend/packages/db'],
['@backend/graphql', './backend/packages/graphql'],
['@backend/utils', './backend/packages/utils'],
['@backend/config', './backend/config/index.ts'],
['@web/assets', './web/src/assets'],
['@web/config', './web/src/config'],
['@web/constants', './web/src/constants'],
['@web/global', './web/src/global'],
['@web/layout', './web/src/layout'],
['@web/graphql', './web/src/graphql'],
['@web/pages', './web/src/pages'],
['@web/theme', './web/src/theme'],
['@web/utils', './web/src/utils']
],
extensions: ['.ts', '.tsx']
}
}
},
env: {
es6: true,
browser: true,
node: true
},
plugins: ['react', '@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript'
],
rules: {
// JS/TS RULES
quotes: ['error', 'single'],
camelcase: 'error',
'prefer-const': 'error',
'no-var': 'error',
'no-dupe-else-if': 'off',
'no-setter-return': 'off',
'import/no-unresolved': 'off',
'import/newline-after-import': ['error', { count: 1 }],
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 0, maxEOF: 1 }],
'no-trailing-spaces': 'error',
'@typescript-eslint/type-annotation-spacing': ['error'],
'object-curly-spacing': ['error', 'always'],
'key-spacing': ['error', { beforeColon: false }],
'object-shorthand': ['error', 'always'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
// JSX RULES
'jsx-quotes': ['error', 'prefer-single'],
'react/jsx-boolean-value': 'error',
'react/jsx-closing-bracket-location': 'error',
'react/jsx-equals-spacing': 'error',
'react/jsx-indent-props': ['error', 2],
'react/jsx-indent': ['error', 2],
'react/jsx-max-props-per-line': ['error', { maximum: 4 }],
'react/jsx-no-bind': 'error',
'react/jsx-no-literals': 'off',
'react/jsx-tag-spacing': ['error', { beforeSelfClosing: 'always' }]
}
};