-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add babylon
as default Prettier parser
#2220
Add babylon
as default Prettier parser
#2220
Conversation
I see an explanation in this comment, but I believe it's a wrong assumption. If there is no file extension, we need to explicitly set a parser, because prettier has no idea what type of file is being passed in. So the two solutions are:
|
Actually, the first is a better solution. There's never a case, when there is no file extension, where you'd want prettier to auto-detect the file type, because it basically cannot. That's why there's a default parser. I'll change this PR to reflect that. |
babylon
parser for javascript
filetypesbabylon
as default Prettier parser
https://prettier.io/docs/en/options.html#parser It does seem like |
I wonder if we might have to use the newer name for the parser for newer |
@w0rp I added a version check to use |
Cheers! 🍻 |
I'm not sure why the default
let l:parser = 'babylon'
was removed.babylon
is the default parser for prettier.But since it was removed, this fixer doesn't work for regular Javascript files. This PR will connect
javascript
file-types to thebabylon
parser, while keeping the currentlet l:parser = ''
.