@strastdas/oxc-config
v0.2.0
Published
Shared Oxlint compatibility presets for Ultracite projects.
Readme
@strastdas/oxc-config
Shared Oxlint compatibility presets for repositories using Ultracite.
See QUALITY.md for the organization-wide adoption, formatting, exception, and CI policy.
Requirements
- Node.js
^20.19.0 || >=22.12.0 oxlint^1.74.0oxfmt^0.59.0ultracite^7.9.4
Quick setup
Run this in a consumer repository to install the package and its peer dependencies, auto-detect the profile (Next.js present → next-react, otherwise base), write oxlint.config.ts/.mjs and oxfmt.config.ts/.mjs, add the required check scripts, and drop the Claude Code skill into .claude/skills/oxc-config/SKILL.md:
npx @strastdas/oxc-configOverride auto-detection with npx @strastdas/oxc-config --profile=base or --profile=next-react. The command is idempotent: it skips writing any config file or script that already exists. The scaffolded oxfmt.config.* is a starting point, not a finished config — see Formatting below for what to review afterward.
Manual setup
Install the package alongside its peer dependencies:
pnpm add -D @strastdas/oxc-config oxfmt oxlint ultraciteNext.js + React
Create oxlint.config.ts:
import { defineConfig } from "oxlint"
import nextReactConfig from "@strastdas/oxc-config/next-react"
export default defineConfig({
extends: [nextReactConfig],
ignorePatterns: nextReactConfig.ignorePatterns,
})The profile combines Ultracite's core, Next.js, and React presets. It disables only these compatibility rules from the original migration pilot:
eslint/func-styleeslint/no-inline-commentseslint/require-unicode-regexpeslint/sort-keysunicorn/filename-case
Base profile
For a non-framework project, import @strastdas/oxc-config/base instead. Framework-specific presets can then be added in the consumer config.
Formatting
Oxfmt is the canonical formatter. Each repo owns its oxfmt.config.* (formatter compatibility is inherently local), but start from Ultracite's shared defaults rather than from scratch. Quick setup scaffolds this automatically; the manual equivalent for a Next.js/React repo is:
import { defineConfig } from "oxfmt"
import ultraciteConfig from "ultracite/oxfmt"
export default defineConfig({
...ultraciteConfig,
ignorePatterns: [
...(ultraciteConfig.ignorePatterns ?? []),
// repo-specific: generated code, native platform folders, vendor dirs
],
sortTailwindcss: {
functions: ["clsx", "cn", "cva", "tw"],
},
})Drop sortTailwindcss for the base profile (non-Tailwind projects). Only add ignorePatterns entries beyond Ultracite's defaults, and only for paths this repo actually has (see QUALITY.md).
Verification
Run npm test before publishing. The pack smoke test creates a tarball, installs it into a clean temporary consumer with the peer dependencies, and imports both public profiles.
