-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
107 lines (107 loc) · 3.21 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
module.exports = {
'env': {
'browser': true,
'es6': true,
},
parser: '@typescript-eslint/parser',
'extends': [
'eslint:recommended',
// "plugin:react/recommended", // TODO: enable once
],
'parserOptions': {
'ecmaFeatures': {
'experimentalObjectRestSpread': true,
'jsx': true,
},
'sourceType': 'module',
},
'plugins': [
'react',
'@typescript-eslint',
],
'globals': {
'__dirname': false,
'process': false,
'require': false,
'module': false,
},
'settings': {
'react': {
'pragma': 'React', // Pragma to use, default to "React"
'version': '16.0', // React version, default to the latest React stable release
},
},
'rules': {
'comma-dangle': ['error', 'always-multiline'],
'no-console': 'error',
'no-debugger': 'error',
'no-unused-vars': [2, { 'varsIgnorePattern': '_+', 'argsIgnorePattern': '^_' }],
'consistent-return': [0, { 'treatUndefinedAsUnspecified': true }],
'object-curly-spacing': ['error', 'always'],
'quotes': ['error', 'double'],
'no-multiple-empty-lines': [2, { 'max': 2, 'maxEOF': 0, 'maxEOF': 0 }],
'no-multi-spaces': [2, {
'exceptions': {
'Identifier': true,
'ObjectExpression': true,
'ClassProperty': true,
'ImportDeclaration': true,
'VariableDeclarator': true,
'AssignmentExpression': true,
'ReturnStatement': true,
'BlockStatement': true,
'IfStatement': true,
'JSXAttribute': true,
'JSXIdentifier': true,
'JSXOpeningElement': true,
'JSXClosingElement': true,
},
}],
'linebreak-style': [
'error',
'unix',
],
'quotes': [
'error',
'single',
],
'semi': [0, 'always'],
'react/prefer-stateless-function': [2, {
'ignorePureComponents': true,
}],
'react/prop-types': 2,
'react/jsx-uses-vars': ['error'],
'react/jsx-uses-react': ['error'],
'indent': 'off',
'@typescript-eslint/indent': ['error', 4, { 'SwitchCase': 1 }],
'react/jsx-indent-props': [2, 4],
'key-spacing': [2, {
'singleLine': {
'beforeColon': false,
'afterColon': true,
},
'multiLine': {
'beforeColon': false,
'afterColon': true,
'mode': 'minimum',
},
}],
},
'overrides': [
{
'files': '*.ts',
'rules': {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [2, { 'varsIgnorePattern': '_+', 'argsIgnorePattern': '^_' }],
},
},
{
'files': '*.tsx',
'rules': {
'react/prop-types': 0,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
},
},
],
};