-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.yml
54 lines (48 loc) · 1.6 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
env:
browser: true
parser: '@typescript-eslint/parser'
parserOptions:
project: ./tsconfig.json
extends: openstax-poland/typescript/style
settings:
# Consider PnP-installed modules as external
import/external-module-folders: ["node_modules", ".yarn"]
rules:
# Since TS has no type state and doesn't track inter-variable relations, it's
# unable to determine that `path` is not null inside this if:
#
# const [node, path] = Editor.next(editor, options) ?? []
#
# if (node != null) {
# // Since `[node, path]` is `[Node, Path] | undefined`, then if `node` is
# // not `null` then neither is `path`, but TS still thinks it's
# // `Path | undefined`.
# }
#
# For this reason we unfortunately use quite a number of non-null assertions.
'@typescript-eslint/no-non-null-assertion': off
# Same as default configuration but PascalCase is allowed for variable names.
# This is because we follow Slate's convention of defining functions connected
# to interfaces as an object with the same name (using declaration merging):
#
# interface Name {}
#
# const Name = {
# isName(value: unknown): value is Name {
# // ...
# },
# }
#
# This will become unnecessary once typescript-eslint#2223 is resolved.
'@typescript-eslint/naming-convention':
- warn
- selector: default
format: [camelCase]
leadingUnderscore: allow
trailingUnderscore: allow
- selector: variable
format: [camelCase, UPPER_CASE, PascalCase]
leadingUnderscore: allow
trailingUnderscore: allow
- selector: typeLike
format: [PascalCase]