@agentable/oxlint-config
v0.4.2
Published
Composable Oxlint rule presets for Fleet-family TypeScript packages.
Downloads
1,512
Maintainers
Readme
@agentable/oxlint-config
Composable Oxlint presets for Fleet-family TypeScript projects.
Installation
pnpm add -D @agentable/oxlint-config oxlintConfigure the repository root
defineConfig applies the base policy and root-only execution options. Use it once at the repository
root, then add only the environments shared by the whole workspace.
import { defineConfig, test } from "@agentable/oxlint-config";
export default defineConfig({
presets: [test],
ignorePatterns: ["dist/**", "coverage/**"],
});Configure a nested workspace
react includes JSX and Hooks rules without browser globals. Add reactWeb for browser semantics and
accessibility rules. Use defineNestedConfig when those policies belong to only one workspace.
import { defineNestedConfig, react, reactWeb, test } from "@agentable/oxlint-config";
export default defineNestedConfig({
presets: [test, react, reactWeb],
ignorePatterns: ["dist/**", "coverage/**"],
});The root config owns warning denial and unused-disable reporting for the entire lint invocation. Nested configs reuse the same base rules without repeating those root-only options.
Declaration-safe module augmentations
TypeScript 7 can require inline import() references when an ambient module augmentation extends
the same export = package that owns the referenced types. Named imports may fail declaration emit
with TS4033, while the base lint policy intentionally rejects inline type annotations in ordinary
source files.
Keep the augmentation in a dedicated file and opt that file into the declaration policy:
import { declarationFiles, defineNestedConfig, react, reactWeb } from "@agentable/oxlint-config";
export default defineNestedConfig({
presets: [react, reactWeb],
overrides: [declarationFiles(["src/react-augmentation.ts"])],
});The augmentation can then use the declaration-portable form without an inline lint suppression:
import type { FleetFigureElement } from "@fleetfigure/web";
declare module "react" {
namespace JSX {
interface IntrinsicElements {
"fleet-figure": import("react").HTMLAttributes<FleetFigureElement> & {
readonly ref?: import("react").Ref<FleetFigureElement>;
};
}
}
}Use this override only when the file is dedicated to an ambient augmentation, named imports fail declaration emit, and a declaration build or packed-consumer test covers the public type. The base preset remains strict everywhere else.
Configure a root Node.js project or CLI
import { cli, defineConfig, node, test } from "@agentable/oxlint-config";
export default defineConfig({
presets: [test, node, cli],
ignorePatterns: ["dist/**", "coverage/**"],
});Presets
| Preset | Adds |
| ---------- | ------------------------------------------- |
| test | Vitest test-quality and mocking rules |
| node | Node.js globals and path safeguards |
| cli | Intentional console output policy |
| react | Renderer-neutral React JSX and Hooks rules |
| reactWeb | Browser globals and JSX accessibility rules |
declarationFiles(files) creates the explicit file override described above; it is not a global
preset.
The base TypeScript, import, correctness, and safety policy is automatic. Preset order is policy:
later presets may override earlier rules, and local config fields apply last. Put product-specific
exceptions in the nearest workspace config with defineNestedConfig. Oxlint handles correctness;
Oxfmt owns printed style.
License
This project is licensed under the MIT License - see the LICENSE file for details.
