We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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:
filePath
prettier-plugin-sort-imports/src/utils/normalize-plugin-options.ts
Line 91 in e20a9fd
Should be able to just use an option chain on that value filepath?.endsWith(".ts")
filepath?.endsWith(".ts")
The text was updated successfully, but these errors were encountered:
Yeah that sounds reasonable, would you like to submit a PR?
Sorry, something went wrong.
Also ran into this. Came around it by removing the plugins from options for now. (Which also disables this plugin).
plugins
Was also thinking the optional chain is the right fix. 👍
@IanVS happy to send a PR.
1a6463b
IanVS
Successfully merging a pull request may close this issue.
When using prettier to directly format a string, i.e.:
This raises an error because
filePath
isn't always available for the check:prettier-plugin-sort-imports/src/utils/normalize-plugin-options.ts
Line 91 in e20a9fd
Should be able to just use an option chain on that value
filepath?.endsWith(".ts")
The text was updated successfully, but these errors were encountered: