Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: format for named tuple #229

Merged
merged 2 commits into from
Aug 1, 2023
Merged

Conversation

xuzuodong
Copy link
Contributor

@xuzuodong xuzuodong commented Jul 28, 2023

Description

Vue 3.3 provides a new way to define props, which leverages named tuples:

const emit = defineEmits<{
  change: [id: number]
  update: [value: string]
}>()

However, I didn't find a ESLint rule that checks spaces between colon in named tuples. It would be nice to have one.

// good
type T = [i: number]

const emit = defineEmits<{
    change: [id: number]
    update: [value: string]
}>()
// bad
type T = [i:number]
type T = [i : number]

const emit = defineEmits<{
    change: [id:number]
    update: [value:string]
}>()

Linked Issues

Additional context

@xuzuodong xuzuodong force-pushed the feat/named-tuple-spacing branch from 97d3368 to cfb49f9 Compare July 28, 2023 10:26
@antfu antfu merged commit 0ff5e45 into antfu:main Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants