Repository navigation
chore(packages/runner): migrate to @packages/eslint-config - #35175
Merged
Merged
Conversation
Move @packages/runner onto the shared ESLint 9 flat config, with jsonConfig, and drop its .eslintignore and injection/.eslintrc.json. The window/parent globals are now scoped to injection/**, and the generated *.scss.d.ts typings stay ignored. - Rewrite the three return-in-finally blocks in the cross-origin fetch/XHR patches as try/catch followed by the call. Errors from Cypress's own bookkeeping are still swallowed so the request goes out, and errors from the original fetch/open/send still propagate. - Turn @ts-ignore into described @ts-expect-error, deleting the three in webpack.config.ts that no longer suppressed anything. - Apply prefer-const and stylistic autofixes, and reorder package.json keys per jsonConfig. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r24y62FhjfjSRy1R2V
- web-config: check the getCommonConfig/getSimpleConfig literals and the sass rule with `satisfies`, so fields like enforce and resolve.fallback keep their literal types and the configs assign to webpack.Configuration without suppression. - driver types: add 'request:sent:with:credentials' to Cypress.Backend. - runner: narrow the babel-loader lookup with flatMap instead of lodash. One @ts-expect-error remains, on the prism plugin push, since the babel plugins array is typed from web-config's own entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r24y62FhjfjSRy1R2V
cypress
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
eslint/r13-runner
|
| Run status |
|
| Run duration | 17m 03s |
| Commit |
|
| Committer | Claude |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
13
|
|
|
1036
|
|
|
0
|
|
|
30034
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
67.12%
|
|
|---|---|
|
|
24
|
|
|
49
|
Accessibility
98.98%
|
|
|---|---|
|
|
0 critical
3 serious
2 moderate
0 minor
|
|
|
18
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r24y62FhjfjSRy1R2V
jennifer-shehane
pushed a commit
that referenced
this pull request
Oct 27, 2026
#35175 typed getCommonConfig() with `satisfies webpack.Configuration`, so `mode` is no longer inferred as `string` and the directive on the reporter's config is unused. webpack-cli type-checks the config, so the stale directive failed build-for-tests with TS2578. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r3jb5WdjcbUvWd3r8b
jennifer-shehane
added a commit
that referenced
this pull request
Oct 27, 2026
* chore: migrate @packages/reporter to @packages/eslint-config Move @packages/reporter to the shared ESLint 9 flat config, with jsonConfig so package.json keeps being linted. - Add eslint.config.ts (baseConfig + jsonConfig) and drop .eslintrc.json, .eslintignore and cypress/.eslintrc.json. The cypress and mocha globals those files enabled come from the shared config's eslint-plugin-cypress and eslint-plugin-mocha presets. The cypress/fixtures ignore carries over, and the old **/*.d.ts ignore narrows to the generated *.scss.d.ts typings, so index.d.ts is linted now. tailwind.config.js gets the __dirname global the old node env provided. - Add @packages/eslint-config, eslint and jiti devDependencies, a plain `eslint` lint script and a per-package lint-staged key. The first `--fix` reordered package.json top-level keys, as jsonConfig expects. - Drop the tslint script from check-ts and port its no-floating-promises rule as @typescript-eslint/no-floating-promises over the files tsconfig.json covers (src/** and cypress/**/*.ts). Cypress chainables are not flagged. - Add the package to the root lint:fix scope. - Turn every @ts-ignore into @ts-expect-error with a reason, as ban-ts-comment requires. Nine directives suppressed nothing and were removed. - Fix the React rules the old config never loaded here: escape the quotes in runnable-header, type the children prop in tag.cy.tsx, and add rel='noreferrer' to the external docs link in runnables.tsx. - Tick the package off in guides/eslint-migration.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r3jb5WdjcbUvWd3r8b * chore: replace reporter @ts-expect-error directives with type-safe code Address review of the @packages/reporter ESLint migration. - hook-model: return a boolean from the filter predicate so it matches lodash's overloads. - attempt-model: narrow LogProps with an `in` check for sessionInfo, and bind this.err to a local so the guard's narrowing reaches the callback. - shortcuts: guard isTextLike with $dom.isElement. It checks nodeType, so unlike `instanceof HTMLElement` it holds for targets from the reporter's iframe document, which the shortcuts are also bound to. - Spec directive reasons named the fixtures as the source of the optional types; they come from the specs' own RootRunnable and Partial<Err> declarations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r3jb5WdjcbUvWd3r8b * chore: drop reporter webpack @ts-expect-error fixed upstream #35175 typed getCommonConfig() with `satisfies webpack.Configuration`, so `mode` is no longer inferred as `string` and the directive on the reporter's config is unused. webpack-cli type-checks the config, so the stale directive failed build-for-tests with TS2578. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r3jb5WdjcbUvWd3r8b * chore: type reporter code instead of suppressing with @ts-expect-error Replace eight @ts-expect-error directives with code that type-checks. None changes runtime behavior. - webpack.config.ts: spread `config.plugins ?? []`, since Configuration types plugins as optional. - err-model: declare codeFrame optional. It is undefined until update() sets it, which the type now says. - switch: type onUpdate and the click handler with React's MouseEvent, which is what onClick passes. No caller reads the event. - Specs: keep the spy cy.spy() returns and call withArgs on it, rather than on runner.emit, whose EventEmitter type has no withArgs. - runnables_store spec: the requestAnimationFrame stub passes a timestamp and returns a request ID, matching the DOM signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r3jb5WdjcbUvWd3r8b --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
guides/eslint-migration.md.Additional details
This PR moves
@packages/runneronto the shared flat config. It's two commits, and the second one can be dropped on its own if you'd rather keep this PR runner-only.1. Migration (
ee67320)eslint.config.tswithbaseConfig,jsonConfigandtsconfigRootDir. Thewindow/parentglobals frominjection/.eslintrc.jsonare now scoped toinjection/**, and the generated*.scss.d.tstypings stay ignored. The handwrittenindex.d.tslints clean, so the old blanket**/*.d.tsignore is gone.package.jsongets the eslint,@packages/eslint-configandjitidevDependencies,"lint": "eslint"and alint-stagedkey.jsonConfigalso reordered the top-level keys, which is expected. Runner is added to the rootlint:fixscope and ticked off in the guide.no-unsafe-finally(3 sites in the cross-originfetch/XHR patches): eachreturninsidefinallyis nowtry { … } catch {}followed by the call. Errors from our own bookkeeping are still swallowed so the user's request goes out, and errors thrown by the originalfetch/open/sendstill propagate, exactly as before.ban-ts-comment: each@ts-ignorebecame@ts-expect-error - <reason>. Three of them inwebpack.config.tsno longer suppressed anything, so they're deleted.prefer-const: this is new since chore: enable prefer-const in the shared ESLint flat config #35169. Two late-assignedlets becameconstwhere they're assigned. That's safe because the closures that read them can't run before that line.tslintstays incheck-ts, matchingerrorsandlauncher.2. Types instead of suppressions (
3ec7bf2)packages/web-config: thegetCommonConfig/getSimpleConfigliterals and the sass rule now usesatisfies webpack.Configuration/RuleSetRule, so fields likeenforceandresolve.fallbackkeep their literal types. That removes four suppressions in runner. The exported shapes don't change otherwise, andreporterstill type-checks and builds.packages/driver/types: addsrequest:sent:with:credentialstoCypress.Backend. The server onlyemits for it, so it returnsPromise<void>.flatMapinstead oflodash.find.@ts-expect-errorremains, on the prism pluginpush. The babelpluginsarray is typed from web-config's own entries, and typing it properly means restructuringgetCommonConfig.Steps to test
yarn lint --scope @packages/runneryarn check-ts --scope @packages/runner --scope @packages/reporter --scope @packages/web-configyarn health-check(needs a built tree, because knip loads runner's webpack config, which waits onicons/dist)yarn workspace @packages/runner build: the bundle still includes the prism plugin outputRunner has no unit tests of its own (they moved to
@packages/app). The cross-origin patch behavior is exercised bypackages/driver/cypress/e2e/e2e/origin/patches.cy.tsin CI.How has the user experience changed?
No change.
PR Tasks
cypress-documentation?type definitions? The only type change is in the driver's internal types.Generated by Claude Code
Note
Low Risk
Mechanical lint migration with intentional control-flow refactors in cross-origin patches that preserve “don’t block the user request” behavior; no user-facing API changes.
Overview
Migrates
@packages/runnerto ESLint 9 flat config (eslint.config.tswith sharedbaseConfig/jsonConfig), drops legacy.eslintignoreand injection.eslintrc.json(globals scoped toinjection/**), and wireslint-staged,eslint,jiti, and rootlint:fixscope. The migration checklist marks runner complete.Lint-driven code fixes in runner: cross-origin fetch/XHR patches replace
no-unsafe-finallyfinally+returnwithtry/catchso internal bookkeeping errors still don’t block user requests;prefer-constand formatting tweaks in injection utils/timers/cookies.Supporting typing cleanup (no intended runtime change):
packages/web-configusessatisfies webpack.Configurationon shared webpack helpers so runner’swebpack.config.tsdrops most@ts-ignoreand narrows babel-loader lookup without lodash;Cypress.Backendgainsrequest:sent:with:credentialsso runner can callCypress.backendwithout suppressions.Reviewed by Cursor Bugbot for commit 193dba2. Bugbot is set up for automated code reviews on this repo. Configure here.