Skip to content

[lint]: Use oxlint for import cycle checks to cut CI lint time#7835

Open
ggdouglas wants to merge 1 commit intodevelopfrom
gdouglas/oxlint-no-cycle
Open

[lint]: Use oxlint for import cycle checks to cut CI lint time#7835
ggdouglas wants to merge 1 commit intodevelopfrom
gdouglas/oxlint-no-cycle

Conversation

@ggdouglas
Copy link
Contributor

Summary

CI lint was taking ~20 minutes, mostly due to the ESLint rule import/no-cycle from eslint-plugin-import, which is expensive in ESLint’s per-file model. This PR moves cycle detection to Oxlint, which does it via multi-file analysis and finishes in seconds, while keeping the rest of lint in ESLint.

Changes

  • ESLint: import/no-cycle is now always off (no longer run only in CI).
  • Oxlint: Added as a dev dependency with a lint:cycles script that runs only the import cycle rule over packages/.
  • CI: After pnpm lint, the lint job runs pnpm lint:cycles so cycles are still enforced.
  • Config: Root .oxlintrc.json enables the import plugin and import/no-cycle with ignore patterns aligned to ESLint (node_modules, dist, lib, etc.).

Result

Before (ESLint import/no-cycle enabled in CI): Lint ~18m 31s, total pipeline ~27m 15s

before

After (oxlint for cycle detection): Lint ~1m 2s, total pipeline ~15m 9s

after

Verification

Cycle detection was checked with temporary test files. A minimal example that correctly fails pnpm lint:cycles:

Within a package (e.g. packages/colors/src/):

// _cycle_test_a.ts
import { getB } from "./_cycle_test_b";
export function getA(): string { return getB() + "-a"; }

// _cycle_test_b.ts
import { getA } from "./_cycle_test_a";
export function getB(): string { return getA() + "-b"; }

Across packages (core ↔ colors):

// packages/core/src/_cycle_test_cross.ts
import { fromColors } from "../../colors/src/_cycle_test_cross";
export function fromCore(): number { return fromColors(); }

// packages/colors/src/_cycle_test_cross.ts
import { fromCore } from "../../core/src/_cycle_test_cross";
export function fromColors(): number { return fromCore(); }
@svc-palantir-github
Copy link

Disable ESLint import cycle detection and enable through oxlint

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

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

2 participants