@xgheaven/eslint-config-xgheaven
v0.5.0
Published
Flat ESLint 9 config factory for xgheaven, based on neostandard with TypeScript and React options
Readme
eslint-config-xgheaven
Flat ESLint 9 shareable config factory (CommonJS) based on the Standard JavaScript style, tuned by XGHeaven for personal usage preferences.
npm install @xgheaven/eslint-config-xgheaven eslint prettier
# or: pnpm add @xgheaven/eslint-config-xgheaven eslint prettierRequires Node.js >=20.19 and ESLint ^9.
Usage
Base (JavaScript)
// eslint.config.js
const config = require('@xgheaven/eslint-config-xgheaven')
module.exports = config({
ignores: ['dist/**', 'coverage/**'],
})TypeScript
const config = require('@xgheaven/eslint-config-xgheaven')
module.exports = config({ ts: true })React (+ TypeScript)
const config = require('@xgheaven/eslint-config-xgheaven')
module.exports = config({ ts: true, react: true })The root export accepts neostandard options and adds:
ts/typescript: include TypeScript rulesreact: include React and React Hooks rules
resolveIgnoresFromGitignore is re-exported on the function:
const config = require('@xgheaven/eslint-config-xgheaven')
module.exports = config({
ignores: config.resolveIgnoresFromGitignore(),
})Migration from 0.4.x (.eslintrc)
Before (legacy):
{
"extends": [
"@xgheaven/eslint-config-xgheaven",
"@xgheaven/eslint-config-xgheaven/typescript",
"@xgheaven/eslint-config-xgheaven/react"
]
}After (eslint.config.js):
const config = require('@xgheaven/eslint-config-xgheaven')
module.exports = config({ ts: true, react: true })Breaking changes in 0.5.0:
- Flat config only; no
.eslintrc/extendsentrypoints. - Package root exports a config function; config subpath exports were removed.
- ESLint 8 unsupported;
eslint-config-standardremoved. default.jsremoved; use the package root.- Node
>=20.19required.
Development
pnpm install
pnpm testPlayground fixtures:
playground/base/: validates the base JavaScript configplayground/typescript/: validatesconfig({ ts: true })playground/react/: validatesconfig({ ts: true, react: true })
