Skip to content

Commit

Permalink
refactor!: rename typescriptWithLanguageServer to `typescriptWithTy…
Browse files Browse the repository at this point in the history
…pes`
  • Loading branch information
antfu committed Sep 26, 2023
1 parent 11e3101 commit ffe00e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
24 changes: 10 additions & 14 deletions README.md
Expand Up @@ -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(),
]
```
Expand Down
6 changes: 3 additions & 3 deletions src/configs/typescript.ts
Expand Up @@ -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(
Expand Down Expand Up @@ -105,8 +105,8 @@ export function typescript(
]
}

export function typescriptWithLanguageServer(
options: OptionsTypeScriptWithLanguageServer & OptionsComponentExts & OptionsOverrides,
export function typescriptWithTypes(
options: OptionsTypeScriptWithTypes & OptionsComponentExts & OptionsOverrides,
): FlatESLintConfigItem[] {
const {
componentExts = [],
Expand Down
4 changes: 2 additions & 2 deletions src/factory.ts
Expand Up @@ -17,7 +17,7 @@ import {
stylistic,
test,
typescript,
typescriptWithLanguageServer,
typescriptWithTypes,
unicorn,
vue,
yml,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Expand Up @@ -11,7 +11,7 @@ export interface OptionsComponentExts {
componentExts?: string[]
}

export interface OptionsTypeScriptWithLanguageServer {
export interface OptionsTypeScriptWithTypes {
tsconfigPath: string
tsconfigRootDir?: string
}
Expand Down Expand Up @@ -46,7 +46,7 @@ export interface OptionsConfig {
*
* @default auto-detect based on the dependencies
*/
typescript?: boolean | OptionsTypeScriptWithLanguageServer
typescript?: boolean | OptionsTypeScriptWithTypes

/**
* Enable test support.
Expand Down

0 comments on commit ffe00e1

Please sign in to comment.