forked from carbon-design-system/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
eslint-plugin-playwright
to ensue tag convention (carbon-desi…
…gn-system#15692) * feat: added playwright checker * fix: fixed ci * fix: fixed RegExp * fix: fixed name for the error in describe * fix: yarn dedupe --strategy highest * fix: fixed describe title
- Loading branch information
Showing
8 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
Binary file added
BIN
+32.9 KB
.yarn/cache/eslint-plugin-playwright-npm-0.22.1-2faafdc4a4-4833fe0c7b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
config/eslint-config-carbon/plugins/eslint-plugin-playwright.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const prefixes = [ | ||
'@avt-default-state', | ||
'@avt-advanced-states', | ||
'@avt-keyboard-nav', | ||
]; | ||
const prefixesList = prefixes.join(' | \n'); | ||
|
||
module.exports = { | ||
plugins: ['eslint-plugin-playwright'], | ||
overrides: [ | ||
{ | ||
extends: ['plugin:playwright/recommended'], | ||
files: ['*-test.avt.e2e.js'], | ||
rules: { | ||
'playwright/valid-title': [ | ||
'error', | ||
{ | ||
mustMatch: { | ||
describe: [ | ||
/^(\s*@avt(\s+\S+)*\s*)$/.source, | ||
`Describe titles should start with "@avt" prefix`, | ||
], | ||
test: [ | ||
/^(\s*(@avt-default-state||@avt-advanced-states||@avt-keyboard-nav)(\s+\S+)*\s*)$/ | ||
.source, | ||
`Test titles should start with one of the following prefixes: ${prefixesList}`, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters