-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
48 lines (48 loc) · 1.91 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
/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: { project: ["tsconfig.json", "tsconfig.dev.json"] },
settings: { "import/resolver": { typescript: true }, jest: { version: "latest" } },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:@eslint-community/eslint-plugin-eslint-comments/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:n/recommended",
"plugin:prettier/recommended",
"plugin:unicorn/recommended",
"universe/node",
],
rules: {
"@eslint-community/eslint-comments/no-unused-disable": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/no-shadow": "error",
"import/prefer-default-export": "error",
"no-console": "warn",
"no-restricted-imports": ["error", { patterns: ["./server/"] }],
"no-shadow": "off", // @typescript-eslint/no-shadow
"unicorn/filename-case": "off", // use default export name
"unicorn/no-useless-undefined": ["error", { checkArrowFunctionBody: false }], // @typescript-eslint/no-empty-function
"unicorn/number-literal-case": "off", // incompatible with prettier
"unicorn/prefer-math-min-max": "off", // incompatible with bigint
"unicorn/switch-case-braces": ["error", "avoid"], // consistently avoid braces
},
overrides: [
{
files: ["test/**"],
extends: ["plugin:@vitest/legacy-all"],
rules: {
"@vitest/max-expects": "off",
"@vitest/no-hooks": "off",
"@vitest/prefer-expect-assertions": [
"warn",
{ onlyFunctionsWithExpectInLoop: true, onlyFunctionsWithExpectInCallback: true },
],
},
},
],
ignorePatterns: ["dist/", "coverage/", "generated/"],
};