@avanlan/eslint-config
v2.27.7
Published
AvanLan's ESLint config
Readme
@avanlan/eslint-config
Supports ESLint v9 or v8.50.0+
[!IMPORTANT] Since v1.0.0, this config is rewritten to the new ESLint Flat config, check the release note for more details.
Usage
pnpm i -D eslint @avanlan/eslint-config@^2And create eslint.config.mjs in your project root:
// eslint.config.mjs
import avanlan from '@avanlan/eslint-config'
export default avanlan()If you still use some configs from the legacy eslintrc format, you can use the @eslint/eslintrc package to convert them to the flat config.
// eslint.config.mjs
import avanlan from '@avanlan/eslint-config'
import { FlatCompat } from '@eslint/eslintrc'
const compat = new FlatCompat()
export default avanlan(
{
ignores: [],
},
// Legacy config
...compat.config({
extends: [
'eslint:recommended',
// Other extends...
],
})
// Other flat configs...
)Note that
.eslintignoreno longer works in Flat config, see customization for more details.
Add script for package.json
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}