-
Notifications
You must be signed in to change notification settings - Fork 103
/
eslint.config.js
53 lines (50 loc) · 1.25 KB
/
eslint.config.js
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
// @ts-check
import stylistic from '@stylistic/eslint-plugin';
import playwright from 'eslint-plugin-playwright';
import tseslint from 'typescript-eslint';
const includedFolders = ['src', 'features'];
const customizedESLint = stylistic.configs.customize({
indent: 2,
quotes: 'single',
semi: true,
jsx: true,
commaDangle: 'never',
braceStyle: '1tbs'
});
export default tseslint.config(
{
ignores: [
'**/{www,dist,build}/**/*.*',
'projects/*/!(src)/**/*.*',
`!(${includedFolders.join(',')})/**/*.*`,
'!*.{js,ts,mjs,cjs}'
]
},
{
name: 'typescript',
files: ['**/*.{ts,js,tsx,jsx,mjs,cjs,mts}'],
extends: [...tseslint.configs.recommendedTypeChecked, ...tseslint.configs.stylisticTypeChecked],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
plugins: {
'@stylistic': stylistic
},
rules: {
...customizedESLint.rules
}
},
{
name: 'tests',
...playwright.configs['flat/recommended'],
files: ['**/*.test.{ts,js}?(x)', 'e2e/src/**/*.ts'],
rules: {
'playwright/no-wait-for-timeout': 'error',
'playwright/no-wait-for-selector': 'error'
}
}
);