MCPcopy Index your code
hub / github.com/changesets/changesets / getPrettierInstance

Function getPrettierInstance

packages/apply-release-plan/src/index.ts:20–29  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

18import versionPackage from "./version-package";
19
20function getPrettierInstance(cwd: string): typeof prettier {
21 try {
22 return require(require.resolve("prettier", { paths: [cwd] }));
23 } catch (err) {
24 if (!err || (err as any).code !== "MODULE_NOT_FOUND") {
25 throw err;
26 }
27 return prettier;
28 }
29}
30
31function stringDefined(s: string | undefined): s is string {
32 return !!s;

Callers 1

applyReleasePlanFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected