-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
.eslintrc.yaml
85 lines (82 loc) · 2.85 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
extends:
# https://github.com/umijs/fabric/blob/master/src/eslint.ts
- ./node_modules/@umijs/fabric/dist/eslint
# https://github.com/import-js/eslint-plugin-import#typescript
- plugin:import/recommended
- plugin:import/typescript
# https://prettier.io/docs/en/related-projects.html#eslint-integrations
# `eslint-config-prettier`, turns off all ESLint rules that are unnecessary or might conflict with Prettier
- prettier
plugins: [import]
settings:
import/parsers:
# https://github.com/alexgorbatchev/eslint-import-resolver-typescript#configuration
'@typescript-eslint/parser': [.ts, .tsx]
import/resolver:
typescript:
# always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
alwaysTryTypes: true,
# Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
# use <root>/path/to/folder/tsconfig.json
project: './'
rules:
import/named: 2
import/namespace: 2
import/default: 2
import/export: 2
import/no-unresolved:
[2, { ignore: ['^virtual:windi.css$', '^unplugin-auto-import'] }]
# https://github.com/import-js/eslint-plugin-import/issues/1639
import/order:
[
error,
{
pathGroups:
[
{
pattern: '*.svg?component',
patternOptions: { dot: true, nocomment: true, matchBase: true },
group: 'internal',
position: 'after',
},
{
pattern: '*.svg',
patternOptions: { dot: true, nocomment: true, matchBase: true },
group: internal,
position: after,
},
{
pattern: '@/**/*.@(less|scss)',
group: internal,
position: after,
},
{ pattern: ./**/*.@(less|scss), group: index },
{ pattern: '@/**', group: internal },
],
groups:
[builtin, external, internal, parent, sibling, index, object, type],
newlines-between: always,
warnOnUnassignedImports: true,
alphabetize: {
# sort in ascending order. Options: ['ignore', 'asc', 'desc']
order: asc,
# ignore case. Options: [true, false]
caseInsensitive: false,
},
},
]
'@typescript-eslint/no-this-alias': [
error,
{
# Disallow `const { props, state } = this`; true by default
allowDestructuring: false,
# Allow `const self = this`; `[]` by default
allowedNames: [self],
},
]
'@typescript-eslint/no-empty-interface':
[0, { import/no-named-as-default-member: 0 }]
'@typescript-eslint/consistent-type-imports':
[1, { disallowTypeAnnotations: false }]
'@typescript-eslint/triple-slash-reference':
[0, { no-unused-expressions: off }]