-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
123 lines (123 loc) · 3.09 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
root: true
extends:
# Uses the recommended rules from @typescript-eslint/eslint-plugin
- plugin:@typescript-eslint/recommended
plugins:
- '@typescript-eslint'
parser: '@typescript-eslint/parser'
# see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/experimental-utils/src/ts-eslint/ParserOptions.ts
parserOptions:
tsconfigRootDir: .
# Allows for the parsing of modern ECMAScript features
ecmaVersion: 2020
# Allows for the use of imports
sourceType: module
extraFileExtensions:
- .cjs
globals:
__DEV__: true
ignorePatterns:
- packages/**/build/**/*
- node_modules/**/*
- coverage/**/*
- '*.spec*'
rules:
##############
# typescript #
##############
'@typescript-eslint/ban-ts-comment':
- error
- ts-expect-error: allow-with-description
ts-ignore: allow-with-description
ts-nocheck: allow-with-description
ts-check: false
minimumDescriptionLength: 3
'@typescript-eslint/no-shadow':
- error
- builtinGlobals: false
hoist: all
allow: []
ignoreTypeValueShadow: true
#
# warn, code style
#
'@typescript-eslint/no-empty-interface': warn
'@typescript-eslint/ban-types': warn
#
# off, code style
#
'@typescript-eslint/member-delimiter-style': off
'@typescript-eslint/indent': off
'@typescript-eslint/ban-ts-ignore': off
'@typescript-eslint/explicit-function-return-type': off
'@typescript-eslint/explicit-member-accessibility': off
'@typescript-eslint/no-empty-function': off
# fine with code review
'@typescript-eslint/no-explicit-any':
- off
- ignoreRestArgs: true
'@typescript-eslint/explicit-module-boundary-types': off
# using ES2015 module syntax for modules
'@typescript-eslint/prefer-namespace-keyword': off
#
# off, conflicts with or replaced by prettier
#
'@typescript-eslint/no-extra-semi': off
# code works and there's enough use cases of this
'@typescript-eslint/no-use-before-define': off
##########
# eslint #
##########
# using custom logger to replace console.log
no-console:
- error
- allow:
- time
- timeEnd
#
# warn, code style
#
operator-linebreak: warn
object-curly-newline: warn
no-restricted-syntax: warn
new-cap: warn
no-else-return: warn
no-empty: warn
no-unused-expressions:
- warn
- allowShortCircuit: true
allowTernary: true
default-case: warn
#
# off, conflicts with or replaced by prettier
#
no-extra-semi: off
no-confusing-arrow: off
max-len: off
indent: off
arrow-parens: off
implicit-arrow-linebreak: off
no-underscore-dangle: off
arrow-body-style: off
padded-blocks: off
spaced-comment: off
#
# off, TS conflict
#
no-unused-vars: off
#
# off, code style
#
# rule meant to help with types, we use ts for it
consistent-return: off
# we use some requires inline
global-require: off
# nothing wrong with var
no-var: off
# again, nothing wrong with var
prefer-const: off
# nothing wrong with continue
no-continue: off
# see @typescript-eslint/no-use-before-define in this file
no-use-before-define: off
camelcase: off