Closed gmathieu closed 7 months ago
@gmathieu is this backwards compatible with previous versions of Prettier? wondering if this could break for people if they upgrade to this version and are not on the latest Prettier version
:tada: This PR is included in version 8.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@skovy it should be backwards compatible. As I understand it, Prettier was always meant to resolve its config based on a given file. Thanks for the quick turnaround!
Why
Resolves #219.
Recent versions of Prettier have changed the logic for resolving the config. This line appears to be the culprit:
When
attemptPrettier
is called, it passesprocess.cwd()
as the "file" in the snippet above. It's common fortyped-scss-modules
to be executed from the project root, so the config search starts outside the project root and doesn't find anything.What?
attemptPrettier
resolves the prettier config based on the generated file path instead ofprocess.cwd()
.