-
Notifications
You must be signed in to change notification settings - Fork 12
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
How to tell prettier
to use json parser instead of default javascript parser for package.json?
#101
Comments
prettier
to use json parser instead of javascript for package.json?prettier
to use json parser instead of default javascript parser for package.json?
C-u M-x |
I'll find some time to look at this soon. @jangid it sounds like a bug, it should use the correct parser by default. There's been commits to that effect before, but maybe something has changed in latest Prettier. |
@jangid I've just had a look -- this seems to be working for me. What output do you get when you switch to some If that's not what you're getting, can you check that these parsers are enabled in your customization? ( |
The output of But i still get this error
This works fine with CLI prettier. and the |
Ah, I think I know what it is. You're using I know this isn't ideal, really it should be using the same parser that Prettier CLI uses regardless of mode. I'm planning to change that. Hope you can work around it for now using |
Yes. This worked. I'll use this workaround till this is fixed. Thanks a lot for investigating this and for the nice package. |
Just installing https://github.com/joshwnj/json-mode solved the problem. Not sure if this will be needed |
This is more a question than bug-report. I couldn't find any forum link so posting it here. Others might as well find this useful.
I could not find a configuration in Info manual for setting prettier to use JSON parser for package.json file. By default it is using some javascript parser which is producing error. Please add this section to manual. Also please add an answer here. Thanks.
The text was updated successfully, but these errors were encountered: