ESLint Config
ESLint Configuration for Moeru AI.
A superset of @antfu/eslint-config
with optional features:
- Oxlint Support (with easy-to-use
moeru-lint
script) - Perfectionist Natural
- SonarJS
- MaskNet
- De Morgan
- Prefer Arrow
- Prefer Let
Starter Wizard
You can use antfu's Starter Wizard to get started quickly:
npx @antfu/eslint-config@latest
Replace 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-config
import { 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
.