-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy patheslint.config.mjs
117 lines (115 loc) · 3.73 KB
/
eslint.config.mjs
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
import eslint from '@eslint/js';
import tsEslint from 'typescript-eslint';
import eslintComments from 'eslint-plugin-eslint-comments';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import eslintConfigPrettier from 'eslint-config-prettier';
import pluginPromise from 'eslint-plugin-promise';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
export default tsEslint.config(
{
files: ['src/**/*.ts', 'prisma/**/*.ts', 'test/**/*.ts'],
languageOptions: {
ecmaVersion: 5,
sourceType: 'script',
parserOptions: {
project: ['./tsconfig.json'],
createDefaultProgram: false,
},
},
extends: [
eslint.configs.all,
...tsEslint.configs.all,
eslintPluginUnicorn.configs['flat/all'],
pluginPromise.configs['flat/recommended'],
],
plugins: {
typescriptEslint,
'eslint-comments': eslintComments,
},
rules: {
complexity: [
'error',
{
max: 5,
},
],
'max-len': [
'error',
{
code: 300,
},
],
'max-lines-per-function': [
'error',
{
max: 30,
},
],
'@typescript-eslint/max-params': [
'error',
{
max: 2,
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'no-public',
},
],
'promise/no-multiple-resolved': 'error',
'promise/spec-only': 'error',
'eslint-comments/no-use': [
'error',
{ 'allow': ['eslint-disable-next-line', 'eslint-disable', 'eslint-enable'] },
],
// Off
'max-params': 'off',
'sort-keys': 'off',
'no-underscore-dangle': 'off',
'sort-imports': 'off',
'new-cap': 'off',
'strict': 'off',
'one-var': 'off',
'no-undefined': 'off',
'no-inline-comments': 'off',
'no-void': 'off',
'func-style': 'off',
'no-duplicate-imports': 'off',
'no-implicit-coercion': 'off',
'no-ternary': 'off',
'no-implicit-globals': 'off',
'no-warning-comments': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/init-declarations': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/class-methods-use-this': 'off',
'@typescript-eslint/parameter-properties': 'off',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-unsafe-type-assertion': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prefer-module': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-global-this': 'off',
},
},
eslintConfigPrettier,
);