@timche/oxc-configs
v2.0.0
Published
Oxlint and Oxfmt configs
Readme
oxc-configs
Opinionated Oxfmt and Oxlint configs
Install
bun add -d @timche/oxc-configsThe Oxlint config enables type-aware linting, which needs an extra dependency:
bun add -d oxlint-tsgolintType-aware rules read type information from the tsconfig.json that Oxlint discovers for each file. Files that no tsconfig.json covers report their types as error, which makes the typescript/no-unsafe-* rules fire on every expression in them. The config already turns those rules off for *.test.js, *.test.jsx, *.test.ts and *.test.tsx. Other layouts, such as tests in a __tests__ directory or behind a separate tsconfig.test.json, need either an override of your own or the tests included in the discovered config.
The type-aware rules assume a strict tsconfig.json. Without strictNullChecks, typescript/no-unnecessary-condition and typescript/prefer-nullish-coalescing report results that don't hold.
Usage
oxfmt.config.ts
import { defineConfig } from "oxfmt";
import oxfmtConfig from "@timche/oxc-configs/oxfmt";
export default defineConfig(oxfmtConfig);oxlint.config.ts
import { defineConfig } from "oxlint";
import oxlintConfig from "@timche/oxc-configs/oxlint";
export default defineConfig(oxlintConfig);