Closed TheHolyWaffle closed 1 month ago
apply-release-plan
When having prettier version 3.1.1 or higher installed. It will not respect the prettier configuration when running changeset version.
prettier
3.1.1
changeset version
This results in CHANGELOG.md files being created with invalid formatting, resulting in broken CI checks on formatting.
CHANGELOG.md
The problem happens at this line: https://github.com/changesets/changesets/blob/0bf89b3709e3e3df6ed5dbb8ece0fb000a55d5f4/packages/apply-release-plan/src/index.ts#L136
prettierConfig is null even though a .prettierrc file is present.
prettierConfig
.prettierrc
This is caused by changes introduced in 3.1.1 to how .prettierrc config is found. See changelog notes: https://github.com/prettier/prettier/blob/main/CHANGELOG.md#311
Changing it to this fixes the prettier config resolving:
let prettierConfig = await prettierInstance.resolveConfig(cwd + '/package.json');
(Workaround for now is to run prettier --write . after using changeset version)
prettier --write .
Affected Packages
apply-release-plan
Problem
When having
prettier
version3.1.1
or higher installed. It will not respect the prettier configuration when runningchangeset version
.This results in
CHANGELOG.md
files being created with invalid formatting, resulting in broken CI checks on formatting.The problem happens at this line: https://github.com/changesets/changesets/blob/0bf89b3709e3e3df6ed5dbb8ece0fb000a55d5f4/packages/apply-release-plan/src/index.ts#L136
prettierConfig
is null even though a.prettierrc
file is present.This is caused by changes introduced in
3.1.1
to how.prettierrc
config is found. See changelog notes: https://github.com/prettier/prettier/blob/main/CHANGELOG.md#311Proposed solution
Changing it to this fixes the prettier config resolving: