Skip to content

[vue] fix: *.vue with lang='tsx' is not formatted #3763

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

Merged
merged 1 commit into from
Jan 18, 2018
Merged

[vue] fix: *.vue with lang='tsx' is not formatted #3763

merged 1 commit into from
Jan 18, 2018

Conversation

wonderful-panda
Copy link
Contributor

vue-language-server requires that lang must be "tsx" when <script> contains TSX syntax, like below:

<script lang="tsx">
import { VNode } from "vue";
export default {
  render(): VNode { return <div>foo</div>; }
}
</script>

But prettier does not treat this code as TypeScript. This PR will fix this problem.

@duailibe duailibe merged commit 3f788d4 into prettier:master Jan 18, 2018
@duailibe
Copy link
Member

Thanks!

@azz
Copy link
Member

azz commented Jan 18, 2018

I didn't know vue used JSX?

@wonderful-panda
Copy link
Contributor Author

Yes. Using template is a most standard way, but JSX is also supported.
https://vuejs.org/v2/guide/render-function.html#JSX

robert-j-webb pushed a commit to robert-j-webb/prettier that referenced this pull request Jan 18, 2018
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants