Skip to content

Commit

Permalink
Prettify the generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnplb committed Oct 24, 2023
1 parent 1a6fbac commit 6bb2349
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/icons/generateNewIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ then improved step by step
const path = require("path");
const join = path.join;
const { optimize } = require("svgo");
const prettier = require("prettier");
const fs = require("fs-extra");

const svgDir = join(__dirname, "svg/originals");
Expand Down Expand Up @@ -130,7 +131,10 @@ fs.readFile(timestampFilePath, "utf8", (err, timestamp) => {
.replace(`{/* SVGContent */}`, tsxData);

const tsxFilePath = join(tsxDir, file.replace(".svg", ".tsx"));
fs.writeFileSync(tsxFilePath, componentData);
fs.writeFileSync(
tsxFilePath,
prettier.format(componentData, { parser: "typescript" })
);

// eslint-disable-next-line no-console
console.log("Created .tsx file:", tsxFilePath);
Expand Down

0 comments on commit 6bb2349

Please sign in to comment.