-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.json
98 lines (93 loc) · 3.14 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"root": true,
// "env": {
// "browser": true,
// "commonjs": true,
// "node": true
// },
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:promise/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "."
// "ecmaVersion": 2020,
// "sourceType": "module",
// "project": "./tsconfig.json"
},
"plugins": [
"@stylistic",
"@typescript-eslint",
"promise"
],
"ignorePatterns": [
"dummy-ext/",
"test_projects/",
"esbuild.js"
],
"rules": {
/****** @typescript-eslint/recommended-type-checked *****/
// "no-return-await": "off", // deprecated; must be disabled to avoid conflict with "@typescript-eslint/return-await"
// "@typescript-eslint/return-await": "error",
// "require-await": "error",
// "@typescript-eslint/require-await": "error",
"@stylistic/indent": [ "error", "tab" ],
"@stylistic/comma-spacing": [ "warn", { "before": false, "after": true }],
"@stylistic/no-extra-parens": "warn",
"@typescript-eslint/no-restricted-types": [ "error", {
"types": {
"Object": "Use {} instead.",
"String": "Use 'string' instead.",
"Number": "Use 'number' instead.",
"Boolean": "Use 'boolean' instead."
}
}],
"@typescript-eslint/naming-convention": [ "error", {
"selector": "interface",
"format": [ "PascalCase" ],
"custom": { "regex": "^I[A-Z]", "match": true }
}],
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
"@typescript-eslint/no-floating-promises": [ "error", { "checkThenables": true } ],
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-non-null-assertion": 0, // strict-type-checked="error"
"@typescript-eslint/no-unnecessary-condition": 0, // strict-type-checked="error"
"no-unused-vars": "off", // must be disabled to avoid conflict with "@typescript-eslint/no-unused-vars"
"@typescript-eslint/no-unused-vars": [ // strict-type-checked="error"
"warn", {
"argsIgnorePattern": "^_",
"vars": "all",
"args": "none",
"ignoreRestSiblings": false
}
],
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"promise/catch-or-return": "warn",
"promise/no-callback-in-promise": "off",
"promise/always-return": [ "warn", { "ignoreLastCallback": true } ],
// "no-await-in-loop": "warn",
"no-console": "warn",
"no-empty": "warn",
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-trailing-spaces": [ "error", { "skipBlankLines": false }],
"prefer-promise-reject-errors": "error",
"quotes": ["warn", "single"],
"semi": [ "error", "never"],
"space-before-blocks": [ "error", "always"],
"space-before-function-paren": ["warn", "always"],
"space-in-parens": [ "warn", "never"],
"spaced-comment": [ "error", "always", { "markers": [ "/" ] }]
}
}