forked from openapi-ts/openapi-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
64 lines (64 loc) · 1.87 KB
/
.eslintrc.cjs
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
/** @type {import('@types/eslint').Linter.BaseConfig} */
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./tsconfig.json"],
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/strict",
"plugin:vitest/recommended",
],
plugins: [
"@typescript-eslint",
"import",
"no-only-tests",
"prettier",
"vitest",
],
rules: {
"@typescript-eslint/consistent-indexed-object-style": "off", // sometimes naming keys is more user-friendly
"@typescript-eslint/no-dynamic-delete": "off", // delete is OK
"@typescript-eslint/no-non-null-assertion": "off", // this is better than "as"
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unnecessary-condition": "off", // this gives bad advice
"arrow-body-style": ["error", "as-needed"],
"dot-notation": "error",
"import/newline-after-import": "error",
"import/order": [
"error",
{
alphabetize: {
order: "asc",
orderImportKind: "asc",
caseInsensitive: true,
},
groups: [
["builtin", "external"],
"internal",
"parent",
"index",
"sibling",
],
},
],
curly: "error",
"object-shorthand": "error", // don’t use foo["bar"]
"no-console": "error",
"no-global-assign": "error",
"no-undef": "off", // handled by TS
"no-unused-vars": "off",
},
overrides: [
{
files: ["**/*.test.*"],
rules: {
"@typescript-eslint/ban-ts-comment": "off", // allow @ts-ignore only in tests
"@typescript-eslint/no-empty-function": "off", // don’t enforce this in tests
"@typescript-eslint/no-explicit-any": "off", // tests sometimes need this
"no-only-tests/no-only-tests": "error",
"vitest/valid-title": "off", // doesn’t work?
},
},
],
};