-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
90 lines (85 loc) · 2.83 KB
/
.eslintrc.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
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
module.exports = {
env: {
node: true,
browser: true,
},
root: true,
parser: '@typescript-eslint/parser',
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
},
},
},
plugins: ['@typescript-eslint', 'prettier', 'import', 'jsdoc'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
'plugin:playwright/playwright-test',
],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
rules: {
// Prettier Rules
'prettier/prettier': 'error',
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
// TypeScript Rules
'@typescript-eslint/no-unsafe-assignment': 'off', // Consider revisiting this setting later to change it to either 'warn' or 'error'.
'@typescript-eslint/no-unsafe-member-access': 'off', // Consider revisiting this setting later to change it to either 'warn' or 'error'.
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
// Import Rules
'import/no-unresolved': 'error',
'import/named': 'error',
'import/default': 'error',
'import/no-absolute-path': 'error',
'import/no-self-import': 'error',
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
// General Rules
'require-await': 'error',
complexity: ['warn', { max: 11 }],
// JSDoc Rules
'jsdoc/check-alignment': 'warn',
'jsdoc/check-indentation': 'warn',
// Playwright Rules
'playwright/missing-playwright-await': ['error'],
'playwright/no-focused-test': 'error',
'playwright/valid-expect': 'error',
'playwright/prefer-web-first-assertions': 'error',
'playwright/no-useless-await': 'error',
'playwright/no-page-pause': 'error',
'playwright/no-element-handle': 'error',
'playwright/no-eval': 'error',
'playwright/prefer-to-be': 'error',
'playwright/prefer-to-contain': 'error',
'playwright/prefer-to-have-length': 'error',
'playwright/no-wait-for-timeout': 'warn',
'playwright/no-useless-not': 'warn',
'playwright/require-top-level-describe': 'off',
'playwright/expect-expect': 'off',
'playwright/no-conditional-in-test': 'off',
'playwright/no-skipped-test': 'off',
},
overrides: [
{
files: ['**/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
],
};