This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
80 lines (79 loc) · 2.42 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
const branch = require('child_process').execSync('git rev-parse --abbrev-ref HEAD').toString().trim()
const warnOrError = branch === 'master' ? 'error' : 'warn'
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
es6: true,
node: true
},
extends: ['eslint:recommended', 'plugin:react/recommended'],
parserOptions: {
ecmaVersion: 7,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true
},
sourceType: 'module'
},
plugins: ['react'],
rules: {
indent: [
warnOrError,
2,
{ SwitchCase: 1 }
],
'linebreak-style': [
warnOrError,
'unix'
],
semi: [
warnOrError,
'never'
],
'no-warning-comments': ['off'],
'comma-dangle': ['off'],
'brace-style': [warnOrError, '1tbs', { allowSingleLine: true }],
quotes: [warnOrError, 'single', { avoidEscape: true }],
'quote-props': [warnOrError, 'as-needed'],
'no-console': ['off'],
'no-unused-vars': [warnOrError],
'no-var': [warnOrError],
'no-empty': [warnOrError],
'no-multi-spaces': [warnOrError],
'no-trailing-spaces': [warnOrError],
'space-before-blocks': [warnOrError],
'padded-blocks': [warnOrError, 'never'],
'key-spacing': [warnOrError],
'arrow-spacing': [warnOrError],
'keyword-spacing': [warnOrError],
'space-infix-ops': [warnOrError, { int32Hint: false }],
'space-before-function-paren': [warnOrError, {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
'new-parens': [warnOrError],
'react/no-danger': [warnOrError],
'react/prop-types': [warnOrError],
'react/no-direct-mutation-state': [warnOrError],
'react/jsx-indent': [warnOrError, 2],
'react/jsx-curly-spacing': [warnOrError, 'never'],
'react/jsx-closing-bracket-location': [warnOrError, {
nonEmpty: 'after-props',
selfClosing: 'after-props'
}],
'react/jsx-space-before-closing': [warnOrError, 'always'],
'react/jsx-max-props-per-line': [warnOrError, { maximum: 1 }],
'react/jsx-indent-props': [warnOrError, 2],
'react/jsx-first-prop-new-line': [warnOrError, 'multiline'],
'object-curly-spacing': [warnOrError, 'always'],
'comma-spacing': [warnOrError, {
before: false,
after: true
}],
'array-bracket-spacing': [warnOrError, 'never'],
'computed-property-spacing': [warnOrError, 'never'],
'space-in-parens': [warnOrError, 'never']
}
}