@clipboard-health/oxlint-config
v1.10.14
Published
Shared Oxlint configuration for Clipboard Health repositories.
Readme
@clipboard-health/oxlint-config
Shared Oxlint configuration for Clipboard Health repositories.
Table of contents
Install
npm install @clipboard-health/oxlint-configUsage
Use the package's TypeScript helper when a repo needs additive composition. Oxlint's built-in extends is useful for simple inheritance, but it does not let a repo safely append shared plugins, overrides, and similar array fields without re-specifying the shared values.
TypeScript config
Create an oxlint.config.ts in your repo root:
import { base, createOxlintConfig, vitest } from "@clipboard-health/oxlint-config";
import { defineConfig } from "oxlint";
export default defineConfig(
createOxlintConfig({
localConfig: {
categories: {
correctness: "error",
nursery: "error",
pedantic: "error",
perf: "error",
restriction: "error",
style: "error",
suspicious: "error",
},
ignorePatterns: [".agents", "coverage/", "node_modules/"],
options: {
denyWarnings: true,
reportUnusedDisableDirectives: "error",
typeAware: true,
typeCheck: true,
},
rules: {
"vitest/require-test-timeout": "off",
},
settings: {
node: {
version: ">=24.14.0",
},
},
},
presets: [base, vitest],
}),
);Available presets:
basereactjestvitest
Merge behavior:
plugins,jsPlugins,overrides, andignorePatternsappend in orderrules,settings,options,categories,env, andglobalsmerge left-to-rightlocalConfigalways wins over preset values when keys conflict
JSON config
Create an .oxlintrc.json in your repo root:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["./node_modules/@clipboard-health/oxlint-config/src/base.json"],
"categories": {
"correctness": "error",
"nursery": "error",
"pedantic": "error",
"perf": "error",
"restriction": "error",
"style": "error",
"suspicious": "error"
},
"ignorePatterns": [".agents", "coverage/", "node_modules/"],
"options": {
"denyWarnings": true,
"reportUnusedDisableDirectives": "error",
"typeAware": true,
"typeCheck": true
},
"settings": {
"node": {
"version": ">=24.14.0"
}
}
}Use JSON only when simple inheritance is enough. JSON extends still works for shared presets, but repo-local array fields like plugins and overrides will not get the additive merge behavior provided by createOxlintConfig.
For repos using Vitest, extend from vitest.json instead of base.json to include the vitest plugin and rules:
{
"extends": ["./node_modules/@clipboard-health/oxlint-config/src/vitest.json"]
}Override shared rules as needed:
{
"extends": ["./node_modules/@clipboard-health/oxlint-config/src/base.json"],
"rules": {
"no-console": "off"
}
}What is shared
The package includes:
base.json: the backwards-compatible JSON preset for simpleextendsusagevitest.json: extendsbase.jsonwith the vitest plugin and rules for JSONextendsusagebasepreset: shared plugins, rules, and overrides exported for TypeScript compositionreact,jest,vitestpresets: additive plugin presets for common repo typescreateOxlintConfig: helper for composing presets with repo-local config
