-
-
Notifications
You must be signed in to change notification settings - Fork 543
--prettier-config throws misleading error if custom config isn't JSON #222
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
Comments
That’s a good idea! I think that’s a great add. I’d love a PR if you have time, but if not I’d be happy to add this. |
Thanks, @DangoDev! Unfortunately, I cannot commit to creating a PR in any short-term future. If you have capacity to do it, please go for it. |
No worries. I’ll see if I can get this in for the |
Just released a new npx @manifoldco/swagger-to-ts@next … I added a test and confirmed that |
When I used
--prettier-config .prettierrc.js
I've got an an errorPrettier: couldn’t find '.prettierrc.js' in ...
. It turned out that the error is misleading, as the exception was about config not being a valid JSON.In general, I see more and more people prefer
.eslintrc.js
andprettierrc.js
over JSON, as JavaScript allows sharing configurations through import / export (and it's just nicer than JSON). Haven't found Prettier exposing any API for reading the config file, but it does state in the docs it uses cosmiconfig. It would be great ifswagger-to-ts
also usedcosmiconfig
to read any Prettier config file.The text was updated successfully, but these errors were encountered: