-
Notifications
You must be signed in to change notification settings - Fork 10
/
.eslintrc
75 lines (75 loc) · 2.16 KB
/
.eslintrc
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
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 2018
},
"overrides": [
{
"files": ["*.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"modules": true
},
"project": "tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"import",
"simple-import-sort",
"typesafe"
],
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
// Rules for auto sort of imports
"simple-import-sort/imports": [
"error",
{
"groups": [
// Side effect imports.
["^\\u0000"],
// Packages.
// Things that start with a letter (or digit or underscore), or
// `@` followed by a letter.
["^@?\\w"],
// Root imports
["^(src)(/.*|$)"],
["^(tests)(/.*|$)"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"]
]
}
],
"sort-imports": "off",
"import/order": "off",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"@typescript-eslint/no-floating-promises": 2,
"@typescript-eslint/no-unused-vars": 2,
// Disabled pending refactoring of two helper functions
// "typesafe/no-throw-sync-func": "error"
}
},
{ "files": ["*.spec.ts"], "extends": ["plugin:jest/recommended"] },
{
"files": ["*.ts", "*.js"],
"excludedFiles": ["**/*.spec.ts", "**/.spec.js", "**/__tests__/**/*.ts"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "error"
}
}
],
"rules": {
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-console": "warn"
}
}