Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: eslint plugin playwright #433

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

georgi-mateev
Copy link
Contributor

Re #422

  • Add eslint-plugin-playwright in /template/eslint/package.json
  • Update index.ts > pass playwright option to renderEslint function
  • Add logic for extending eslint with eslint-plugin-playwright plugin
    "extends": ["plugin:playwright/recommended"]

@Yordan-Ramchev
Copy link
Contributor

Nice one @georgi-mateev
Could you guys provide us with feedback @sodatea @cexbrayat

@@ -35,6 +35,11 @@ export default function renderEslint(
additionalDependencies['eslint-plugin-cypress'] = eslintDeps['eslint-plugin-cypress']
}

if (needsPlaywright) {
additionalConfig.extends = ['plugin:playwright/recommended']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the plugin apply only the Playwright files (as done for Cypress above)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, ESLint will apply the rules defined in the root of your configuration to all files in your project (which is not ideal).
@georgi-mateev Can you target e2e folder - something like files: ['e2e/**/*.{js,ts,jsx,tsx}']?

@georgi-mateev
Copy link
Contributor Author

@cexbrayat, @Yordan-Ramchev Thanks for the feedback and the help, appreciate it!

Changes

Plugin now only applies to specified files -
eslint-plugin

Regarding files we think its versatile enough to target files having either .test. or .spec. signature both in the the main folder and its subfolders, if any.

Copy link
Contributor

@Yordan-Ramchev Yordan-Ramchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good

Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @georgi-mateev 👍

@cexbrayat cexbrayat merged commit 54964cd into vuejs:main Feb 5, 2024
101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants