-
-
Notifications
You must be signed in to change notification settings - Fork 45
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 support for verbatimModuleSyntax #242
Comments
Ahh... I think I found the issue. The prettier version needs to be updated it is called in the |
Here is what I would recommend for a fix const formatContent = async (fileContent: string, filePath: string) => {
// get the existing prettier config if it exists
const prettierConfig = await prettier.resolveConfig(filePath);
// use the existing prettier config along with the defaults to format the file content
return await prettier.format(fileContent, { singleQuote: true, ...prettierConfig, parser: 'typescript' });
}; and adjust the write file method to pass the output file as well as await the formatContent function since it is now async. This has the benefit of using the user's existing prettier config if they have one while still having the defaults if they don't. This change would require a prettier write across the entire codebase as there have been some changes so it might result in a lot of files touched. @kreuzerk - let me know if you want a PR as I have made the required changes locally to test. |
…tier version * adds support for verbatimModuleSyntax * adds support for user defined prettier config * updates prettier and related dependencies to latest versions BREAKING CHANGE: Typescript < 3.8 is no longer supported, please update to typescript >= 3.8 COMPLETES: nivekcode#242
…tier version * adds support for verbatimModuleSyntax * adds support for user defined prettier config * updates prettier and related dependencies to latest versions BREAKING CHANGE: Typescript < 3.8 is no longer supported, please update to typescript >= 3.8 COMPLETES: nivekcode#242
@kreuzerk & @felipeplets - I have made the required changes in PR #243. Because this requires a newer version of prettier it did require running The updated prettier version has a different API and no longer uses the parser plugin so that has been removed. I also added support to the tool to grab the existing project's prettier config if it exists if it doesn't exist then we will use the default. I classified this as a breaking change because it implies a minimum version of typescript of 3.8 which I didn't see documented previously. |
Hey @JoA-MoS thx a lot for the PR and the Issue here, I will take a look at this. 👍 |
# [12.0.0](v11.0.1...v12.0.0) (2024-02-18) ### Features * updates generateTypeHelper to use type keyword and updates prettier version ([2f3d9ee](2f3d9ee)), closes [#242](#242) ### BREAKING CHANGES * Typescript < 3.8 is no longer supported, please update to typescript >= 3.8
When using verbatim module syntax flag and the included configuration builds will fail because the model import does not have the type keyword.
.svg-to-tsrc
I am Willing to contribute with a little guidance.
The text was updated successfully, but these errors were encountered: