-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
65 lines (65 loc) · 2.36 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
settings: {
react: {
version: '16.13'
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
}
},
env: {
browser: true,
node: true
},
plugins: ['react', '@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/typescript',
'plugin:react-hooks/recommended'
],
rules: {
// JS/TS RULES
quotes: ['error', 'single'],
camelcase: 'error',
'prefer-const': 'error',
'no-var': 'error',
'import/newline-after-import': ['error', { count: 1 }],
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/indent': ['error', 4],
'@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, mode: 'minimum' }],
'object-shorthand': ['error', 'always'],
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
'require-atomic-updates': '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', 4],
'react/jsx-indent': ['error', 4],
'react/jsx-max-props-per-line': ['error', { maximum: 4 }],
'react/jsx-no-bind': ['error', { allowArrowFunctions: true }],
'react/jsx-no-literals': 'off',
'react/jsx-tag-spacing': ['error', { beforeSelfClosing: 'always' }],
}
};