📦 Strong typed defineConfig function support for oxlint.
Caution
This package is work in progress.
npm install @oxlint-types/define-configyarn add @oxlint-types/define-configpnpm add @oxlint-types/define-configimport { defineConfig } from '@oxlint-types/define-config'
export default defineConfig({
plugins: ['react', 'typescript', 'import'],
rules: {
eqeqeq: 'warn',
'import/no-cycle': 'error',
'react/self-closing-comp': ['error', { html: false }],
'@typescript-eslint/no-explicit-any': 'off',
},
})rules keys are generated from oxlint --rules, so built-in rules have autocompletion and typo checks.
Rule options are parsed from Oxc Rust rule sources (declare_oxc_lint!(..., config = ...)) and generated into BuiltinRuleOptionsByName, then merged with your RuleOptionsPatch overrides.
pnpm rules:generateThis command updates plugin-level generated files under src/plugins:
It also writes a compatibility re-export in src/rules/generated.ts. The generator script is scripts/generate-rules.ts.
To customize options for specific rules, augment RuleOptionsPatch:
declare module '@oxlint-types/define-config' {
interface RuleOptionsPatch {
'react/self-closing-comp': {
html?: boolean
component?: boolean
}
'custom/my-rule': {
enabled: boolean
}
}
}The patch type lives in src/rules/patch.ts, and is never auto-generated.
When you run pnpm rules:generate later, your patch interfaces still apply.
When both generated and patched option types exist for a rule key, patch type takes precedence.
- eslint-define-config create by Shinigami92