Skip to content

[js] update eslint to v10 with fixes#17482

Merged
titusfortner merged 3 commits into
trunkfrom
eslint_update
May 17, 2026
Merged

[js] update eslint to v10 with fixes#17482
titusfortner merged 3 commits into
trunkfrom
eslint_update

Conversation

@titusfortner
Copy link
Copy Markdown
Member

🔗 Related Issues

#13964

💥 What does this PR do?

  • Update to eslint 10
  • Fixes problems found by new linter version

@titusfortner titusfortner requested a review from harsha509 May 16, 2026 13:46
@selenium-ci selenium-ci added C-nodejs JavaScript Bindings B-devtools Includes everything BiDi or Chrome DevTools related labels May 16, 2026
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Update ESLint to v10 with code fixes and error handling improvements

✨ Enhancement 🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Update ESLint from v9 to v10 with dependency updates
• Fix linter violations: remove unnecessary null initializations
• Add error cause context to Error constructors for better debugging
• Update package.json and lock file with new ESLint versions
Diagram
flowchart LR
  A["ESLint v9.39.4"] -->|"Update to v10.4.0"| B["ESLint v10.4.0"]
  B -->|"Trigger linter checks"| C["Code violations found"]
  C -->|"Fix null initializations"| D["Remove unnecessary null assignments"]
  C -->|"Improve error handling"| E["Add cause context to Errors"]
  D --> F["Updated source files"]
  E --> F
  F --> G["Updated package.json & lock file"]
Loading

Grey Divider

File Changes

1. javascript/selenium-webdriver/bidi/browsingContextInspector.js 🐞 Bug fix +1/-1

Remove unnecessary null variable initialization

• Remove unnecessary null initialization of response variable
• Change from let response = null to let response to comply with ESLint v10 rules

javascript/selenium-webdriver/bidi/browsingContextInspector.js


2. javascript/selenium-webdriver/common/driverFinder.js 🐞 Bug fix +2/-1

Fix Error constructor and add cause context

• Add new keyword before Error constructor call
• Add error cause context using { cause: e } parameter for better error tracking

javascript/selenium-webdriver/common/driverFinder.js


3. javascript/selenium-webdriver/common/seleniumManager.js 🐞 Bug fix +1/-1

Add error cause context to Error constructor

• Add error cause context to Error constructor using { cause: e } parameter
• Improves error debugging by preserving original exception information

javascript/selenium-webdriver/common/seleniumManager.js


View more (4)
4. javascript/selenium-webdriver/lib/http.js 🐞 Bug fix +2/-1

Fix Error constructor and add cause context

• Add new keyword before Error constructor call
• Add error cause context using { cause: ex2 } parameter for better error tracking

javascript/selenium-webdriver/lib/http.js


5. javascript/selenium-webdriver/lib/webdriver.js 🐞 Bug fix +2/-2

Remove unnecessary variable initializations

• Remove unnecessary null initialization of debuggerUrl variable
• Remove unnecessary empty string initialization of mutationListener variable
• Change from explicit null/empty assignments to uninitialized declarations

javascript/selenium-webdriver/lib/webdriver.js


6. javascript/selenium-webdriver/package.json Dependencies +2/-2

Update ESLint dependencies to v10

• Update @eslint/js from ^9.39.4 to ^10.0.1
• Update eslint from ^9.39.4 to ^10.4.0

javascript/selenium-webdriver/package.json


7. pnpm-lock.yaml Dependencies +151/-143

Update lock file with ESLint v10 and transitive dependencies

• Update ESLint v10 package versions and their dependencies
• Update @eslint/config-array from 0.21.2 to 0.23.5
• Update @eslint/config-helpers from 0.4.2 to 0.6.0
• Update @eslint/core from 0.17.0 to 1.2.1
• Update @eslint/object-schema from 2.1.7 to 3.0.5
• Update @eslint/plugin-kit from 0.4.1 to 0.7.1
• Update eslint-scope from 8.4.0 to 9.1.2
• Update eslint-visitor-keys from 4.2.1 to 5.0.1
• Update espree from 10.4.0 to 11.2.0
• Update minimatch to 10.2.5 and brace-expansion to 5.0.6
• Add @types/esrecurse dependency for type support

