-
Notifications
You must be signed in to change notification settings - Fork 73
/
.eslintrc.js
66 lines (66 loc) · 2.43 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
module.exports = {
extends: [
'react-app',
// enable typescript support
'plugin:@typescript-eslint/recommended',
// now disable all of the rules that are in conflict with prettier
'prettier'
// note that we don't add the prettier rules, they add noise to the IDE
// and the code is all being formatted on commit anyway.
],
rules: {
'arrow-body-style': 'warn',
'dot-notation': 'warn',
'no-var': 'error',
'no-debugger': 'error',
'no-duplicate-imports': 'error',
'object-shorthand': 'warn',
'prefer-arrow-callback': 'warn',
'prefer-const': 'warn',
// In principle I like this rule, but I also want to use names such as _Foo
// for those internal classes that get passed on to redux connect. After
// much refactoring I realized that I just prefer _Foo to FooImpl. Since
// this rule is being well followed without an eslint rule, I'm switching
// this one off.
'@typescript-eslint/class-name-casing': 'off',
// too many of the graphql generate types break this rule, and they do so
// in a way that makes enough sense that I don't want to deal with it
'@typescript-eslint/camelcase': 'off'
},
overrides: [
{
files: '*.{js,jsx}',
rules: {
// this should just be fixed
'@typescript-eslint/no-unused-vars': 'off',
// opinion: this is reasonable to disable
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
{
files: '*.{ts,tsx}',
rules: {
// disabled because it conflicts with jsx-a11y/alt-text
'jsx-a11y/img-redundant-alt': 'off',
// changed to match the default tsconfig
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/prefer-interface': 'off',
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true
}
],
'@typescript-eslint/no-angle-bracket-type-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
}
}
]
}