-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Added eslint-plugin-playwright linting to e2e package #25344
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
base: main
Are you sure you want to change the base?
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe PR updates the e2e testing configuration to add Playwright ESLint support and related dev dependencies. e2e/.eslintrc.js adds the eslint-plugin-playwright and an overrides block applying Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-10-09T17:25:12.439ZApplied to files:
📚 Learning: 2025-07-19T21:18:10.726ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25344 +/- ##
==========================================
+ Coverage 72.08% 72.10% +0.01%
==========================================
Files 1515 1515
Lines 115137 115104 -33
Branches 13791 13781 -10
==========================================
- Hits 83002 82995 -7
+ Misses 31119 31114 -5
+ Partials 1016 995 -21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
e2e/.eslintrc.js (1)
3-6: Consider using the conventional short form for the plugin name.While
'eslint-plugin-playwright'works, ESLint convention is to use the short form'playwright'when the plugin package is namedeslint-plugin-playwright.Apply this diff for consistency with ESLint conventions:
plugins: [ 'ghost', - 'eslint-plugin-playwright' + 'playwright' ],
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (3)
e2e/.eslintrc.js(1 hunks)e2e/package.json(1 hunks)e2e/tests/.eslintrc.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
End-to-end tests should live under the e2e/ directory (Playwright-based)
Files:
e2e/package.json
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to e2e/** : End-to-end tests should live under the e2e/ directory (Playwright-based)
Learnt from: kevinansfield
Repo: TryGhost/Ghost PR: 24651
File: ghost/core/test/utils/urlUtils.js:53-57
Timestamp: 2025-08-11T19:39:00.428Z
Learning: In Ghost's test utilities, when fixing specific issues like async behavior, it's preferred to maintain existing error handling patterns (even if suboptimal) to keep PRs focused on their primary objective. Error handling improvements can be addressed in separate, dedicated PRs.
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-10-15T07:53:49.814Z
Learning: Run yarn lint, yarn test, and validate in Storybook before opening a PR; always run yarn lint to fix ESLint issues before committing
📚 Learning: 2025-10-09T17:25:12.439Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to e2e/** : End-to-end tests should live under the e2e/ directory (Playwright-based)
Applied to files:
e2e/tests/.eslintrc.jse2e/.eslintrc.js
📚 Learning: 2025-08-11T19:39:00.428Z
Learnt from: kevinansfield
Repo: TryGhost/Ghost PR: 24651
File: ghost/core/test/utils/urlUtils.js:53-57
Timestamp: 2025-08-11T19:39:00.428Z
Learning: In Ghost's test utilities, when fixing specific issues like async behavior, it's preferred to maintain existing error handling patterns (even if suboptimal) to keep PRs focused on their primary objective. Error handling improvements can be addressed in separate, dedicated PRs.
Applied to files:
e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/**/*.ts : Test suite titles should follow: 'Ghost Admin - Feature' or 'Ghost Public - Feature'
Applied to files:
e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/**/*.ts : Follow ADR-0001 (AAA pattern) in all test files
Applied to files:
e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/{tests,helpers/pages}/**/*.ts : Use only semantic locators (getByRole/getByLabel/getByText); fallback to data-testid; never use CSS/XPath/nth-child/class names
Applied to files:
e2e/tests/.eslintrc.js
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: After changes, run `yarn lint` and `yarn test:types`
Applied to files:
e2e/tests/.eslintrc.jse2e/package.json
📚 Learning: 2025-10-08T14:20:28.632Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-10-08T14:20:28.632Z
Learning: Applies to e2e/tests/**/*.ts : Keep all assertions in test files (not in page objects)
Applied to files:
e2e/tests/.eslintrc.js
📚 Learning: 2025-10-15T07:53:49.814Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-10-15T07:53:49.814Z
Learning: Applies to apps/shade/test/unit/**/*.test.@(ts|tsx|js) : Unit tests live under test/unit with *.test.(ts|tsx|js) naming
Applied to files:
e2e/tests/.eslintrc.js
📚 Learning: 2025-08-01T12:44:07.467Z
Learnt from: niranjan-uma-shankar
Repo: TryGhost/Ghost PR: 24557
File: apps/admin-x-settings/src/components/settings/general/TimeZone.tsx:7-7
Timestamp: 2025-08-01T12:44:07.467Z
Learning: In Ghost development, PRs may depend on unpublished changes from SDK packages. When this occurs, TypeScript compilation errors for missing exports are expected and documented in the PR description until the dependency packages are published and updated. This is normal workflow for cross-repository feature development.
Applied to files:
e2e/package.json
📚 Learning: 2025-08-26T16:47:28.150Z
Learnt from: troyciesco
Repo: TryGhost/Ghost PR: 24749
File: ghost/core/core/server/services/members/SingleUseTokenProvider.js:3-5
Timestamp: 2025-08-26T16:47:28.150Z
Learning: When checking for dependencies in Ghost project, ensure to look directly in the specific package.json files rather than relying only on automated searches, as otplib dependency exists at line 204 in ghost/core/package.json version "12.0.1"
Applied to files:
e2e/package.json
📚 Learning: 2025-08-12T18:33:15.524Z
Learnt from: cmraible
Repo: TryGhost/Ghost PR: 24658
File: ghost/admin/package.json:3-3
Timestamp: 2025-08-12T18:33:15.524Z
Learning: In Ghost's admin package.json, third-party packages like ember-cli-postcss, ember-exam, and ember-power-select have their own independent versioning schemes that are unrelated to Ghost's version numbers. Version number coincidences between Ghost versions and these packages should not trigger update suggestions.
Applied to files:
e2e/package.json
📚 Learning: 2025-10-09T17:25:12.439Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-09T17:25:12.439Z
Learning: Applies to ghost/core/config.development.json : Add Tinybird configuration to ghost/core/config.development.json for local development
Applied to files:
e2e/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cursor Bugbot
🔇 Additional comments (4)
e2e/package.json (2)
33-33: LGTM - eslint-plugin-playwright added as expected.The addition of
eslint-plugin-playwrightaligns with the PR objectives to enable Playwright linting for the e2e test suite.
27-29: Dependencies are actively used throughout the e2e infrastructure.Verification confirms all three dependencies are imported and utilized across multiple e2e helper files:
@tryghost/debugis used in 10 files for debug logging (baseDebug pattern)@tryghost/loggingis used in 7 e2e files for logging operations@types/dockerodeis needed for TypeScript types (Container, ContainerCreateOptions) imported in DockerCompose.ts, GhostManager.ts, and MySQLManager.tsThese additions are necessary for the e2e test infrastructure and are correctly included in the dependencies.
e2e/.eslintrc.js (1)
17-22: LGTM - overrides configuration is well-structured.The overrides block correctly applies
plugin:playwright/recommendedto the appropriate test-related paths (tests, helpers/playwright, helpers/pages), which aligns with the PR objectives.e2e/tests/.eslintrc.js (1)
8-29: LGTM - Mocha rules appropriately disabled for Playwright.The comprehensive disabling of Mocha-specific rules makes sense since the e2e package uses Playwright instead of Mocha. The explanatory comment clearly documents the rationale, which will help future maintainers understand this configuration choice.
no issue
This PR does two things in the e2e package:
eslint-plugin-playwrightfor our e2e test suite using the recommended configurationNote: If you run
yarn lintin the e2e package in this PR, you'll see a bunch of warnings. I'd like to tackle some of these in follow up PRs, and potentially change a few rules from "warn" to "error" for the more impactful ones.Note
Enables
eslint-plugin-playwrightwith recommended config for e2e and disables Mocha-specific rules; adds the Playwright ESLint plugin dependency.playwrightplugin and applyplugin:playwright/recommendedine2e/.eslintrc.jsfortests/**,helpers/playwright/**, andhelpers/pages/**.ghost/mocha/*rules ine2e/tests/.eslintrc.jsto avoid Mocha-specific linting in Playwright tests.eslint-plugin-playwrighttoe2e/package.jsonand updateyarn.lock.Written by Cursor Bugbot for commit ecc930a. This will update automatically on new commits. Configure here.