-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
56 lines (55 loc) · 1.75 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
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import playwright from 'eslint-plugin-playwright';
import tsParser from '@typescript-eslint/parser';
export default tseslint.config(
{
ignores: ['node_modules', 'logs', 'playwright-report', 'eslint.config.mjs'],
},
...tseslint.configs.stylistic,
{
files: ['**/*.ts'],
plugins: {
prettier: eslintPluginPrettierRecommended,
playwright,
},
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: process.cwd(),
},
},
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
rules: {
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-console': 'off',
'class-methods-use-this': 'off',
'max-classes-per-file': 'off',
'no-useless-constructor': 'off',
'no-empty-function': 'off',
'func-names': 'off',
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'no-empty-pattern': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/await-thenable': 'error',
},
},
// Playwright ESlint config
{
files: ['src/tests/**'],
rules: {
'playwright/no-standalone-expect': 'off',
'playwright/expect-expect': 'warn',
'playwright/no-wait-for-timeout': 'error',
'playwright/missing-playwright-await': 'error',
'playwright/no-element-handle': 'warn',
'playwright/expect-expect': 'off',
},
},
);