Skip to content

Commit

Permalink
chore: pin @types/prettier on JsiiProject (#1855)
Browse files Browse the repository at this point in the history
Addresses the issue described in aws/aws-cdk#20319

---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
Chriscbr authored May 16, 2022
1 parent dd6c68e commit 0eae60e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/cdk/jsii-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@ export class JsiiProject extends TypeScriptProject {
if (this.npmignore) {
this.npmignore.readonly = false;
}

// jsii relies on typescript < 4.0, which causes build errors
// since @types/[email protected] only supports typescript >= 4.2.
// add a yarn resolution to fix this. this should have no effect if
// @types/prettier is not a transitive dependency or if a package manager
// besides yarn is being used
this.package.addField("resolutions", {
"@types/prettier": "2.6.0",
});
}

/**
Expand Down
6 changes: 6 additions & 0 deletions test/__snapshots__/integ.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0eae60e

Please sign in to comment.