Skip to content

Commit 269603c

Browse files
committed
chore: standardise on .eslintrc.js
1 parent 87a5f28 commit 269603c

2 files changed

Lines changed: 296 additions & 372 deletions

File tree

packages/graphiql/.eslintrc.js

Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
plugins: ['babel', 'react'],
4+
settings: {
5+
react: {
6+
version: '0.15.0',
7+
},
8+
},
9+
env: {
10+
browser: true,
11+
es6: true,
12+
node: true,
13+
jest: true,
14+
},
15+
extends: ['prettier'],
16+
parserOptions: {
17+
arrowFunctions: true,
18+
binaryLiterals: true,
19+
blockBindings: true,
20+
classes: true,
21+
defaultParams: true,
22+
destructuring: true,
23+
experimentalObjectRestSpread: true,
24+
forOf: true,
25+
generators: true,
26+
globalReturn: true,
27+
jsx: true,
28+
modules: true,
29+
objectLiteralComputedProperties: true,
30+
objectLiteralDuplicateProperties: true,
31+
objectLiteralShorthandMethods: true,
32+
objectLiteralShorthandProperties: true,
33+
octalLiterals: true,
34+
regexUFlag: true,
35+
regexYFlag: true,
36+
restParams: true,
37+
spread: true,
38+
superInFunctions: true,
39+
templateStrings: true,
40+
unicodeCodePointEscapes: true,
41+
},
42+
rules: {
43+
'react/jsx-boolean-value': 'error',
44+
'react/jsx-handler-names': 'error',
45+
'react/jsx-key': 'error',
46+
'react/jsx-no-duplicate-props': 'error',
47+
'react/jsx-no-literals': 'error',
48+
'react/jsx-no-undef': 'error',
49+
'react/jsx-pascal-case': 'error',
50+
'react/jsx-uses-react': 'error',
51+
'react/jsx-uses-vars': 'error',
52+
'react/no-deprecated': 'error',
53+
'react/no-did-mount-set-state': 'error',
54+
'react/no-did-update-set-state': 'error',
55+
'react/no-direct-mutation-state': 'error',
56+
'react/no-string-refs': 'error',
57+
'react/no-unknown-property': 'error',
58+
'react/prop-types': [
59+
'error',
60+
{
61+
ignore: ['children'],
62+
},
63+
],
64+
'react/prefer-es6-class': 'error',
65+
'react/prefer-stateless-function': 'error',
66+
'react/react-in-jsx-scope': 'error',
67+
'react/self-closing-comp': 'error',
68+
'react/sort-comp': [
69+
'error',
70+
{
71+
order: ['static-methods', 'lifecycle', 'render', 'everything-else'],
72+
},
73+
],
74+
'no-constant-condition': 'error',
75+
'no-control-regex': 'error',
76+
'no-debugger': 'warn',
77+
'no-dupe-args': 'error',
78+
'no-dupe-keys': 'error',
79+
'no-duplicate-case': 'error',
80+
'no-empty': 'error',
81+
'no-empty-character-class': 'error',
82+
'no-ex-assign': 'error',
83+
'no-extra-boolean-cast': 'error',
84+
'no-func-assign': 'error',
85+
'no-inner-declarations': ['error', 'functions'],
86+
'no-invalid-regexp': 'error',
87+
'no-irregular-whitespace': 'error',
88+
'no-obj-calls': 'error',
89+
'no-regex-spaces': 'error',
90+
'no-sparse-arrays': 'error',
91+
'no-unreachable': 'error',
92+
'no-unsafe-negation': 'error',
93+
'use-isnan': 'error',
94+
'valid-typeof': 'error',
95+
'block-scoped-var': 'off',
96+
complexity: 'off',
97+
'consistent-return': 'off',
98+
curly: ['error', 'all'],
99+
'default-case': 'off',
100+
'dot-notation': 'off',
101+
eqeqeq: ['error', 'smart'],
102+
'guard-for-in': 'error',
103+
'no-alert': 'error',
104+
'no-caller': 'error',
105+
'no-div-regex': 'error',
106+
'no-else-return': 'error',
107+
'no-eq-null': 'off',
108+
'no-eval': 'error',
109+
'no-extend-native': 'error',
110+
'no-extra-bind': 'error',
111+
'no-fallthrough': 'error',
112+
'no-global-assign': 'error',
113+
'no-implicit-coercion': 'error',
114+
'no-implied-eval': 'error',
115+
'no-invalid-this': 'off',
116+
'no-iterator': 'error',
117+
'no-labels': [
118+
'error',
119+
{
120+
allowLoop: true,
121+
},
122+
],
123+
'no-lone-blocks': 'error',
124+
'no-loop-func': 'off',
125+
'no-multi-str': 'error',
126+
'no-new': 'error',
127+
'no-new-func': 'off',
128+
'no-new-wrappers': 'error',
129+
'no-octal': 'error',
130+
'no-octal-escape': 'error',
131+
'no-param-reassign': 'error',
132+
'no-proto': 'error',
133+
'no-redeclare': 'error',
134+
'no-return-assign': 'error',
135+
'no-script-url': 'error',
136+
'no-self-compare': 'off',
137+
'no-sequences': 'error',
138+
'no-throw-literal': 'error',
139+
'no-unused-expressions': 'error',
140+
'no-useless-call': 'error',
141+
'no-useless-escape': 'error',
142+
'no-useless-return': 'error',
143+
'no-void': 'error',
144+
'no-warning-comments': 'off',
145+
'no-with': 'error',
146+
radix: 'error',
147+
'vars-on-top': 'off',
148+
yoda: [
149+
'error',
150+
'never',
151+
{
152+
exceptRange: true,
153+
},
154+
],
155+
strict: 'off',
156+
'init-declarations': 'off',
157+
'no-delete-var': 'error',
158+
'no-label-var': 'error',
159+
'no-shadow': 'error',
160+
'no-shadow-restricted-names': 'error',
161+
'no-undef': 'error',
162+
'no-undef-init': 'error',
163+
'no-undefined': 'off',
164+
'no-unused-vars': [
165+
'error',
166+
{
167+
vars: 'all',
168+
args: 'after-used',
169+
argsIgnorePattern: '^_',
170+
},
171+
],
172+
'no-use-before-define': 'off',
173+
'callback-return': 'error',
174+
'handle-callback-err': ['error', 'error'],
175+
'no-mixed-requires': ['error', true],
176+
'no-new-require': 'error',
177+
'no-path-concat': 'error',
178+
'no-process-env': 'off',
179+
'no-process-exit': 'off',
180+
'no-restricted-modules': 'off',
181+
'no-sync': 'error',
182+
camelcase: [
183+
'error',
184+
{
185+
properties: 'always',
186+
},
187+
],
188+
'consistent-this': 'off',
189+
'func-names': 'off',
190+
'func-style': 'off',
191+
'id-length': 'off',
192+
'id-match': ['error', '^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$'],
193+
'lines-around-comment': 'off',
194+
'max-depth': 'off',
195+
'max-nested-callbacks': 'off',
196+
'max-params': 'off',
197+
'max-statements': 'off',
198+
'new-cap': 'off',
199+
'no-array-constructor': 'error',
200+
'no-bitwise': 'off',
201+
'no-continue': 'off',
202+
'no-inline-comments': 'off',
203+
'no-lonely-if': 'error',
204+
'no-nested-ternary': 'off',
205+
'no-new-object': 'error',
206+
'no-plusplus': 'off',
207+
'no-tabs': 'error',
208+
'no-ternary': 'off',
209+
'no-underscore-dangle': 'off',
210+
'no-unneeded-ternary': 'error',
211+
'one-var': ['error', 'never'],
212+
'operator-assignment': ['error', 'always'],
213+
'padding-line-between-statements': 'off',
214+
quotes: [
215+
'error',
216+
'single',
217+
{
218+
avoidEscape: true,
219+
allowTemplateLiterals: true,
220+
},
221+
],
222+
'sort-vars': 'off',
223+
'spaced-comment': ['error', 'always'],
224+
'no-class-assign': 'error',
225+
'no-const-assign': 'error',
226+
'no-this-before-super': 'error',
227+
'no-var': 'error',
228+
'object-shorthand': ['error', 'always'],
229+
'prefer-arrow-callback': 'error',
230+
'prefer-const': 'error',
231+
'prefer-spread': 'off',
232+
'require-yield': 'error',
233+
'array-bracket-newline': 'off',
234+
'array-bracket-spacing': 'off',
235+
'array-element-newline': 'off',
236+
'arrow-parens': 'off',
237+
'arrow-spacing': 'off',
238+
'block-spacing': 'off',
239+
'brace-style': 'off',
240+
'comma-dangle': 'off',
241+
'comma-spacing': 'off',
242+
'comma-style': 'off',
243+
'computed-property-spacing': 'off',
244+
'dot-location': 'off',
245+
'eol-last': 'off',
246+
'func-call-spacing': 'off',
247+
'function-paren-newline': 'off',
248+
'generator-star-spacing': 'off',
249+
'implicit-arrow-linebreak': 'off',
250+
indent: 'off',
251+
'jsx-quotes': 'off',
252+
'key-spacing': 'off',
253+
'keyword-spacing': 'off',
254+
'linebreak-style': 'error',
255+
'max-len': 'off',
256+
'multiline-ternary': 'off',
257+
'newline-per-chained-call': 'off',
258+
'new-parens': 'off',
259+
'no-confusing-arrow': 'off',
260+
'no-extra-parens': 'off',
261+
'no-extra-semi': 'off',
262+
'no-floating-decimal': 'off',
263+
'no-mixed-operators': 'off',
264+
'no-mixed-spaces-and-tabs': 'off',
265+
'no-multi-spaces': 'off',
266+
'no-multiple-empty-lines': 'off',
267+
'no-spaced-func': 'off',
268+
'no-trailing-spaces': 'off',
269+
'no-unexpected-multiline': 'error',
270+
'no-whitespace-before-property': 'off',
271+
'nonblock-statement-body-position': 'off',
272+
'object-curly-newline': 'off',
273+
'object-curly-spacing': [0, 'always'],
274+
'object-property-newline': 'off',
275+
'one-var-declaration-per-line': 'off',
276+
'operator-linebreak': 'off',
277+
'padded-blocks': 'off',
278+
'quote-props': 'off',
279+
'rest-spread-spacing': 'off',
280+
semi: 'off',
281+
'semi-spacing': 'off',
282+
'semi-style': 'off',
283+
'space-before-blocks': 'off',
284+
'space-before-function-paren': 'off',
285+
'space-in-parens': 'off',
286+
'space-infix-ops': 'off',
287+
'space-unary-ops': 'off',
288+
'switch-colon-spacing': 'off',
289+
'template-curly-spacing': 'off',
290+
'template-tag-spacing': 'off',
291+
'unicode-bom': 'off',
292+
'wrap-iife': 'off',
293+
'wrap-regex': 'off',
294+
'yield-star-spacing': 'off',
295+
},
296+
};

0 commit comments

Comments
 (0)