- 📦 Support javascript presets
- 📦 Support typescript presets
- 📦 Support vue(2 and 3) presets
- 📦 Support react presets
- 📦 Support jsx presets
- 📦 Support vitest presets
- 📦 Support eslint comments presets
- 📦 Support overrides eslint config
# npm
npm i @configurajs/eslint -D
# yarn
yarn add @configurajs/eslint -D
# pnpm
pnpm add @configurajs/eslint -D
// eslint.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig()
OR
// eslint.config.js
const { defineConfig } = require('@configurajs/eslint')
module.exports = defineConfig()
Switching framework presets requires manual setup.
// eslint.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig({
vue: { version: 2 },
})
// eslint.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig({
vue: false,
react: true,
})
// prettier.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig({ ... })
export interface DefineConfigOptions {
/**
* Enable TypeScript support
* @default true
*/
ts?: boolean
/**
* Enable JSX support
* @default true
*/
jsx?: boolean
/**
* Enable Vue support, version 3 by default
* @default true
*/
vue?: boolean | { version: 2 | 3 }
/**
* Enable React support
* @default false
*/
react?: boolean
/**
* Enable Vitest support
* @default true
*/
vitest?: boolean
/**
* Enable eslint comments support
* @default true
*/
comments?: boolean
/**
* Custom rules
*/
rules?: Linter.RulesRecord
/**
* Ignore files
*/
ignores?: string[]
/**
* Override eslint configs
*/
overrides?: Linter.Config[]
}
This project structure is inspired by antfu-eslint-config.