| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
chore(lint): replace ESLint with oxlint (#6604) ## Problem Final step of the ESLint → oxlint migration ([NAN-5769](https://linear.app/nango/issue/NAN-5769)). ESLint is slow on this monorepo (~77s full-repo, OOMs in CI, ~3–7s per file at pre-commit). The prerequisites are now merged — import sorting moved to Prettier (#6582) and tsconfigs made `typescript-go`-compatible (#6593) — so we can swap the engine. ## Solution Replace ESLint (and its 10 plugins) with **oxlint**, type-aware via `oxlint-tsgolint`. **Linting** - `.oxlintrc.json` replicates the existing ESLint rule set, type-aware enabled. Type-aware rules are scoped to TS files (off for `js/cjs/mjs`, matching the old config); `.d.ts` is ignored. - `lint` / `lint:fix` now run oxlint. The CI lint job drops the `ts-build --noCheck` step and the 8 GB heap workaround — `tsgolint` resolves types from source. - Removed `eslint`, `@typescript-eslint/*`, all `eslint-plugin-*`, `eslint-config-prettier`, `globals`; deleted `eslint.config.mjs`. **Formatting — now separate from linting (by design)** - ESLint used to run Prettier as a lint rule (`eslint-plugin-prettier`), so `eslint --fix` also formatted. oxlint deliberately does **not** format — it treats linting and formatting as separate concerns (same stance as Biome; ESLint itself has moved this way), and there's no equivalent plugin. - To keep formatting enforced and convenient: added a `format:check` script + CI step (formatting was previously only gated through `eslint-plugin-prettier`), and `lint-staged` now runs `oxlint --fix` **and** `prettier --write` on staged files. (The Prettier scripts are also renamed `prettier-format`/`prettier-check` → `format`/`format:check`.) - **DX impact:** formatting a file/repo by hand is now a separate `npm run format` rather than riding along with `lint:fix`. Commit-time formatting is unchanged (the hook still formats staged files), so this only affects manual runs. **Dropped rules** (no oxlint equivalent): `import/no-extraneous-dependencies`, `react/jsx-sort-props`, `@typescript-eslint/member-ordering`. (`import/order` already moved to Prettier in #6582.) Everything else carries over — including the design-system guardrail `react/forbid-component-props` (no `className`/`style` on `Button`/`IconButton`), which oxlint supports with the same config. One code site needed an explicit `url.href` — oxlint's `restrict-template-expressions` is stricter on URL objects. Docs (`AGENTS.md` / `CLAUDE.md`) updated for oxlint + the editor-extension requirement. Sub-issue: NAN-5811. ## Testing - `npm run lint -- --quiet` (oxlint, type-aware) exits 0 — the ~6.7k remaining items are `warn`-level rules (matching ESLint's warnings, suppressed by `--quiet` in CI) - `npm run format:check` exits 0; zero `tsconfig-error` diagnostics (type-aware is on via `options.typeAware` in `.oxlintrc.json` — no CLI flag needed) - CI `lint-code` job: ~58s (was ~149s with ESLint) | 2 个月前 |