forked from devhatt/octopost-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
176 lines (176 loc) · 5.62 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
"ignorePatterns": [
"node_modules",
"coverage",
"dist",
"build",
"pnpm-lock.yaml",
"vitest.config.ts",
"commitlint.config.ts"
],
"extends": [
"eslint:recommended",
"plugin:import/warnings",
"plugin:import/typescript"
],
"env": {
"node": true
},
"plugins": [
"perfectionist",
"@typescript-eslint",
"vitest",
"prettier",
"simple-import-sort",
"import"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"settings": {
"import/parsers": {
"espree": [".js", ".cjs", ".mjs", ".jsx"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
},
"typescript": true
}
},
"overrides": [
{
"files": ["**/*.ts"],
"rules": {
"arrow-body-style": ["warn", "as-needed"],
"class-methods-use-this": "off",
"dot-notation": "off",
"max-params": "off",
"no-loop-func": "off",
"no-loss-of-precision": "off",
"no-magic-numbers": "off",
"no-unused-vars": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/default": "error",
"import/export": "warn",
"import/namespace": "warn",
"import/newline-after-import": "error",
"import/no-useless-path-segments": [
"error",
{
"noUselessIndex": true
}
],
"import/no-absolute-path": "warn",
"import/no-default-export": "error",
"import/no-duplicates": "warn",
"import/no-named-as-default": "warn",
"import/no-named-as-default-member": "warn",
"import/no-unused-modules": "warn",
"import/first": "error",
"import/no-relative-packages": "error",
"import/no-self-import": "error",
"import/no-deprecated": "error",
"import/no-cycle": "off",
"import/no-namespace": "off",
"import/no-internal-modules": "off",
"import/order": "off",
"perfectionist/sort-array-includes": "warn",
"perfectionist/sort-classes": "warn",
"perfectionist/sort-enums": "warn",
"perfectionist/sort-exports": "warn",
"perfectionist/sort-interfaces": "warn",
"perfectionist/sort-maps": "warn",
"perfectionist/sort-object-types": "warn",
"perfectionist/sort-objects": "warn",
"perfectionist/sort-union-types": "warn",
"unicorn/no-null": "off",
"unicorn/prevent-abbreviations": "off"
}
},
{
"files": ["**/*.ts"],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/consistent-type-exports": "warn",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports"
}
],
"@typescript-eslint/no-array-constructor": "warn",
"@typescript-eslint/no-duplicate-type-constituents": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-extra-non-null-assertion": "warn",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-for-in-array": "warn",
"@typescript-eslint/no-implied-eval": "warn",
"@typescript-eslint/no-loss-of-precision": "warn",
"@typescript-eslint/no-misused-new": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-namespace": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"ignoreRestSiblings": true,
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/prefer-as-const": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/triple-slash-reference": "warn",
"@typescript-eslint/unbound-method": "warn"
}
},
{
"files": ["**/routes/*-routes.ts"],
"rules": {
"@typescript-eslint/no-misused-promises": "off",
"import/no-default-export": "off"
}
},
{
"files": ["**/*.test.ts"],
"globals": {
"jest": true
},
"rules": {
"prettier/prettier": "error",
"no-undef": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/unbound-method": "off",
"vitest/expect-expect": "warn",
"vitest/no-commented-out-tests": "warn",
"vitest/no-identical-title": "warn",
"vitest/no-import-node-test": "warn",
"vitest/require-local-test-context-for-concurrent-snapshots": "warn",
"vitest/valid-describe-callback": "warn",
"vitest/valid-expect": "warn",
"vitest/valid-title": "warn"
}
}
],
"rules": {
"prettier/prettier": "error"
}
}