Files
Martin Adámek 1640c401c1 chore: migrate from eslint/biome to oxlint/oxfmt (#3569)
Replaces ESLint + Biome with Oxlint + Oxfmt, modeled after [mikro-orm's
setup](https://github.com/mikro-orm/mikro-orm). Type-aware linting is
enabled via `oxlint-tsgolint` and the `--type-aware` flag. Lint + format
coverage spans `packages`, `test`, and `docs`.

- **`@apify/tsconfig` bumped to `^0.1.2`** — that release
(apify/apify-tsconfig#3, apify/apify-tsconfig#4) drops the deprecated
`importsNotUsedAsValues` option that `tsgolint` refuses to parse. No
local patch needed anymore.
- **Root tsconfigs drop `baseUrl`** — `tsgolint` removed support for it.
Non-relative imports under `test/*` and the one stray `packages/*`
import in `memory-storage` were converted to relative paths so the
mappings could be removed entirely.
- **Rules that were triggering across existing code** are fully enabled
as errors now. Violations fall into two buckets:
- Real issues fixed in-place (dead code after `throw`, `let`→`const`,
unnecessary template expressions, `.match` → `RegExp#exec`, `stream` →
`node:stream`, deprecated `z.ZodSchema` → `z.ZodType`).
- Patterns the rule flags pessimistically but that are correct
(`Promise.all(arr.map(fn))` where `fn` returns `Awaitable<void>`) —
fixed by marking the inner arrow `async`.
- **`typescript/no-deprecated` stays at `warn`** — we intentionally use
our own deprecated APIs in implementation code (`pseudoUrls`,
`experiments.requestLocking` opt-out, puppeteer page-level
cookies/postData/target). They're visible but don't block CI.
- **`no-misused-promises`** is configured with `{ checksVoidReturn: {
arguments: false } }`. Event-listener callbacks (`page.on(..., async)`)
and timer callbacks (`setInterval(async () => ...)`) are standard Node
patterns and the rule's default behavior is too strict.
- **`lint-staged`** runs `oxlint --fix` then `oxfmt --write`. A handful
of unsafe auto-fixes (`no-useless-default-assignment` strips
destructuring defaults, `return-await` removes `await` keywords,
`no-inferrable-types` occasionally strips default values) are turned off
so the fixer can run automatically without risk.

- `eslint.config.mjs`, `biome.json`, and `tsconfig.eslint.json` are
removed. `.oxlintrc.json` + `.oxfmtrc.json` replace them.
- CI's lint job runs `yarn lint` + `yarn format:check`.
- `oxfmt` is set to 120 columns / 4-space / single quotes / `lf`,
matching the previous Biome setup. Markdown/MDX and release-managed
files (CHANGELOGs, package.json) are in its ignore list to avoid
cosmetic churn.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-08-18 17:48:37 +02:00

28 lines
697 B
JSON

{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxfmt/configuration_schema.json",
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": true,
"semi": true,
"trailingComma": "all",
"quoteProps": "preserve",
"endOfLine": "lf",
"ignorePatterns": [
"**/node_modules",
"**/dist",
"**/coverage",
"**/.turbo",
"**/website/build",
"**/website/.docusaurus",
"**/*.d.ts",
"**/package.json",
"**/lerna.json",
"**/CHANGELOG.md",
"**/README.md",
"**/*.md",
"**/*.mdx",
"scripts/actions/docker-images/state.json"
]
}