-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
79 lines (79 loc) · 2.93 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
71
72
73
74
75
76
77
78
79
{
"root": true,
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"plugins": ["@typescript-eslint", "prettier", "jest", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin
// "plugin:@typescript-eslint/recommended-type-checked", // Uncomment for very strict validation rules
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
"plugin:jest/recommended",
"plugin:jest/style",
"prettier"
],
"env": {
"browser": true,
"node": true,
"jest": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
"project": "./tsconfig.json",
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/array-type": ["error", { "default": "array" }],
"no-trailing-spaces": [
"error",
{
"ignoreComments": true
}
],
"no-fallthrough": "error",
"jest/valid-expect": ["error", { "maxArgs": 2 }],
"jest/require-top-level-describe": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_" }
], // Allow unused vars when prefixed with underscore
"jest/no-commented-out-tests": "warn",
"spaced-comment": ["error", "always"],
"@typescript-eslint/no-explicit-any": "warn",
"no-console": "warn",
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
// "@typescript-eslint/no-floating-promises": ["warn", { "ignoreVoid": true }],
"require-await": "warn",
"curly": ["warn", "all"],
"eqeqeq": ["error", "allow-null"],
"import/no-cycle": "off" // TODO: Enabling this slows down VSCode ESLint plugin - https://github.com/microsoft/vscode-eslint/issues/1431
},
"overrides": [
{
// Unit tests
"files": ["*.{spec,test}.{ts}", "**/tests/**"],
"rules": {
"no-console": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
"project": ["libs/*/tsconfig.json", "services/*/**/tsconfig.json"]
}
}
}
}