Skip to content

Commit 816c421

Browse files
committedJun 29, 2023
fix: update postinstall.ts to dynamically import prettier-config
Modified the writeFileAsync function in postinstall.ts to import the "@anolilab/prettier-config" dynamically instead of directly including it in the export statement. This change allows more flexibility and easier updates to the configuration in the future. Signed-off-by: prisis <d.bannert@anolilab.de>
1 parent 220dafb commit 816c421

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎packages/prettier-config/src/postinstall.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ ${JSON.stringify(content, undefined, 4)}\n`);
4646

4747
return writeFileAsync(
4848
prettierPath,
49-
`${packageIsTypeModule ? "export default" : "module.exports ="} ${JSON.stringify(content, undefined, 2).replace(
50-
"rangeEnd: null,",
51-
"rangeEnd: Number.POSITIVE_INFINITY,",
52-
)}\n`,
49+
`${packageIsTypeModule ? 'import config from "@anolilab/prettier-config";' : 'var config = require("@anolilab/prettier-config");'}
50+
51+
${packageIsTypeModule ? "export default" : "module.exports ="} {
52+
...config,
53+
}
54+
`,
5355
"utf8",
5456
);
5557
};

0 commit comments

Comments
 (0)
Please sign in to comment.