This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
.eslintrc.js
156 lines (149 loc) · 5.04 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
const schemaJson = require('./app/graph/schema.json');
const ERROR = 'error';
const WARN = 'warn';
const OFF = 'off';
module.exports = {
parser: 'babel-eslint',
extends: [
'eslint:recommended',
'plugin:import/react',
'plugin:import/recommended',
'plugin:react/recommended',
'plugin:flowtype/recommended'
],
globals: {
jest: true,
require: true,
Features: true,
process: true,
Stripe: true
},
env: {
es6: true,
browser: true
},
plugins: [
'import',
'react',
'flowtype',
'relay',
'graphql'
],
settings: {
react: {
version: "16.6",
flowVersion: "0.84"
}
},
rules: {
'array-bracket-spacing': [ ERROR, 'never' ],
'arrow-parens': WARN,
'arrow-spacing': WARN,
'brace-style': [ ERROR, '1tbs', { allowSingleLine: true } ],
'comma-dangle': [ ERROR, 'never' ],
'comma-spacing': ERROR,
'comma-style': [ ERROR, 'last' ],
'curly': [ ERROR, 'all' ],
'eqeqeq': [ ERROR, 'smart' ],
'id-length': ERROR,
'indent': [ ERROR, 2, { SwitchCase: 1, MemberExpression: 1, FunctionDeclaration: { parameters: 'first' }, FunctionExpression: { parameters: 'first' } } ],
'jsx-quotes': ERROR,
'key-spacing': ERROR,
'keyword-spacing': ERROR,
'linebreak-style': ERROR,
'no-const-assign': ERROR,
'no-duplicate-imports': ERROR,
'no-else-return': WARN,
'no-eval': ERROR,
'no-implied-eval': ERROR,
'no-multi-spaces': ERROR,
'no-new-require': ERROR,
'no-trailing-spaces': ERROR,
'no-unsafe-negation': ERROR,
'no-unused-vars': [ ERROR, { varsIgnorePattern: '^_' } ],
'no-useless-rename': WARN,
'no-var': WARN,
'object-curly-spacing': [ ERROR, 'always' ],
'one-var': [ ERROR, { initialized: 'never' } ],
'one-var-declaration-per-line': ERROR,
'prefer-const': WARN,
'radix': WARN,
'semi': ERROR,
'semi-spacing': ERROR,
'space-before-function-paren': [ ERROR, 'never' ],
'space-in-parens': [ ERROR, 'never' ],
'space-infix-ops': ERROR,
'space-unary-ops': ERROR,
'strict': ERROR,
'unicode-bom': ERROR,
'flowtype/delimiter-dangle': ERROR,
'flowtype/no-dupe-keys': ERROR,
'flowtype/no-primitive-constructor-types': ERROR,
'flowtype/object-type-delimiter': ERROR,
'flowtype/require-valid-file-annotation': ERROR,
'flowtype/semi': ERROR,
'import/extensions': [ERROR, "never", {"css": "always", "png": "always", "svg": "always"}],
'import/unambiguous': OFF,
'import/no-unresolved': OFF, // Handled by Flow.
'react/display-name': [ ERROR, { ignoreTranspilerName: false } ],
'react/forbid-prop-types': OFF,
'react/jsx-boolean-value': [ ERROR, 'always' ],
'react/jsx-closing-bracket-location': ERROR,
'react/jsx-curly-spacing': ERROR,
'react/jsx-equals-spacing': [ ERROR, 'never' ],
'react/jsx-first-prop-new-line': [ ERROR, 'multiline' ],
'react/jsx-handler-names': ERROR,
'react/jsx-indent': [ ERROR, 2 ],
'react/jsx-indent-props': [ ERROR, 2 ],
'react/jsx-key': ERROR,
'react/jsx-max-props-per-line': [ ERROR, { when: 'multiline' } ],
'react/jsx-no-bind': [ WARN, { ignoreRefs: true } ],
'react/jsx-no-comment-textnodes': ERROR,
'react/jsx-no-duplicate-props': ERROR,
'react/jsx-no-literals': OFF,
'react/jsx-no-target-blank': ERROR,
'react/jsx-no-undef': ERROR,
'react/jsx-pascal-case': ERROR,
'react/jsx-sort-prop-types': OFF,
'react/jsx-sort-props': OFF,
'react/jsx-uses-react': ERROR,
'react/jsx-uses-vars': ERROR,
'react/jsx-wrap-multilines': ERROR,
'react/no-array-index-key': WARN,
'react/no-danger': OFF,
'react/no-danger-with-children': ERROR,
'react/no-deprecated': ERROR,
'react/no-did-mount-set-state': ERROR,
'react/no-did-update-set-state': ERROR,
'react/no-direct-mutation-state': ERROR,
'react/no-is-mounted': ERROR,
'react/no-multi-comp': [ ERROR, { ignoreStateless: true } ],
'react/no-set-state': OFF,
'react/no-string-refs': ERROR,
'react/no-unescaped-entities': ERROR,
'react/no-unknown-property': ERROR,
'react/no-unsafe': WARN,
'react/no-unused-prop-types': ERROR,
'react/prefer-es6-class': ERROR,
'react/prefer-stateless-function': OFF,
'react/prop-types': ERROR,
'react/react-in-jsx-scope': ERROR,
'react/require-optimization': ERROR,
'react/require-render-return': ERROR,
'react/self-closing-comp': WARN,
'react/sort-comp': OFF,
'react/style-prop-object': WARN,
'react/jsx-tag-spacing': ERROR,
'react/void-dom-elements-no-children': ERROR,
'relay/graphql-syntax': ERROR,
'relay/compat-uses-vars': WARN,
'relay/graphql-naming': ERROR,
'relay/generated-flow-types': WARN,
'relay/no-future-added-value': WARN,
'relay/unused-fields': WARN,
'graphql/named-operations': [ WARN, { env: 'relay', schemaJson } ],
'graphql/no-deprecated-fields': [ ERROR, { env: 'relay', schemaJson } ],
// Disabled for now — it’s just a bit too noisy.
// 'graphql/template-strings': [ WARN, { env: 'relay', validators: 'all', schemaJson } ]
}
};