forked from VKCOM/VKUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
70 lines (69 loc) · 2.17 KB
/
.eslintrc.json
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
{
"root": true,
"env": {
"es6": true, // Enable global es6 variables, like Set, Map, etc
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["import"],
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
"sourceType": "module", // Allows for the use of imports
"ecmaFeatures": {
"jsx": true, // Allows for the parsing of JSX
"restParams": true,
"spread": true
}
},
"extends": [
"@vkontakte/eslint-config/typescript/react", // "Preset 1"
"prettier" // "Preset 2" (overrides "Preset 1")
],
"rules": {
"@typescript-eslint/explicit-member-accessibility": "off", // [Reason] overrides "Preset 1"
"@typescript-eslint/no-unnecessary-condition": "off", // [Reason] overrides "Preset 1"
"@typescript-eslint/no-magic-numbers": "off", // [Reason] overrides "Preset 1"
"@typescript-eslint/no-non-null-assertion": "off", // [Reason] overrides "Preset 1"
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": {
"descriptionFormat": "^: TS\\d+ .+$"
}
}
],
"no-shadow": "off", // [Reason] need using @typescript-eslint/no-shadow
"no-restricted-globals": ["error", "window", "document"],
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"newlines-between": "never",
"alphabetize": {
"order": "asc"
},
"pathGroupsExcludedImportTypes": ["**/*.css", "react", "react-dom", "react-dom/**"],
"pathGroups": [
{
"pattern": "{react,react-dom,react-dom/**}",
"group": "external",
"position": "before"
},
{ "pattern": "{.,..}/**/*.css", "group": "index", "position": "after" }
]
}
],
"sort-imports": [
"error",
{
"ignoreCase": true,
"ignoreDeclarationSort": true,
"ignoreMemberSort": false,
"allowSeparatedGroups": true,
"memberSyntaxSortOrder": ["none", "single", "all", "multiple"]
}
]
}
}