forked from folke/esbuild-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
113 lines (113 loc) · 3.44 KB
/
.eslintrc.js
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
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"plugin:eslint-comments/recommended",
"plugin:node/recommended",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:unicorn/recommended",
"plugin:promise/recommended",
],
plugins: ["@typescript-eslint", "prettier", "jest", "import", "promise"],
root: true,
reportUnusedDisableDirectives: true,
env: { node: true },
settings: { node: { tryExtensions: [".js", ".ts", ".vue"] } },
ignorePatterns: ["node_modules/", "build/", "dist/"],
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
sourceType: "module",
ecmaFeatures: { jsx: true },
createDefaultProgram: true,
project: "./tsconfig.json",
impliedStrict: true,
warnOnUnsupportedTypeScriptVersion: false,
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: { jest: true },
},
],
rules: {
"import/default": "off",
"import/no-namespace": "error",
"no-console": "error",
"no-debugger": "off",
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
"node/no-unsupported-features/es-syntax": [
"error",
{ version: ">=15.3.0", ignores: ["modules", "dynamicImport"] },
],
"node/no-unsupported-features/node-builtins": [
"error",
{ version: ">=15.3.0", ignores: [] },
],
"node/no-unsupported-features/es-builtins": [
"error",
{ version: ">=15.3.0", ignores: [] },
],
"node/no-missing-import": [
"error",
{ tryExtensions: [".js", ".ts", ".d.ts"] },
],
"array-callback-return": "error",
"prefer-template": "warn",
"prefer-promise-reject-errors": "error",
"require-unicode-regexp": "error",
yoda: "error",
"prefer-spread": "error",
"unicorn/filename-case": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/no-object-as-default-parameter": "off",
"unicorn/no-reduce": "off",
"unicorn/no-process-exit": "off",
"lines-between-class-members": [
"error",
"always",
{ exceptAfterSingleLine: true },
],
// "promise/valid-params": "off",
"prettier/prettier": "warn",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-null": "off",
"unicorn/explicit-length-check": "off",
"unicorn/consistent-function-scoping": "off",
"no-restricted-imports": [
"error",
{
paths: [
{
name: "type-graphql",
importNames: ["Arg", "Args", "Resolver", "Query"],
message: "Please use the imports from '@nestjs/graphql' instead.",
},
{
name: "lodash",
importNames: ["default"],
message:
"Please use the seperate imports '@lodash/debounce' instead.",
},
],
},
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"jest/expect-expect": [
"warn",
{ assertFunctionNames: ["expect", "request.get.expect"] },
],
},
}