Skip to content

Commit bd45b46

Browse files
committed
env: apply eslint-plugin-playwright
* split jest and playwright eslint rules
1 parent beddd72 commit bd45b46

File tree

3 files changed

+38
-12
lines changed

3 files changed

+38
-12
lines changed

.eslintrc.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
const defaultExtends = [
2+
'tui',
3+
'prettier',
4+
'plugin:@typescript-eslint/recommended',
5+
'plugin:react/recommended',
6+
'plugin:prettier/recommended',
7+
];
8+
19
module.exports = {
210
root: true,
311
env: {
@@ -20,14 +28,7 @@ module.exports = {
2028
'@typescript-eslint',
2129
'jest',
2230
],
23-
extends: [
24-
'tui',
25-
'prettier',
26-
'plugin:@typescript-eslint/recommended',
27-
'plugin:jest/recommended',
28-
'plugin:react/recommended',
29-
'plugin:prettier/recommended',
30-
],
31+
extends: defaultExtends,
3132
settings: {
3233
react: {
3334
pragma: 'h',
@@ -92,7 +93,8 @@ module.exports = {
9293
},
9394
overrides: [
9495
{
95-
files: ['*.spec.ts', '*.spec.tsx', '*.e2e.ts'],
96+
files: ['*.spec.ts', '*.spec.tsx'],
97+
extends: ['plugin:jest/recommended'],
9698
rules: {
9799
'max-nested-callbacks': ['error', { max: 5 }],
98100
'jest/expect-expect': [
@@ -101,15 +103,15 @@ module.exports = {
101103
assertFunctionNames: ['expect', 'assert*'],
102104
},
103105
],
106+
'jest/no-conditional-expect': 'warn',
104107
},
105108
},
106109
{
107110
files: ['apps/calendar/playwright/**/*.ts'],
111+
extends: ['plugin:playwright/playwright-test'],
108112
rules: {
113+
'max-nested-callbacks': ['error', { max: 5 }],
109114
'dot-notation': ['error', { allowKeywords: true }],
110-
'jest/expect-expect': 'off',
111-
'jest/no-done-callback': 'off',
112-
'jest/no-standalone-expect': ['error', { additionalTestBlockFunctions: ['test'] }],
113115
},
114116
},
115117
],

package-lock.json

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"eslint-config-prettier": "^8.5.0",
2424
"eslint-config-tui": "^5.1.0",
2525
"eslint-plugin-jest": "^26.6.0",
26+
"eslint-plugin-playwright": "^0.9.0",
2627
"eslint-plugin-prettier": "^4.2.1",
2728
"eslint-plugin-react": "^7.30.1",
2829
"eslint-plugin-react-hooks": "^4.6.0",

0 commit comments

Comments
 (0)