Skip to content

chore: migrate from eslint to oxlint#2493

Merged
B4nan merged 4 commits intomasterfrom
chore/migrate-to-oxlint
May 5, 2026
Merged

chore: migrate from eslint to oxlint#2493
B4nan merged 4 commits intomasterfrom
chore/migrate-to-oxlint

Conversation

@B4nan
Copy link
Copy Markdown
Member

@B4nan B4nan commented May 4, 2026

Summary

Replaces ESLint with oxlint, pulling in the shared @apify/oxlint-config preset and oxlint-tsgolint for type-aware rules. Mirrors the migration already shipped in apify-storage-local-js, apify-shared-js, apify-core, apify-client-js, apify-sdk-js, and actor-scraper.

What changed

  • Drop eslint, typescript-eslint, eslint-plugin-react, eslint-plugin-yml, globals, @apify/eslint-config
  • Add oxlint@1.62.0, oxlint-tsgolint@0.22.0, @apify/oxlint-config@^0.2.5
  • Replace eslint.config.mjs with oxlint.config.ts; drop unused tsconfig.eslint.json
  • lint:code / lint:code:fix now run oxlint --type-aware
  • Drop the YAML-specific lint script (openapi:lint:yaml) and its CI step — Redocly + Spectral already validate the OpenAPI spec; oxlint doesn't lint YAML, and we don't want eslint hanging around just for style nits on YAML files
  • Bump @apify/tsconfig to ^0.1.2 and add module: Node16 / moduleResolution: Node16 so oxlint-tsgolint can parse the project
  • Disable typescript/no-floating-promises and typescript/promise-function-async repo-wide — the React event handlers in apify-docs-theme/ intentionally fire-and-forget
  • Ignore examples/ in oxlint (each example has its own tsconfig with its own bundler settings)

Lint output

```
$ pnpm lint:code
Found 0 warnings and 0 errors.
Finished in 312ms on 132 files with 113 rules using 14 threads.
```

Test plan

  • `pnpm lint:code` — clean
  • `pnpm openapi:lint` — clean (Redocly + Spectral; YAML-style step dropped)

Replaces ESLint with oxlint, pulling in the shared `@apify/oxlint-config`
preset and `oxlint-tsgolint` for type-aware rules. Mirrors the migration
already shipped in apify-storage-local-js, apify-shared-js, apify-core,
apify-client-js, apify-sdk-js, and actor-scraper.

- Drop `eslint`, `typescript-eslint`, `eslint-plugin-react`,
  `eslint-plugin-yml`, `globals`, `@apify/eslint-config`
- Add `oxlint@1.62.0`, `oxlint-tsgolint@0.22.0`, `@apify/oxlint-config@^0.2.5`
- Replace `eslint.config.mjs` with `oxlint.config.ts`; drop unused
  `tsconfig.eslint.json`
- `lint:code` / `lint:code:fix` now run `oxlint --type-aware`
- Drop the YAML-specific lint script (`openapi:lint:yaml`) and its CI
  step — Redocly + Spectral already validate the OpenAPI spec; oxlint
  doesn't lint YAML, and we don't want eslint hanging around just for
  style nits on YAML files
- Bump `@apify/tsconfig` to ^0.1.2 and add `module: Node16` /
  `moduleResolution: Node16` so oxlint-tsgolint can parse the project
- Disable `typescript/no-floating-promises` and
  `typescript/promise-function-async` repo-wide — the React event
  handlers in `apify-docs-theme/` intentionally fire-and-forget
- Ignore `examples/` in oxlint (each example has its own tsconfig with
  its own bundler settings)
@github-actions github-actions Bot added this to the 140th sprint - Tooling team milestone May 4, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label May 4, 2026
@B4nan B4nan mentioned this pull request May 4, 2026
2 tasks
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label May 4, 2026
B4nan added 3 commits May 4, 2026 16:07
Restores the YAML-only eslint setup and CI step. The eslint config now
exists solely to lint apify-api/**/*.yaml via eslint-plugin-yml — all
JS/TS linting is on oxlint.
pnpm forwards args directly to the underlying command and treats the
leading `--` as a literal argument, so the previous form was passing an
extra `--` token to redocly/spectral. Same fix as apify/fingerprint-suite#539.
@B4nan B4nan requested a review from barjin May 4, 2026 15:15
Copy link
Copy Markdown
Member

@barjin barjin left a comment

Choose a reason for hiding this comment

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

One small nit (but I see it's being touched upon in the PR description as well).

Otherwise, lgtm, thank you!

Comment thread package.json
"openapi:lint:redocly": "redocly lint apify-api/openapi/openapi.yaml",
"openapi:lint:spectral": "spectral lint apify-api/openapi/openapi.yaml",
"openapi:lint:yaml": "eslint 'apify-api/**/*.yaml'",
"openapi:lint:yaml:fix": "eslint 'apify-api/**/*.yaml' --fix",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems we're dropping yaml linting without a replacement (also see ignorePatterns in oxlint.config.ts. Is this intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, oxlint doesn't support yaml, and using that old eslint plugin through oxlint would mean bringing the whole eslint dependency here for a very low benefit. we will adopt oxfmt right afterward, which will format yaml, i dont think we need a linter for it.

@B4nan B4nan merged commit eeb0bb4 into master May 5, 2026
15 checks passed
@B4nan B4nan deleted the chore/migrate-to-oxlint branch May 5, 2026 06:38
B4nan added a commit that referenced this pull request May 5, 2026
## Summary

Adds [oxfmt](https://oxc.rs/docs/guide/usage/formatter) as the
formatter, matching the toolchain in apify-storage-local-js,
apify-shared-js, apify-core, apify-web, apify-client-js, apify-sdk-js,
actor-scraper, and crawlee v4. The repo had no formatter before — this
is a fresh adoption.

Stacked on top of #2493 (eslint→oxlint migration). Will be retargeted to
\`master\` once the parent merges.

### Commits

- \`chore: add oxfmt tooling\` — adds \`oxfmt@0.46.0\` devDep,
\`.oxfmtrc.json\` (4-space tabs, single quotes, 120 col), and \`format\`
/ \`format:check\` scripts
- \`chore: apply oxfmt formatting\` — pure \`oxfmt --write\` reformat
across 219 files (mostly \`.css\`, \`.html\`, \`.js\`/\`.jsx\`,
\`.ts\`/\`.tsx\`, \`.mjs\`)
- \`ci: add format-check step\` — gates the lint job on \`pnpm
format:check\`

## Test plan

- [x] \`pnpm lint:code\` — clean
- [x] \`pnpm format:check\` — clean

## Follow-up

Once this lands, add the reformat commit SHA to
\`.git-blame-ignore-revs\` so blame skips it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants