Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,13 @@ async function init() {

// Render ESLint config
if (needsEslint) {
renderEslint(root, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier })
renderEslint(root, {
needsTypeScript,
needsCypress,
needsCypressCT,
needsPrettier,
needsPlaywright
})
}

// Render code template.
Expand Down
3 changes: 2 additions & 1 deletion template/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"devDependencies": {
"eslint-plugin-cypress": "^2.15.1"
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-playwright": "^0.21.0"
}
}
13 changes: 12 additions & 1 deletion utils/renderEslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const eslintDeps = eslintTemplatePackage.devDependencies

export default function renderEslint(
rootDir,
{ needsTypeScript, needsCypress, needsCypressCT, needsPrettier }
{ needsTypeScript, needsCypress, needsCypressCT, needsPrettier, needsPlaywright }
) {
const additionalConfig: Linter.Config = {}
const additionalDependencies = {}
Expand All @@ -35,6 +35,17 @@ export default function renderEslint(
additionalDependencies['eslint-plugin-cypress'] = eslintDeps['eslint-plugin-cypress']
}

if (needsPlaywright) {
additionalConfig.overrides = [
{
files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'],
extends: ['plugin:playwright/recommended']
}
]

additionalDependencies['eslint-plugin-playwright'] = eslintDeps['eslint-plugin-playwright']
}

const { pkg, files } = createESLintConfig({
vueVersion: '3.x',
// we currently don't support other style guides
Expand Down