@wkovacs64/oxlint-config
v0.4.0
Published
@wKovacs64 Oxlint config
Maintainers
Readme
@wkovacs64/oxlint-config
Personal Oxlint config.
Type-aware linting via oxlint-tsgolint, Oxlint defaults, high-signal rule tweaks, and
optional React / Vitest / Astro layers auto-detected from the package tree (overridable).
Install
pnpm add --save-dev @wkovacs64/oxlint-config oxlint oxlint-tsgolintRequires Node >=24 (Oxlint JS/TS config needs a TS-capable Node runtime).
Usage
Create oxlint.config.ts in the project root:
import { createConfig } from "@wkovacs64/oxlint-config";
export default createConfig();Use createConfig instead of Oxlint's extends so root-only settings such as environments and
ignore patterns are applied correctly.
Add scripts:
{
"scripts": {
"lint": "oxlint"
}
}Feature detection
On load, the config resolves these packages from the consumer install (same idea as the ESLint config) and enables matching layers:
| Package | Enables |
| -------- | ------------------------------------------------------------------------------------------------------------------------- |
| react | react + jsx-a11y plugins/rules; Playwright path hooks exemptions |
| vitest | plugin + env.vitest / strict rules on test globs (no-focused-tests warn); all vitest/* off under **/playwright/** |
| astro | env.astro + no-undef on **/*.astro (frontmatter + <script> only) |
Force on/off without relying on resolution (monorepos, tests):
import { createConfig } from "@wkovacs64/oxlint-config";
export default createConfig(
{},
{
react: false,
jsxA11y: true,
vitest: true,
astro: true,
},
);jsxA11y controls the jsx-a11y plugin and shared accessibility rules independently of React. It
defaults to the resolved react feature, preserving existing React defaults. Set jsxA11y: true
for non-React JSX projects, or jsxA11y: false to disable accessibility checks while keeping React
enabled. No additional framework detection is performed.
Module boundaries
Module-boundary enforcement is opt-in. Point it at the #/ alias for the directory containing your
modules:
import { createConfig } from "@wkovacs64/oxlint-config";
export default createConfig(
{},
{
moduleBoundaries: { modulesPath: "#/app/modules" },
},
);For a module directory named orders, its public entrypoints are orders and orders.server, with
an optional known JavaScript/TypeScript extension. Files outside app/modules and files in other
modules must use those aliased public entrypoints. A module may use relative or aliased imports of
its own internals, including nested parent-relative imports. Relative imports and re-exports into a
module are rejected from outside that module. Aliased module paths containing . or .. segments
are always rejected.
The configured directory must exist. The #/ alias is resolved from the process working directory,
so run Oxlint from the project root. Alias restrictions use Oxlint's native no-restricted-imports;
importer-aware relative restrictions are isolated in one JS plugin because Oxlint JS plugins are
alpha.
The boundary applies to static import declarations and named/star re-exports with a source. In
Astro files, Oxlint enforces these declarations in frontmatter and <script>; Astro template
expressions remain outside Oxlint's linted regions. Dynamic import(), require(), TypeScript
import-equals, and TypeScript import types are outside its semantic boundary.
IDE
VS Code / forks: install Oxc
(oxc.oxc-vscode).
Type-aware linting
On by default (options.typeAware: true). Requires the oxlint-tsgolint peer — without it
Oxlint exits with Failed to find tsgolint executable.
Type-aware adds analysis cost on large projects. Opt out in the consumer root config:
import { createConfig } from "@wkovacs64/oxlint-config";
export default createConfig({
options: {
typeAware: false,
},
});Type-aware rules stay listed when disabled; Oxlint skips them instead of failing the run.
Type-aware results reflect the project state available when Oxlint runs. If a framework generates TypeScript declarations or route types, run its type-generation command first. For example, a React Router project might use:
{
"scripts": {
"typegen": "react-router typegen",
"lint": "pnpm typegen && oxlint",
"typecheck": "pnpm typegen && tsc"
}
}Customize
import { createConfig } from "@wkovacs64/oxlint-config";
export default createConfig({
ignorePatterns: ["my-generated/**"],
rules: {
"no-debugger": "warn",
},
});Consumer ignore patterns, plugins, and overrides are appended to the shared configuration. Object settings and rules are merged with consumer values taking precedence.
Notes
- Prefer Oxlint native plugins/defaults over exhaustive rule dumps.
createConfigcombines consumer plugins with the shared plugin set.no-unused-varsexplicitly allows unused arguments prefixed with_, including bare_. Other options remain at their defaults.typography/no-typographic-quotesrejects U+2018, U+2019, U+201C, and U+201D in string literals, JSX text, and raw template text. Comments are excluded. Inspired by@slhs/eslint-config, implemented with Oxlint's JS plugin API.- Import ordering is not configured (no native
import/order); use a formatter if you care. - Astro: Oxlint lints frontmatter +
<script>only — no template/client:*rules (see compatibility). - Not included (no solid native path, or out of scope for v1): Testing Library, jest-dom, Playwright
recommended sets, TS naming-convention (e.g. ban
I-prefix interfaces).
