diff --git a/packages/icons/package.json b/packages/icons/package.json index 83272a85bd6..277472dd3f4 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -54,6 +54,7 @@ "css-loader": "^4.3.0", "mini-css-extract-plugin": "^2.7.6", "mkdirp": "^1.0.4", + "prettier": "^3.0.3", "react": "^17.0.2", "react-use": "^17.4.0", "string-replace-loader": "^2.3.0", diff --git a/packages/icons/scripts/typescript.js b/packages/icons/scripts/typescript.js index 9d0a8ce3d38..d4c6911d5af 100644 --- a/packages/icons/scripts/typescript.js +++ b/packages/icons/scripts/typescript.js @@ -23,9 +23,8 @@ fs.readdirSync(iconSrcFolder) }); }); -fs.writeFileSync( - path.join(srcFolder, 'typeUtils.ts'), - prettier.format( +prettier + .format( ` export declare type IconName = ${icons} @@ -56,5 +55,7 @@ export declare type Icon = { }; `, { singleQuote: true, parser: 'typescript' }, - ), -); + ) + .then(data => { + fs.writeFileSync(path.join(srcFolder, 'typeUtils.ts'), data); + });