Skip to content

Commit

Permalink
refactor: consistent type usage for array types
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Jan 14, 2025
1 parent 9f152a4 commit c3b9eaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/createConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { vueTsConfigs, type ExtendableConfigName } from './configs'
import type { ScriptLang } from './internals'

type ConfigOptions = ProjectOptions & {
extends?: Array<ExtendableConfigName>
extends?: ExtendableConfigName[]
supportedScriptLangs?: Record<ScriptLang, boolean>
}

Expand Down
9 changes: 4 additions & 5 deletions src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ export function configureVueProject(userOptions: ProjectOptions): void {
export function defineConfigWithVueTs(
...configs: InfiniteDepthConfigWithVueSupport[]
): ConfigArray {
const flattenedConfigs: Array<ConfigObjectOrPlaceholder> =
// @ts-ignore
configs.flat(Infinity)
// @ts-ignore
const flattenedConfigs: ConfigObjectOrPlaceholder[] = configs.flat(Infinity)

const reorderedConfigs = insertAndReorderConfigs(flattenedConfigs)

Expand Down Expand Up @@ -84,8 +83,8 @@ type ExtractedConfig = {
const userTypeAwareConfigs: ExtractedConfig[] = []

function insertAndReorderConfigs(
configs: Array<ConfigObjectOrPlaceholder>,
): Array<ConfigObjectOrPlaceholder> {
configs: ConfigObjectOrPlaceholder[],
): ConfigObjectOrPlaceholder[] {
const lastExtendedConfigIndex = configs.findLastIndex(
config => config instanceof TsEslintConfigForVue,
)
Expand Down

0 comments on commit c3b9eaa

Please sign in to comment.