Skip to content

eslint: initial integration#15458

Open
rootvector2 wants to merge 1 commit into
google:masterfrom
rootvector2:eslint-integration
Open

eslint: initial integration#15458
rootvector2 wants to merge 1 commit into
google:masterfrom
rootvector2:eslint-integration

Conversation

@rootvector2
Copy link
Copy Markdown
Contributor

Adds an OSS-Fuzz integration for ESLint (https://eslint.org/), the AST-based pattern checker for JavaScript.

Three fuzz targets cover the public API surface that the project itself documents:

  • fuzz_linterLinter.verify with varied ECMA versions, source types, parser feature flags, and a randomised subset of rules so the fuzzer drives which rules get co-enabled rather than running them all every iteration.
  • fuzz_verify_and_fixLinter.verifyAndFix restricted to fixable rules, to exercise the autofix loop and overlapping-fix path.
  • fuzz_source_code — post-parse SourceCode helpers (tokens, comments, getLocFromIndex, getScope, getAncestors).

@jazzer.js/core is pinned to 2.1.0 — the prebuilt native fuzzer in 4.x requires GLIBC 2.32, which the Ubuntu 20.04 base-runner doesn't provide. There's a comment in build.sh next to the pin.

Upstream tracking issue (asking ESLint maintainers to confirm the primary contact and to LGTM here): filed alongside this PR.

Test plan

Tested locally against the cloned upstream master of eslint/eslint:

  • python3 infra/helper.py build_image eslint
  • python3 infra/helper.py build_fuzzers eslint
  • python3 infra/helper.py check_build eslint — passes for all three targets
  • python3 infra/helper.py run_fuzzer eslint fuzz_linter — coverage growth, no crashes
  • python3 infra/helper.py run_fuzzer eslint fuzz_verify_and_fix — coverage growth, no crashes
  • python3 infra/helper.py run_fuzzer eslint fuzz_source_code — coverage growth, no crashes
  • python3 infra/presubmit.py format and license pass

Adds three Jazzer.js fuzz targets for the public ESLint API:
- fuzz_linter: drives Linter.verify with varied ECMA versions, source
  types, and a randomised subset of rules
- fuzz_verify_and_fix: drives Linter.verifyAndFix to exercise the
  autofix loop and overlapping-fix path
- fuzz_source_code: exercises post-parse SourceCode helpers
  (tokens, comments, location/scope lookups)

@jazzer.js/core is pinned to 2.1.0 because the prebuilt native fuzzer
in 4.x requires GLIBC 2.32, which the Ubuntu 20.04 base-runner does
not provide.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

rootvector2 is integrating a new project:
- Main repo: https://github.com/eslint/eslint
- Criticality score: 0.70947

Copy link
Copy Markdown
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

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

Project is good.

However, can we land the harnesses upstream? I think this is important with javascript from a perspective it's still relatively new and it would be good to have maintainers validation from building/running these and get a signal of value.

We also await maintainer coordination and acceptance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants