forked from sensu/web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.yml
101 lines (86 loc) · 2.66 KB
/
.eslintrc.yml
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
parser: "@typescript-eslint/parser"
plugins:
- jsx-a11y
- prettier
- react
- react-hooks
- import
- "@typescript-eslint"
- "@sensuapp"
settings:
import/resolver:
babel-module:
extends:
- eslint:recommended
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
- plugin:jsx-a11y/recommended
- plugin:import/errors
- plugin:import/warnings
- prettier
- prettier/react
env:
node: true
es6: true
globals:
IntlRelativeFormat: false
isNaN: false
rules:
react-hooks/rules-of-hooks: error
react-hooks/exhaustive-deps: error
react/no-deprecated: warn
# Disallow global RegExp instances to prevent unwanted side-effects
"@sensuapp/no-global-regex":
- error
- allowCallExpressions: true
allowEphemeral: true
# Require dependencies to be explicitly declared
import/no-extraneous-dependencies: error
# The ability of eslint-plugin-import to check that a named export exists is
# limited to checking the immediately referenced file. `export * from "..."`
# expressions are not unwrapped. We can instead rely on Typescript to
# assert the shapes of imported modules.
import/named: off
import/namespace: off
import/default: off
# Indent is owned by prettier
"@typescript-eslint/indent": off
react/jsx-indent: off
# Allow explicit use of `any`
"@typescript-eslint/no-explicit-any": off
# Don't require explicit return types. TypeScript's type inferrence has come
# a long way.
"@typescript-eslint/explicit-function-return-type": off
# Don't require unnecessary `public` accessor
"@typescript-eslint/explicit-member-accessibility": off
"@typescript-eslint/no-unused-vars":
- error
# Allow underscore-prefix unused vars
- varsIgnorePattern: "^_"
# allow using rest spread as an objecty omit utility
ignoreRestSiblings: true
# Some imported module interfaces / APIs require camelcase names
"@typescript-eslint/camelcase": off
# Single line conditionals are more difficult to set breakpoints on.
curly:
- error
- all
# This is good practice but hard to accomodate while using material-ui
jsx-a11y/mouse-events-have-key-events: warn
# We trust our own discression to use this responsibily
jsx-a11y/no-autofocus: off
overrides:
- files: "*.js"
rules:
react/prop-types: error
"@typescript-eslint/no-var-requires": off
- files: ["*.ts", "*.tsx"]
rules:
# Rely on TypeScript to check that imports resolve correctly
import/no-unresolved: off
# TypeScript may export an overloaded function more than once
import/export: off
- files: ["*.test.tsx", "*.test.js", "*.test.ts"]
env:
jest: true
node: true