-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
eslint.config.mjs
77 lines (73 loc) · 2.14 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
import eslint from '@eslint/js'
import prettierConfig from 'eslint-config-prettier'
import typescript from 'typescript-eslint'
export default [
{
ignores: [
'browser/',
'dist/',
'docs/',
'docs-slate/',
'lib/',
'package-lock.json',
'playground/dist/',
'tests/artifacts/',
'tests/json-test-suite/',
'tests/yaml-test-suite/'
]
},
eslint.configs.recommended,
...typescript.configs.recommendedTypeChecked,
prettierConfig,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['*js', 'config/*js'],
defaultProject: 'tsconfig.json'
}
}
},
rules: {
'array-callback-return': 'error',
camelcase: 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-constant-condition': ['error', { checkLoops: false }],
'no-control-regex': 'off',
'no-fallthrough': ['error', { commentPattern: 'fallthrough' }],
'no-implicit-globals': 'error',
'no-template-curly-in-string': 'warn',
'no-var': 'error',
'prefer-const': ['warn', { destructuring: 'all' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' }
],
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': [
'warn',
{ ignoreMixedLogicalExpressions: true }
],
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/restrict-template-expressions': 'off'
}
},
{
files: ['config/**'],
languageOptions: { globals: { console: true, module: true, process: true } }
},
{
files: ['tests/**'],
rules: {
camelcase: 0,
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/unbound-method': 'off'
}
}
]