prisma-kysely
prisma-kysely copied to clipboard
fix: Prettier v3 and up resolveConfig broken
Fix for issue #94
Hey, sorry for the late reply. Are you sure this doesn't break prettier configs that are specified in package.json files for example?
Okay interesting. It seems like the resolveConfig method wants the path to the source file in question. Maybe we can pass in the destination path for the generated file here instead of .prettierrc
?
https://github.com/prettier/prettier/blob/main/docs/api.md#prettierresolveconfigfileurlorpath--options
Hey, sorry for the late reply. Are you sure this doesn't break prettier configs that are specified in package.json files for example?
how about just calling resolveConfig() without parameter ? I tested on my end and it works.
Okay interesting. It seems like the resolveConfig method wants the path to the source file in question. Maybe we can pass in the destination path for the generated file here instead of
.prettierrc
?https://github.com/prettier/prettier/blob/main/docs/api.md#prettierresolveconfigfileurlorpath--options
I don't understand this, don't you want to pass user's project prettier config file into resolveConfig ?
@wikes82 If I understand correctly they want the path to the file that prettier is meant to be run on. That is the path to the .ts source file. If calling resolveConfig
without a file works I guess that would be fine. It must search from the current working directory and up, but that might be ambiguous in some cases. What do you think?
@wikes82 If I understand correctly they want the path to the file that prettier is meant to be run on. That is the path to the .ts source file. If calling
resolveConfig
without a file works I guess that would be fine. It must search from the current working directory and up, but that might be ambiguous in some cases. What do you think?
Yes, passing the generated files folder path works too. Should we do a fallback ? call resolveConfig without param first, then if the config still null, we call with generated files folder path? To pass in generated folder path, we will need to change writeFileSafely function to accept GeneratorOptions right? will you be ok with it?
Would be useful if we could skip prettier formatting altogether. This step is taking out 3-4s of our build pipeline.
Wdyt @valtyr?