All rules inherit from @antfu/eslint-config.
- Add my @lvjiaxuan/eslint-plugin.
- Auto-detect
tsconfig.json
and its references if TypeScript is enabled, which means enabling type-aware rules. - Add my @lvjiaxuan/eslint-plugin-oxlint.
Follow antfu's.
// eslint.config.js
import lv from '@lvjiaxuan/eslint-config'
export default lv({
typescript: {
notDetectTsconfig: true
}
})
With OXLint
A number of rules will be taken care of by OXLint to reduce ESLint's burden.
Note
The rules settings of antfu's will be overwritten.
// eslint.config.js
import lv from '@lvjiaxuan/eslint-config'
export default lv({
oxlint: true // equals to `{ deny: 'correctness' }`.
})
Options type, respects its original options:
/**
* References https://oxc-project.github.io/docs/guide/usage/linter.html#useful-options-and-examples
*/
export type OXLintOptions = {
/**
* Deny the rule or category.
*
* @default 'correctness'
*/
deny?: 'all' | Categories | Categories[]
/**
* Allow the rule or category.
*/
allow?: (keyof OXLintRules)[]
} | boolean
Tip
- Categories of OXLint.
- Rules supported by OXLint.
Modify lint scritp:
// package.json
{
"scripts": {
- "lint": "eslint ."
+ "lint": "npx oxlint . && eslint",
+ "lintf": "npx oxlint . --fix && eslint --fix"
}
}