-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yaml
108 lines (96 loc) · 2.32 KB
/
.eslintrc.yaml
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
# yaml-language-server: $schema=http://json.schemastore.org/eslintrc
env:
es2021: true
browser: true
node: true
jasmine: true
extends:
- 'eslint:recommended'
ignorePatterns:
- bazel-out/
- dist/
- external/
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 12
sourceType: module
plugins:
- '@typescript-eslint'
rules:
indent:
- error
- 4
- SwitchCase: 1
linebreak-style:
- error
- unix
quotes:
- error
- single
- allowTemplateLiterals: true
semi:
- error
- always
no-constant-condition:
- error
- checkLoops: false # `while (true) { /* ... */ }` is ok.
no-unused-vars:
- error
- argsIgnorePattern: "^_"
destructuredArrayIgnorePattern: "^_"
# Deliberately _not_ setting `varsIgnorePattern`, since that benefits from
# an explicit ignore comment instead of a load-bearing `_`.
# Enable TypeScript rules only for `*.[cm]?ts` files.
overrides:
- files:
- "**/*.ts"
- "**/*.d.ts"
- "**/*.mts"
- "**/*.d.mts"
- "**/*.cts"
- "**/*.d.cts"
- "**/*.tsx"
extends:
- 'plugin:@typescript-eslint/recommended'
rules:
# TypeScript already disallows duplicated class members and sometimes allows
# it (ex. method overrides).
no-dupe-class-members:
- off
# TypeScript already disallows undeclared variables.
no-undef:
- off
'@typescript-eslint/no-namespace':
- error
# Allow in `declare module` or `declare global` which is occasionally
# useful for declaration merging (ex. `JSX.IntrinsicElements`).
- allowDeclarations: true
'@typescript-eslint/no-explicit-any':
- off
'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: "^_"
destructuredArrayIgnorePattern: "^_"
# Deliberately _not_ setting `varsIgnorePattern`, since that benefits from
# an explicit ignore comment instead of a load-bearing `_`.
- files:
- "**/*_test.ts"
- "**/test.ts"
- "**/*_test.mts"
- "**/test.mts"
- "**/*_test.cts"
- "**/test.cts"
- "**/*_test.tsx"
- "**/test.tsx"
- "**/*_test_cases.ts"
- "**/test_cases.ts"
- "**/*_test_cases.mts"
- "**/test_cases.mts"
- "**/*_test_cases.cts"
- "**/test_cases.cts"
- "**/*_test_cases.tsx"
- "**/test_cases.tsx"
rules:
# Disable non-null assertions in test files.
'@typescript-eslint/no-non-null-assertion':
- off