-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.cjs
92 lines (91 loc) · 2.92 KB
/
eslint.config.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
const eslint = require('@eslint/js');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const mochaPlugin = require('eslint-plugin-mocha');
const globals = require('globals');
module.exports = [
eslint.configs.recommended,
mochaPlugin.configs.flat.recommended,
{
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { modules: true },
ecmaVersion: '2022'
},
globals: {
...globals.browser,
...globals.node,
...globals.es2021
}
},
plugins: {
'@typescript-eslint': tsPlugin,
'mocha': mochaPlugin
},
files: ['**/*.ts'],
rules: {
'no-unsafe-optional-chaining': 'off',
'key-spacing': [
'error',
{
'singleLine': {
'beforeColon': false,
'afterColon': true,
},
'multiLine': {
'beforeColon': true,
'afterColon': true,
},
'align': {
'beforeColon': true,
'afterColon': true,
'on': 'colon',
'mode': 'minimum'
}
}
],
'quotes': [
'error',
'single',
{ 'allowTemplateLiterals': true }
],
'semi': ['error', 'always'],
'indent': ['error', 2, { 'SwitchCase': 1 }],
'no-unused-vars': 'off',
'prefer-const': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
'vars': 'all',
'args': 'after-used',
'ignoreRestSiblings': true,
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_'
}
],
'no-dupe-class-members': 'off',
'no-trailing-spaces': ['error'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'mocha/no-exclusive-tests': 'warn',
'mocha/no-setup-in-describe': 'off',
'mocha/no-mocha-arrows': 'off',
'mocha/max-top-level-suites': 'off',
'mocha/no-identical-title': 'off',
'mocha/no-pending-tests': 'off',
'mocha/no-skipped-tests': 'off',
'mocha/no-sibling-hooks': 'off',
}
},
{
ignores: [
'**/*.js',
'**/*.cjs',
'**/*.mjs',
'**/*.d.ts',
'**/prototyping/*'
]
}
];