-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
72 lines (68 loc) · 2.05 KB
/
eslint.config.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
/* eslint-disable @typescript-eslint/no-unsafe-argument */
// @ts-check
import eslint from '@eslint/js';
import globals from 'globals';
import sonarjs from 'eslint-plugin-sonarjs';
import tseslint from 'typescript-eslint';
import unicorn from 'eslint-plugin-unicorn';
export default tseslint.config(
{
ignores: ['dist', 'coverage'],
},
eslint.configs.recommended,
unicorn.configs['flat/all'],
sonarjs.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
globals: globals.builtin,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
'no-var': 'error',
semi: 'error',
'no-multi-spaces': 'error',
'no-empty-function': 'error',
'no-floating-decimal': 'error',
'no-implied-eval': 'error',
'no-lone-blocks': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-new': 'error',
'no-octal-escape': 'error',
'no-return-await': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'space-in-parens': 'error',
'no-multiple-empty-lines': 'error',
'no-unsafe-negation': 'error',
'prefer-const': 'error',
'no-console': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'sonarjs/sonar-no-unused-vars': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/catch-error-name': 'off',
// duplicates of tseslint
'sonarjs/no-misused-promises': 'off',
'sonarjs/sonar-prefer-optional-chain': 'off',
'@typescript-eslint/no-empty-function': 'off',
'sonarjs/no-redundant-type-constituents': 'off',
},
},
{
files: ['src/**/*.js'],
...tseslint.configs.disableTypeChecked,
},
);