Skip to content

Add ESLint v10 support to hermes-eslint#1926

Open
JasonWeinzierl wants to merge 10 commits intofacebook:static_hfrom
JasonWeinzierl:eslint10
Open

Add ESLint v10 support to hermes-eslint#1926
JasonWeinzierl wants to merge 10 commits intofacebook:static_hfrom
JasonWeinzierl:eslint10

Conversation

@JasonWeinzierl
Copy link
Copy Markdown

@JasonWeinzierl JasonWeinzierl commented Mar 4, 2026

Summary

Add support to hermes-eslint for ESLint v10.

  1. Added support for ScopeManager.addGlobals().
  2. Added eslint to hermes-eslint's peer dependencies as optional, for documenting supported versions.
  3. Migrated the internal eslint config to the flat config instead of eslintrc.
    • Several incompatible plugins were swapped out for their updated forks (ft-flow and eslint-comments).
    • Upgraded the internal eslint version to v9. Cannot go to v10 because some plugins use APIs not available in v10 (e.g. context.getSourceCode()). For example, feat!: ESLint v10 and flat config support flow-typed/eslint-plugin-ft-flow#71 recursively needs hermes-eslint to be upgraded first.
    • Installed @eslint/js as a defensive measure: eslint v10 will require this to be installed.
  4. Updated README of hermes-eslint with flat config example.

Note: it would be nice to see #1651 merged, since these packages published on npm do not display links to this repository, so it took me a minute to find this.

Test Plan

Ran the following commands:

# (first I set up the repository and built the wasm, then I did the following)
cd tools/hermes-parser/js
yarn install
yarn build ../../../build-wasm/bin/hermes-parser-wasm.js ../../../include
yarn test
yarn lint
yarn format

Build, test, and lint passes.

Demonstration of peer dependency compatibility: https://github.com/JasonWeinzierl/hermes-eslint-compatibility-test

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 4, 2026
@tmikov tmikov requested a review from gkz March 6, 2026 19:49
@gkz
Copy link
Copy Markdown
Member

gkz commented Mar 6, 2026

Hi @JasonWeinzierl, thanks for your work! We will take a look at this, though we will need to confirm that nothing breaks internally.

@JasonWeinzierl
Copy link
Copy Markdown
Author

Rebased onto static_h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants