-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
85 lines (82 loc) · 2.94 KB
/
Copy patheslint.config.mjs
File metadata and controls
85 lines (82 loc) · 2.94 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
79
80
81
82
83
84
85
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import sonarjs from 'eslint-plugin-sonarjs';
import tseslint from 'typescript-eslint';
const eslintConfig = [
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
plugins: { sonarjs },
rules: {
'sonarjs/no-duplicate-string': 'off',
'sonarjs/cognitive-complexity': 'warn',
'sonarjs/no-small-switch': 'warn',
},
},
{
ignores: ['dist/**'],
},
{
rules: {
'no-var': 'error',
'prefer-const': 'error',
'func-call-spacing': ['error', 'never'],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'no-debugger': 'error',
'no-dupe-keys': 'error',
'no-with': 'error',
eqeqeq: ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true }],
'no-unused-vars': 'off',
camelcase: ['error', { properties: 'never' }],
'no-duplicate-imports': 'error',
'require-await': 'error',
'no-undef': 'off',
},
},
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['*.mjs', '*.js', '*.ts'],
},
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'require-await': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: false },
],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': false,
},
],
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-unsafe-function-type': 'error',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-wrapper-object-types': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
];
export default eslintConfig;