pnpm-lock.yaml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented May 16, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Context used

Grey Divider


Action required

1. ESLint needs newer Node 🐞 Bug ☼ Reliability
Description
javascript/selenium-webdriver/package.json still declares engines.node >= 20.0.0, but the
upgraded ESLint v10 toolchain requires Node ^20.19.0 || ^22.13.0 || >=24. This means developers
using Node 20.0–20.18 can no longer reliably install/run the repo's lint tooling after this PR.
Code

javascript/selenium-webdriver/package.json[R32-35]

+    "@eslint/js": "^10.0.1",
    "clean-jsdoc-theme": "^4.3.2",
-    "eslint": "^9.39.4",
+    "eslint": "^10.4.0",
    "eslint-config-prettier": "^10.1.8",
Evidence
The package declares Node >=20.0.0, but the lockfile shows ESLint 10 and @eslint/js 10 require Node
^20.19.0 || ^22.13.0 || >=24, creating a version range mismatch introduced by the dependency
upgrade.

javascript/selenium-webdriver/package.json[22-35]
pnpm-lock.yaml[626-633]
pnpm-lock.yaml[1984-1987]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `selenium-webdriver` workspace advertises Node support starting at `>= 20.0.0`, but ESLint 10 (and its @eslint/* dependencies) require Node `^20.19.0 || ^22.13.0 || >=24`. As a result, contributors on early Node 20.x versions will hit engine/tool execution incompatibilities when installing/running lint.

## Issue Context
This PR updates ESLint to v10, which increases minimum supported Node patch/minor versions.

## Fix Focus Areas
- javascript/selenium-webdriver/package.json[22-25]
- pnpm-lock.yaml[626-633]
- pnpm-lock.yaml[1984-1987]

## Suggested fix
- Update `javascript/selenium-webdriver/package.json` `engines.node` to match the new tooling requirements (e.g., `>=20.19.0` or the full range `^20.19.0 || ^22.13.0 || >=24`).
- If you intentionally want to keep runtime support at `>=20.0.0`, consider documenting/enforcing a higher Node version for dev tooling separately (but still ensure `pnpm install` + `npm run lint` are consistent with the declared dev requirements).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Cause/message mismatch 🐞 Bug ◔ Observability
Description
In requireAtom(), the thrown Error message reports the first failure (ex) but the
Error.cause is set to the second failure (ex2), so the message and causal chain point to
different exceptions. This can mislead debugging because logs will reference one failure while stack
traces from cause reference another.
Code

javascript/selenium-webdriver/lib/http.js[R58-63]

+      throw new Error(
        `Failed to import atoms module ${module}. If running in dev mode, you` +
          ` need to run \`bazel build ${bazelTarget}\` from the project` +
          `root: ${ex}`,
+        { cause: ex2 },
      )
Evidence
The thrown error interpolates ex in the message while setting { cause: ex2 }, which makes the
human-readable message and the causal chain inconsistent.

javascript/selenium-webdriver/lib/http.js[48-63]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`requireAtom()` wraps module import failures in a new `Error`, but currently the wrapper message interpolates `ex` while the wrapper `cause` is `ex2`. This makes the error message disagree with the exception chain.

## Issue Context
- `ex` is the failure to import from `./atoms/`.
- `ex2` is the failure to import from the Bazel output path.
- The wrapper should either:
 - use `ex2` in the message when `cause: ex2`, or
 - set `cause: ex` (or include both errors explicitly).

## Fix Focus Areas
- javascript/selenium-webdriver/lib/http.js[58-63]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 8551a19

Results up to commit 16fecad


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)


Remediation recommended
1. Cause/message mismatch 🐞 Bug ◔ Observability
Description
In requireAtom(), the thrown Error message reports the first failure (ex) but the
Error.cause is set to the second failure (ex2), so the message and causal chain point to
different exceptions. This can mislead debugging because logs will reference one failure while stack
traces from cause reference another.
Code

javascript/selenium-webdriver/lib/http.js[R58-63]

+      throw new Error(
        `Failed to import atoms module ${module}. If running in dev mode, you` +
          ` need to run \`bazel build ${bazelTarget}\` from the project` +
          `root: ${ex}`,
+        { cause: ex2 },
      )
Evidence
The thrown error interpolates ex in the message while setting { cause: ex2 }, which makes the
human-readable message and the causal chain inconsistent.

javascript/selenium-webdriver/lib/http.js[48-63]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`requireAtom()` wraps module import failures in a new `Error`, but currently the wrapper message interpolates `ex` while the wrapper `cause` is `ex2`. This makes the error message disagree with the exception chain.

## Issue Context
- `ex` is the failure to import from `./atoms/`.
- `ex2` is the failure to import from the Bazel output path.
- The wrapper should either:
 - use `ex2` in the message when `cause: ex2`, or
 - set `cause: ex` (or include both errors explicitly).

## Fix Focus Areas
- javascript/selenium-webdriver/lib/http.js[58-63]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit a2ec93c


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)


Action required
1. ESLint needs newer Node 🐞 Bug ☼ Reliability
Description
javascript/selenium-webdriver/package.json still declares engines.node >= 20.0.0, but the
upgraded ESLint v10 toolchain requires Node ^20.19.0 || ^22.13.0 || >=24. This means developers
using Node 20.0–20.18 can no longer reliably install/run the repo's lint tooling after this PR.
Code

javascript/selenium-webdriver/package.json[R32-35]

+    "@eslint/js": "^10.0.1",
    "clean-jsdoc-theme": "^4.3.2",
-    "eslint": "^9.39.4",
+    "eslint": "^10.4.0",
    "eslint-config-prettier": "^10.1.8",
Evidence
The package declares Node >=20.0.0, but the lockfile shows ESLint 10 and @eslint/js 10 require Node
^20.19.0 || ^22.13.0 || >=24, creating a version range mismatch introduced by the dependency
upgrade.

javascript/selenium-webdriver/package.json[22-35]
pnpm-lock.yaml[626-633]
pnpm-lock.yaml[1984-1987]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `selenium-webdriver` workspace advertises Node support starting at `>= 20.0.0`, but ESLint 10 (and its @eslint/* dependencies) require Node `^20.19.0 || ^22.13.0 || >=24`. As a result, contributors on early Node 20.x versions will hit engine/tool execution incompatibilities when installing/running lint.

## Issue Context
This PR updates ESLint to v10, which increases minimum supported Node patch/minor versions.

## Fix Focus Areas
- javascript/selenium-webdriver/package.json[22-25]
- pnpm-lock.yaml[626-633]
- pnpm-lock.yaml[1984-1987]

## Suggested fix
- Update `javascript/selenium-webdriver/package.json` `engines.node` to match the new tooling requirements (e.g., `>=20.19.0` or the full range `^20.19.0 || ^22.13.0 || >=24`).
- If you intentionally want to keep runtime support at `>=20.0.0`, consider documenting/enforcing a higher Node version for dev tooling separately (but still ensure `pnpm install` + `npm run lint` are consistent with the declared dev requirements).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

Copy link
Copy Markdown
Member

@harsha509 harsha509 left a comment

Choose a reason for hiding this comment

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

LGTM!

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented May 16, 2026

Persistent review updated to latest commit a2ec93c

Comment thread javascript/selenium-webdriver/package.json
@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented May 16, 2026

Persistent review updated to latest commit 8551a19

@titusfortner titusfortner merged commit d5f44d0 into trunk May 17, 2026
27 checks passed
@titusfortner titusfortner deleted the eslint_update branch May 17, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-devtools Includes everything BiDi or Chrome DevTools related C-nodejs JavaScript Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants