-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.mjs
More file actions
103 lines (102 loc) · 2.93 KB
/
eslint.config.mjs
File metadata and controls
103 lines (102 loc) · 2.93 KB
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
94
95
96
97
98
99
100
101
102
103
import vitest from '@vitest/eslint-plugin'
import wdioEslint from '@wdio/eslint'
import * as pluginImportX from 'eslint-plugin-import-x'
import mochaPlugin from 'eslint-plugin-mocha'
export default wdioEslint.config([
{
/**
* Eslint ignore patterns for the whole project
*/
ignores: [
'**/.vscode-test',
'**/.wdio-vscode-service',
'**/dist',
'**/out',
'**/node_modules',
'**/coverage',
'**/*.d.ts',
],
},
{
files: ['**/*.ts'],
},
{
plugins: {
'import-x': pluginImportX,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'import',
format: ['camelCase', 'PascalCase'],
},
],
'@stylistic/indent': ['error', 4, { SwitchCase: 1 }],
'no-throw-literal': 'warn',
'import-x/order': [
'error',
{
groups: ['builtin', 'external', ['sibling', 'parent'], 'type'],
alphabetize: { order: 'asc' },
sortTypesGroup: true,
'newlines-between': 'always',
'newlines-between-types': 'ignore',
pathGroups: [
{
pattern: '@wdio-vscode/**',
group: 'sibling',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['builtin', 'type'],
},
],
},
},
{
files: ['packages/*/src/*.ts'],
ignores: ['packages/vscode-wdio-worker/**/*'],
rules: {
'no-console': 'error',
},
},
{
files: ['tests/**/*.spec.ts', 'tests/**/*.test.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
/**
* Eslint configuration for the vitest test files
*/
files: ['packages/**/tests/**/*.test.ts'],
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
'vitest/max-nested-describe': ['error', { max: 3 }],
'vitest/padding-around-describe-blocks': 'error',
'vitest/padding-around-test-blocks': 'error',
},
},
{
/**
* Eslint configuration for the mocha test files
*/
files: ['e2e/**/*.spec.ts'],
...mochaPlugin.configs.recommended,
},
{
/**
* for extension of wdio-vscode-service
*/
files: ['e2e/pageobjects/**/*.ts'],
rules: {
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
},
},
])