Skip to content

Commit 318a317

Browse files
committed
fix lint
1 parent 470aa92 commit 318a317

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Diff for: package-lock.json

+11-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: tools/generate-svg.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,13 @@ function processAssetsSvgFiles(pattern, opts) {
5050

5151
async function processMaterialFileIcons() {
5252
const files = glob('node_modules/material-icon-theme/icons/*.svg');
53-
// we want the symbols are ordered in the JSON, so manually construct the JSON
54-
const svgSymbols = [];
53+
const svgSymbols = {};
5554
for (const file of files) {
5655
const {data} = await optimizeSvgFile(file, 'fileicon');
5756
const svgName = parse(file).name;
58-
svgSymbols.push(` "${svgName}": "${data.replace(/"/g, `'`)}"`);
57+
svgSymbols[svgName] = data.replace(/"/g, `'`);
5958
}
60-
const output = `{
61-
${svgSymbols.join(',\n')}
62-
}`;
63-
fs.writeFileSync(fileURLToPath(new URL(`../options/fileicon/material-icon-svgs.json`, import.meta.url)), output);
59+
fs.writeFileSync(fileURLToPath(new URL(`../options/fileicon/material-icon-svgs.json`, import.meta.url)), JSON.stringify(svgSymbols, null, 2));
6460

6561
const iconRules = await readFile(fileURLToPath(new URL(`../node_modules/material-icon-theme/dist/material-icons.json`, import.meta.url)));
6662
const iconRulesPretty = JSON.stringify(JSON.parse(iconRules), null, 2);

0 commit comments

Comments
 (0)