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

ftdetect collides with default filetype settings (specifically typescriptreact or tsx) #273

Closed
gadkadosh opened this issue Jan 1, 2021 · 3 comments · Fixed by #279
Closed

Comments

@gadkadosh
Copy link

My experience is specifically with typescriptreact, where vim-prettier changes the default typescriptreact to typescript. This breaks my completion plugin, for example, which depends on typescriptreact for jsx apparently.

The question is why should vim-prettier touch those filetype detections at all? I feel like if they get correctly set by default vim or nvim, vim-prettier shouldn't interfere. Maybe it's from a time when those were not set correctly?

@yzia2000
Copy link
Contributor

It seems to format for me regardless of the filetype. Let me make a pr to adjust this

mitermayer added a commit that referenced this issue Feb 1, 2021
#273 changed tsx filetype to typescriptreact
@gadkadosh
Copy link
Author

Just for my curiosity: why does vim-prettier have to declare filetypes at all? Why not leave that to vim runtime or to specialised plugins? Is it a best practice because it has ftdetects?

@yzia2000
Copy link
Contributor

yzia2000 commented Feb 1, 2021

This is just a guess but I believe they felt that certain filetypes might not interface well with prettier, or probably an early bug fix. I myself would rather stick to vim runtime.

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 a pull request may close this issue.

2 participants