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

v4 breaks prettier blob formatting #103

Closed
sitch opened this issue May 31, 2023 · 3 comments · Fixed by #104
Closed

v4 breaks prettier blob formatting #103

sitch opened this issue May 31, 2023 · 3 comments · Fixed by #104
Assignees

Comments

@sitch
Copy link

sitch commented May 31, 2023

When using prettier to directly format a string, i.e.:

import prettier from "prettier"

prettier.format(content, options)

This raises an error because filePath isn't always available for the check:

Should be able to just use an option chain on that value filepath?.endsWith(".ts")

@IanVS
Copy link
Owner

IanVS commented May 31, 2023

Yeah that sounds reasonable, would you like to submit a PR?

@thebuilder
Copy link

Also ran into this. Came around it by removing the plugins from options for now. (Which also disables this plugin).

Was also thinking the optional chain is the right fix. 👍

@sitch
Copy link
Author

sitch commented Jun 1, 2023

@IanVS happy to send a PR.

@IanVS IanVS closed this as completed in 1a6463b Jun 1, 2023
@IanVS IanVS closed this as completed in #104 Jun 1, 2023
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.

3 participants