-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
81 lines (81 loc) · 2.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
module.exports = {
env: {
browser: true,
es2021: true,
mocha: true,
node: true,
},
// plugins: [ '@typescript-eslint' ],
extends: [
'react-app',
'react-app/jest',
'eslint:recommended',
'plugin:node/recommended',
],
settings: {
node: {
tryExtensions: [ '.js', '.json', '.node', '.ts', '.tsx', '.d.ts' ],
},
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
ecmaFeatures: {
jsx: true,
},
},
rules: {
'node/no-unpublished-import': 'off',
'indent': 'off',
semi: [ 'error', 'always' ],
'node/no-unsupported-features/es-syntax': [ 'error', { ignores: [ 'modules' ] } ],
quotes: [ 'error', 'single' ],
'object-curly-spacing': [ 'error', 'always' ],
'array-bracket-spacing': [ 'error', 'always' ],
'jsx-quotes': [ 'error', 'prefer-double' ],
'react/jsx-key': 'error',
'react/jsx-curly-brace-presence': [ 'error', {
props: 'never',
children: 'never',
} ],
'react/jsx-curly-spacing': [ 'error', {
when: 'always',
children: true,
spacing: {
objectLiterals: 'never',
},
} ],
'react/jsx-equals-spacing': [ 'error', 'never' ],
'react/jsx-fragments': [ 'error', 'syntax' ],
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-target-blank': 'off',
'react/jsx-no-useless-fragment': 'error',
'react/jsx-tag-spacing': [ 'error', {
afterOpening: 'never',
beforeSelfClosing: 'never',
closingSlash: 'never',
} ],
'react/jsx-wrap-multilines': [ 'error', {
declaration: 'parens-new-line',
assignment: 'parens-new-line',
'return': 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'parens-new-line',
} ],
'@typescript-eslint/indent': [ 'error', 4, {
SwitchCase: 1,
} ],
'space-before-function-paren': [ 'error', 'never' ],
'space-before-blocks': [ 'error', 'always' ],
'space-in-parens': [ 'error', 'never' ],
'space-infix-ops': 'error',
'space-unary-ops': 'off',
'template-curly-spacing': [ 'error', 'always' ],
'arrow-spacing': [ 'error', { before: true, after: true } ],
'comma-dangle': [ 'error', 'always-multiline' ],
'comma-spacing': [ 'error' ],
'comma-style': [ 'error', 'last' ],
},
};