-
Notifications
You must be signed in to change notification settings - Fork 20
/
.eslintrc.cjs
93 lines (93 loc) · 2.49 KB
/
.eslintrc.cjs
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
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
warnOnUnsupportedTypeScriptVersion: true,
},
reportUnusedDisableDirectives: true,
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:json/recommended',
'plugin:security/recommended',
'prettier',
],
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports', 'prettier'],
overrides: [
{
files: ['*.md'],
processor: 'markdown/markdown',
parser: 'eslint-plugin-markdownlint/parser',
extends: ['plugin:markdown/recommended', 'plugin:markdownlint/recommended'],
rules: {
'markdownlint/md041': ['off'],
},
},
{
files: ['*.cjs', '*.cts'],
rules: {
'@typescript-eslint/no-var-requires': ['off'],
},
},
],
rules: {
'security/detect-object-injection': ['off'],
'prettier/prettier': [
'warn',
{},
{
usePrettierrc: true,
fileInfoOptions: {
withNodeModules: true,
},
},
],
'@typescript-eslint/no-var-requires': ['error'],
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
],
'@typescript-eslint/no-import-type-side-effects': ['error'],
'@typescript-eslint/explicit-module-boundary-types': ['off'],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-non-null-assertion': ['off'],
'@typescript-eslint/ban-types': [
'warn',
{
types: {
String: false,
'{}': false,
},
},
],
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true,
},
],
'simple-import-sort/exports': ['warn'],
'simple-import-sort/imports': ['warn'],
'unused-imports/no-unused-imports': ['warn'],
'unused-imports/no-unused-imports-ts': ['warn'],
},
}