@antfu/eslint-define-config
A fork of eslint-define-config to experiment better Flat Config support.
Changes In This Fork
1. Re-export Rules for Each Plugin
import {
VitestRules,
VueRules,
} from '@antfu/eslint-define-config'
2. Allow Overriding Rules
import pluginVitest from 'eslint-plugin-vitest'
import {
defineFlatConfig,
VitestRules
} from '@antfu/eslint-define-config'
export default defineFlatConfig<VitestRules, true>({
plugins: {
vitest: pluginVitest,
},
rules: {
'vitest/no-async': 'error',
'indent': 'error'
},
})
3. Support Renaming Rules
import {
RenamePrefix,
TypeScriptRules
} from '@antfu/eslint-define-config'
type RenamedRules = RenamePrefix<TypeScriptRules, '@typescript-eslint/', 'ts/'>
This way it could work for Flat Config plugin renaming:
import pluginTypeScript from '@typescript-eslint/eslint-plugin'
import {
defineFlatConfig,
RenamePrefix,
TypeScriptRules
} from '@antfu/eslint-define-config'
type RenamedRules = RenamePrefix<TypeScriptRules, '@typescript-eslint/', 'ts/'>
export default defineFlatConfig<RenamedRules>({
plugins: {
ts: pluginTypeScript,
},
rules: {
'ts/indent': 'error',
},
})