Repository navigation
npm audit fix, replace eslint-plugin-playwright with our own rule - #3441
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
I have a robot looking for any other huge dependencies we could eliminate entirely by writing 30 lines of code. |
This branch was successfully deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npm audit fix
The first commit clears everything
npm auditreported, all of it in dev tooling or the mock API. Two things went beyond a plainnpm audit fix:@vitest/browser-playwrightare bumped to 5.1.0 inpackage.json. The vitest packages pin each other as exact peer dependencies, so npm couldn't update them in place and they had to be reinstalled together.proxy-addrsaid 2.0.7 but had the tarball URL and integrity hash of 2.0.8, so the fixed version was already installed and only the version field was wrong.Our own Playwright lint rule
One of the audit findings was in eslint, which we never run: eslint-plugin-playwright requires it as a peer dependency. The plugin is maintained, but we only used one rule from it,
expect-expect, which is about 30 lines of logic upstream. The second commit replaces it with a local oxlint plugin intools/oxlint-plugin-playwright.ts, which lets us drop eslint entirely: 66 packages and about 850 lines come out of the lockfile.To check it's as good as before, I ran the old and new rule over
test/e2eand they flagged the same tests: none, plus the five indisks.e2e.tsthat were behind a disable comment. We also checked with temporary specs that a test with no assertions is flagged and that tests using onlyexpect.pollor a helper likeexpectRowVisibleare not.It's better than before in a few ways, and easy to keep customizing:
beforeEach/afterEachcount, so the disable comment indisks.e2e.tsis gone.expectcounts as an assertion, so we no longer keep a list of helper names in.oxlintrc.json.no-focused-test(test.only) andno-page-route(use a sentinel in the mock API, notpage.route).A comment in the plugin lists four more rules we plan to add once existing violations are cleaned up. This PR also deletes 13 disable comments for playwright rules that were never enabled.