-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc
112 lines (110 loc) · 3.08 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
"root": true,
"ignorePatterns": ["dist", "node_modules", "src/version.ts"],
"extends": [
"strictest/eslint",
"strictest/promise",
"strictest/typescript-eslint",
"strictest/unicorn",
"eslint:recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
"plugin:require-extensions/recommended"
],
"plugins": [
"prettier",
"require-extensions",
"unicorn",
"promise",
"@typescript-eslint",
"deprecation",
"file-progress"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.prod.json",
"tsconfigRootDir": "./"
},
"env": {
"node": true
},
"settings": {
"import/resolver": {
"typescript": true,
"node": true
}
},
"rules": {
"file-progress/activate": 1,
"deprecation/deprecation": "warn",
"prettier/prettier": "warn",
"no-constant-condition": "warn",
"no-console": "warn",
"no-dupe-else-if": "warn",
"spaced-comment": ["warn", "always", { "exceptions": ["*"] }], // doc comments exist
"consistent-return": "off", // TS handles this
"no-duplicate-imports": "off", // eslint-plugin-import handles this
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-invalid-void-type": ["error", { "allowAsThisParameter": true }],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ "accessibility": "no-public", "overrides": { "properties": "off" } }
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{ "allowConciseArrowFunctionExpressionsStartingWithVoid": true }
],
"@typescript-eslint/consistent-type-definitions": ["warn", "interface"],
"@typescript-eslint/array-type": ["warn", { "default": "generic" }],
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/no-unused-vars": "warn",
"unicorn/catch-error-name": ["warn", { "name": "error" }],
"unicorn/import-index": ["error", { "ignoreImports": true }],
"unicorn/no-process-exit": "off" // we are a CLI app lol
},
"overrides": [
{
"files": ["*.ts", "src/**/*.test.ts", "src/**/__mocks__/**/*.ts", "tests/**/*.ts"],
"extends": ["plugin:vitest/recommended"],
"plugins": ["vitest"],
"parserOptions": {
"project": "./tsconfig.test.json"
},
"rules": {
"prettier/prettier": "warn",
"max-nested-callbacks": "off", // unit tests involve a lot of nested callbacks
"vitest/expect-expect": [
"warn",
{
"assertFunctionNames": [
"expect",
"expectArray",
"expectArrayOfLength",
"expectDefined",
"expectNull",
"expectToContain",
"expectUndefined",
"expectValueEqual"
]
}
]
}
},
{
"files": ["scripts/**/*.ts"],
"parserOptions": {
"project": "./tsconfig.test.json",
"tsconfigRootDir": "."
},
"rules": {
"unicorn/no-process-exit": "off",
"no-console": ["warn", { "allow": ["error", "warn", "info"] }]
}
}
]
}