diff --git a/README.md b/README.md index 33bc1f4453..646ce6e81e 100644 --- a/README.md +++ b/README.md @@ -161,36 +161,32 @@ import { ignores, imports, javascript, - javascriptStylistic, jsdoc, jsonc, markdown, node, sortPackageJson, sortTsconfig, + stylistic, typescript, - typescriptStylistic, unicorn, vue, yml, } from '@antfu/eslint-config' export default [ - ...ignores, + ...ignores(), ...javascript(), - ...comments, - ...node, - ...jsdoc, - ...imports, - ...unicorn, - ...javascriptStylistic, - + ...comments(), + ...node(), + ...jsdoc(), + ...imports(), + ...unicorn(), ...typescript(), - ...typescriptStylistic, - + ...stylistic(), ...vue(), - ...jsonc, - ...yml, + ...jsonc(), + ...yml(), ...markdown(), ] ``` diff --git a/src/configs/typescript.ts b/src/configs/typescript.ts index 0686721e8b..9c3d9d90ab 100644 --- a/src/configs/typescript.ts +++ b/src/configs/typescript.ts @@ -3,7 +3,7 @@ import type { FlatESLintConfigItem } from 'eslint-define-config' import { GLOB_TS, GLOB_TSX } from '../globs' import { parserTs, pluginAntfu, pluginImport, pluginTs } from '../plugins' import { OFF } from '../flags' -import type { OptionsComponentExts, OptionsOverrides, OptionsTypeScriptWithLanguageServer } from '../types' +import type { OptionsComponentExts, OptionsOverrides, OptionsTypeScriptWithTypes } from '../types' import { renameRules } from '../utils' export function typescript( @@ -105,8 +105,8 @@ export function typescript( ] } -export function typescriptWithLanguageServer( - options: OptionsTypeScriptWithLanguageServer & OptionsComponentExts & OptionsOverrides, +export function typescriptWithTypes( + options: OptionsTypeScriptWithTypes & OptionsComponentExts & OptionsOverrides, ): FlatESLintConfigItem[] { const { componentExts = [], diff --git a/src/factory.ts b/src/factory.ts index 71fcdeed14..605fc980f1 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -17,7 +17,7 @@ import { stylistic, test, typescript, - typescriptWithLanguageServer, + typescriptWithTypes, unicorn, vue, yml, @@ -95,7 +95,7 @@ export function antfu(options: OptionsConfig & FlatESLintConfigItem = {}, ...use })) if (typeof enableTypeScript !== 'boolean') { - configs.push(typescriptWithLanguageServer({ + configs.push(typescriptWithTypes({ ...enableTypeScript, componentExts, overrides: overrides.typescriptWithTypes, diff --git a/src/types.ts b/src/types.ts index 2a103b2571..2dda1bbb6a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -11,7 +11,7 @@ export interface OptionsComponentExts { componentExts?: string[] } -export interface OptionsTypeScriptWithLanguageServer { +export interface OptionsTypeScriptWithTypes { tsconfigPath: string tsconfigRootDir?: string } @@ -46,7 +46,7 @@ export interface OptionsConfig { * * @default auto-detect based on the dependencies */ - typescript?: boolean | OptionsTypeScriptWithLanguageServer + typescript?: boolean | OptionsTypeScriptWithTypes /** * Enable test support.