UNPKG

2.86 kBPlain TextView Raw
1---
2extends: "airbnb"
3plugins: ["react-hooks"]
4parser: "babel-eslint"
5globals:
6 page: true
7 browser: true
8 context: true
9 jestPuppeteer: true
10 BASE_URL: true
11rules:
12 camelcase: off # require camel case names
13 prefer-template: off
14 object-shorthand: off
15 quotes: off # ', ", ` no one cares
16 max-len: off # be sensible
17 no-mixed-operators: off # allow 1 + 1 * 3
18 no-confusing-arrow: off # allow (a) => a ? 1 : 2;
19 no-useless-constructor: off
20 no-nested-ternary: off
21 object-curly-spacing: off # allow { a: 1 } and {a: 1}
22 block-spacing: off # same as above for function blocks on a single line
23 dot-notation: off # allows someObject["a"] as well as someObject.a
24 comma-dangle: ["error", "never"]
25 padded-blocks: off
26 no-plusplus: off # we are old enought to use i++
27 arrow-body-style: off
28 arrow-parens: ["error", "always"] # use brackets always, (a) => body // () => body // (a, b) => body
29 no-case-declarations: off # we don't surround case blocks with { } in our switch statements as we use fallthroughs deliberately
30 one-var: off
31 one-var-declaration-per-line: off
32 no-console: [1, { "allow": ["warn", "error"] }]
33 space-infix-ops: off
34 no-param-reassign: [1, { "props": false }]
35 no-underscore-dangle: off
36 no-unused-expressions: ['error', {"allowTernary": true }]
37 no-restricted-syntax: ['error', 'ForInStatement', 'WithStatement'] # allow ForOfStatement & LabeledStatement
38 class-methods-use-this: off
39 react/jsx-tag-spacing: ["error", { "closingSlash": "never", "beforeSelfClosing": "allow", "afterOpening": "never" }]
40 react/forbid-prop-types: off
41 react/jsx-filename-extension: [1, { "extensions": [".js", ".jsx"] }]
42 react/jsx-first-prop-new-line: off
43 react/no-did-mount-set-state: off
44 react/no-did-update-set-state: off
45 react/prop-types: off # possibly reinstate
46 react/sort-comp: off # possibly reinstate
47 jsx-a11y/no-static-element-interactions: off
48 import/prefer-default-export: off
49 no-multi-spaces: ["error", { ignoreEOLComments: true }]
50 no-labels: off
51 no-unused-labels: off
52 no-continue: off
53 no-unneeded-ternary: ["error", { "defaultAssignment": true }]
54 quote-props: ["error", "as-needed"]
55 prefer-const: ["error", {"destructuring": "all"}]
56 indent: ["error", 2, {"MemberExpression": "off", "SwitchCase": 1}]
57 react-hooks/rules-of-hooks: "error"
58 react-hooks/exhaustive-deps: "warn"
59 object-curly-newline: off
60 operator-linebreak: ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }]
61 react/destructuring-assignment: off
62 prefer-destructuring: off
63 implicit-arrow-linebreak: off
64 jsx-quotes: off
65 no-use-before-define: ["error", { "functions": false }]
66parserOptions:
67 ecmaVersion: 6
68 sourceType: module
69 ecmaFeatures:
70 modules: true
71env:
72 es6: true
73 browser: true
74 jest: true
75# https://gist.github.com/odedw/cf14a55aa154adbc3bf7#file-eslintrc-yaml-L4