ESLint Config
ESLint Configuration for Moeru AI.
A superset of @antfu/eslint-config with optional features:
- Oxlint Support (with easy-to-use
moeru-lintscript) - Perfectionist Natural
- SonarJS
- MaskNet
- De Morgan
- Prefer Arrow
- Depend
Starter Wizard
You can use antfu's Starter Wizard to get started quickly:
npx @antfu/eslint-config@latestReplace antfu() to defineConfig():
- import antfu from '@antfu/eslint-config'
+ import { defineConfig } from '@moeru/eslint-config'
- export default antfu({
+ export default defineConfig({
...options,
})Manual Install
npm i -D eslint @antfu/eslint-config @moeru/eslint-configimport { defineConfig } from '@moeru/eslint-config'
export default defineConfig({
...options,
})If you only need the default configuration, you can just re-export the default:
export { default } from '@moeru/eslint-config'With Oxlint
npm i -D oxlint eslint-plugin-oxlint@moeru/eslint-config automatically detects if oxlint is installed, or you can specify it explicitly:
import { defineConfig } from '@moeru/eslint-config'
export default defineConfig({
...options,
+ oxlint: true,
})You can also use the moeru-lint script to simplify setup:
{
"scripts": {
- "lint": "oxlint && eslint",
+ "lint": "moeru-lint",
# just use "pnpm lint --fix"!
- "lint:fix": "oxlint --fix && eslint --fix"
}
}moeru-lint enables ESLint Caching by default to speed things up, you can disable it with --no-cache.
Progressive Migration
You may only want to enable some plugins initially, or progressively enable the remaining ones later.
You can refer to the following example to disable the plugin:
import { defineConfig } from '@moeru/eslint-config'
export default defineConfig({
masknet: false,
perfectionist: false,
preferArrow: false,
sonarjs: false,
...antfuOptions,
})