Skip to content

Migrate quality tooling to Oxlint/Oxfmt and strengthen architecture guardrails #281

Description

@anandpant

Goal

Migrate Sketchi from ESLint + Prettier to Oxlint + Oxfmt so the repository can use a richer, type-aware rule set while preserving and strengthening its existing Nx architecture boundaries.

Prior art: Prismantix PR #243. This issue should follow the same pattern, adapted to Sketchi rather than copied mechanically.

Current baseline

  • eslint.config.mjs enforces Nx scope/type boundaries and Sketchi-specific Effect import restrictions.
  • tools/project-graph.test.ts verifies project membership, tags, TypeScript references, dependency direction, and forbidden-import probes through ESLint.
  • nx.json infers per-project lint targets, and CI includes lint in the canonical Nx gate.
  • .prettierrc currently sets only double quotes; there is no Biome configuration to migrate.

High-level direction

  • Replace active ESLint/Prettier configs, scripts, and runtime dependencies with pinned Oxlint/Oxfmt tooling; retain @nx/eslint-plugin only if required as the Oxlint JS plugin providing @nx/enforce-module-boundaries.
  • Start from the Prismantix formatting baseline: 100-column width, tabs at width 2, double quotes, semicolons, trailing commas, parenthesized arrow parameters, and no automatic import/package sorting. Keep generated/raw-artifact exclusions explicit, and use spaces where required for tsconfig files.
  • Run type-aware Oxlint with zero warnings and enable the useful TypeScript, import, Promise, React, accessibility, Unicorn, Node, and Vitest rule families selectively.
  • Preserve Sketchi's existing scope:* / type:* Nx constraints through @nx/enforce-module-boundaries; review the two narrow workspace-input allowances and the Studio dynamic-dependency exception rather than dropping them.
  • Add a tested Sketchi Oxlint plugin only for durable repository policies. The direct useEffect / useLayoutEffect prohibition is an immediate candidate; Prismantix's Effect schema and test-sleep rules must be evaluated against Sketchi's current Effect architecture before adoption.
  • Replace the ESLint-backed boundary probes in tools/project-graph.test.ts with equivalent Oxlint/CLI proof, and keep architecture configuration in Nx shared inputs.
  • Add one authoritative check command covering lint, format check, and custom-rule tests; wire it into CI and remove the inferred Nx ESLint lint gate if lint becomes repo-wide Oxlint, while retaining the existing Nx typecheck/test/build gates.
  • Isolate configuration, semantic remediation, and repository-wide mechanical formatting into reviewable stacked changes.

Open questions for grooming

  • Which strict rules can be enabled immediately versus introduced after measured remediation?
  • Should lint remain an inferred Nx target, become a repo-wide Oxlint gate, or use both without duplicate work?
  • Which generated files, fixtures, vendored assets, and large raw outputs must remain untouched by Oxfmt?
  • Which current React effects are true third-party synchronization adapters versus product-code violations that should be refactored?

Acceptance criteria

  • No active ESLint, Prettier, or Biome config or script remains; @nx/eslint-plugin may remain solely as an Oxlint JS-plugin dependency for Nx boundary enforcement.
  • lint, format, format:check, and check are deterministic and documented.
  • Existing Nx project classifications and dependency constraints remain enforced, with tests that prove violations fail.
  • Type-aware Oxlint passes with zero warnings; suppressions are narrow and reasoned.
  • Every custom Sketchi rule has focused positive, negative, and false-positive coverage, plus alias coverage where the rule resolves imports or callable aliases.
  • CI runs lint, format checking, custom guardrail tests, and the existing typecheck/test/build proof.
  • Generated, fixture, vendored, and raw-artifact exclusions are documented and verified unchanged.

Current touchpoints

  • eslint.config.mjs
  • .prettierrc
  • .prettierignore
  • package.json
  • nx.json
  • tools/project-graph.test.ts
  • .github/workflows/ci.yml
  • project tags in apps/**/project.json, packages/**/project.json, and tools/**/project.json

This is intentionally a high-level migration issue to be elaborated against a measured Sketchi violation/exclusion inventory before implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions