oxc-walrus
v0.1.0
Published
Shareable oxlint and oxfmt configurations with presets and custom plugin
Maintainers
Readme
oxlint-walrus-config
Shareable oxlint configuration with presets and custom plugin for TypeScript/React projects.
Installation
npm install oxlint-walrus-config oxlint --save-dev
# or
yarn add oxlint-walrus-config oxlint -D
# or
pnpm add oxlint-walrus-config oxlint -DUsage
Using Presets
Create .oxlintrc.json in your project root:
{
"extends": ["oxlint-walrus-config/presets/react.json"]
}Available Presets
| Preset | Description |
|--------|-------------|
| base.json | Base configuration with correctness, perf, style, suspicious rules |
| react.json | Same as base, optimized for React projects |
| strict.json | All rules enabled including pedantic and restriction |
Using Custom Plugin
The package includes walrus-plugin with additional rules:
{
"extends": ["oxlint-walrus-config/presets/react.json"],
"jsPlugins": ["oxlint-walrus-config/plugins/walrus-plugin"],
"rules": {
"walrus-plugin/no-enum": "error",
"walrus-plugin/filename-match-regexp": ["error", { "pattern": "^[a-z-]+$" }]
}
}Plugin Rules
walrus-plugin/no-enum
Disallows TypeScript enums and provides auto-fix to convert them to const objects.
// Bad
enum Status {
Active,
Inactive
}
// Good (auto-fixed)
const STATUS = {
Active: 'Active',
Inactive: 'Inactive'
} as const;walrus-plugin/filename-match-regexp
Enforces file naming convention based on regular expression pattern.
Options:
pattern(string): RegExp pattern for valid filenames. Default:^[a-z0-9-.]+$
Extending Configuration
You can override any rule from the preset:
{
"extends": ["oxlint-walrus-config/presets/react.json"],
"rules": {
"no-console": "off",
"react/jsx-sort-props": "off"
}
}Programmatic Usage
import { createBaseConfig } from 'oxlint-walrus-config';
const config = createBaseConfig({
correctness: true,
pedantic: true,
perf: true,
restriction: false,
style: true,
suspicious: true,
});
// Write to .oxlintrc.jsonDevelopment
# Install dependencies
yarn install
# Build
yarn build
# Type check
yarn typecheck
# Lint
yarn lintLicense
MIT
