-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
74 lines (73 loc) · 2.27 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
import eslint from '@eslint/js';
import tsEslintParser from '@typescript-eslint/parser';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import prettierConfig from 'eslint-config-prettier';
import globals from 'globals';
import tsEslint from 'typescript-eslint';
import eslintSecurity from 'eslint-plugin-security';
export default tsEslint.config(
eslint.configs.recommended,
eslintSecurity.configs.recommended,
...tsEslint.configs.strict,
...tsEslint.configs.stylistic,
prettierConfig,
{
files: ['**/*.{ts,mts,cts,tsx}'],
plugins: {
'simple-import-sort': simpleImportSort,
},
ignores: ['**/dist', '**/node_modules', '**/.yarn', '**/.vscode'],
languageOptions: {
parser: tsEslintParser,
ecmaVersion: 2022,
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.node,
myCustomGlobal: 'readonly',
},
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'prefer-const': ['error', { destructuring: 'all' }],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-unsafe-function-type': 'error',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
},
},
{
files: ['**/*.{js,mjs,cjs}'],
...tsEslint.configs.disableTypeChecked,
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
);