-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path.eslintrc.json
More file actions
78 lines (78 loc) · 2.03 KB
/
.eslintrc.json
File metadata and controls
78 lines (78 loc) · 2.03 KB
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
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint", "simple-import-sort", "import", "graphql"],
"parser": "@typescript-eslint/parser",
"ignorePatterns": [
"**/dist",
"client_codegen.ts",
"vitest.config.ts",
"tsup.config.js"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"root": true,
"overrides": [
{
"files": ["src/**/*.ts", "__tests__/**/*.ts"],
"parserOptions": {
"project": "./tsconfig.json"
}
},
{
"files": ["__tests__/**/*.{ts,tsx,mts,cts}"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["__e2e__/**/*.mjs", "__e2e__/**/*.ts"],
"parserOptions": {
"project": "./__e2e__/tsconfig.json"
}
},
{
"files": ["**/*.graphql"],
"parser": "@graphql-eslint/eslint-plugin",
"plugins": ["graphql"],
"rules": {
"prettier/prettier": "error"
}
}
],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
// to enforce using type for objec type definitions, can be type or interface
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
// Prefer T[] over Array<T> for array type definitions
"@typescript-eslint/array-type": ["error", { "default": "array" }],
//// Prefer optional chaining over explicit null/undefined checks
"@typescript-eslint/prefer-optional-chain": "error",
// Require comments in empty functions to document intent
"@typescript-eslint/no-empty-function": [
"error",
{
"allow": []
}
],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"@typescript-eslint/ban-ts-comment": "warn"
},
"env": {
"node": true
}
}