Files
oxc-project__oxc/apps/oxlint/conformance/README.md
connorshea ebd2ce4cb1 test(linter/plugins): Include a repo link and SHA/version in the JS Plugin conformance markdown files. (#20606)
This also simplifies the way we track the conformance versions a bit, by centralizing the info into `repos.json`.

I know #20607 will conflict with this one, so feel free to merge whichever of these two you prefer, and then I'll resolve the conflicts afterward.

AI Disclosure: Generated with help from Claude Code.
2026-04-23 21:17:01 +00:00

1.6 KiB

Oxlint JS plugins conformance tests

Conformance tests run:

  • All ESLint's tests for its built-in rules as Oxlint JS plugins.
  • Tests from various ESLint plugins, running in Oxlint.

They do this by substituting ESLint's RuleTester for Oxlint's version, and then require()ing the test files to run the tests.

The results are saved in snapshots directory.

Setup

Build Oxlint in conformance mode:

cd apps/oxlint
pnpm install
pnpm run build-conformance

Initialize plugin submodules:

pnpm run init-conformance

Run conformance tests

pnpm run conformance

Updating a pinned repo version

All upstream repo URLs, commit SHAs, and version labels are stored in repos.json. Both init.sh and the TypeScript test groups read from this single file.

To update a repo to a newer version:

  1. Edit repos.json — update the commitSha and version for the repo.
  2. Re-initialize submodules: pnpm run init-conformance
  3. Re-run the conformance tests: pnpm run conformance
  4. Commit the updated repos.json and snapshot files.

Adding a plugin to conformance tests

  • Add an entry to repos.json with the repo's URL, commit SHA, and version.
  • Add code to init.sh to clone and set up the plugin's repo.
  • Add a file to src/groups directory (copy pattern used for other plugins).
  • Add the group to src/groups/index.ts.

Debugging

While working on adding a new plugin, you may find it useful to filter the test run, by editing conformance/src/filter.ts. You can filter by plugin name, rule, or the code of a specific test case.