diff --git a/scripts/generate-theme-doc.js b/scripts/generate-theme-doc.js index e8b83ad..8ef3c20 100644 --- a/scripts/generate-theme-doc.js +++ b/scripts/generate-theme-doc.js @@ -1,5 +1,5 @@ import fs from "fs"; -import { themes } from "../themes/index"; +import { themes } from "../themes/index.js"; const TARGET_FILE = "./themes/README.md"; const REPO_CARD_LINKS_FLAG = ""; @@ -65,14 +65,14 @@ const createTableItem = ({ link, label, isRepoCard }) => { }; const generateTable = ({ isRepoCard }) => { const rows = []; - const themes = Object.keys(themes).filter( + const themesFiltered = Object.keys(themes).filter( (name) => name !== (!isRepoCard ? "default_repocard" : "default"), ); - for (let i = 0; i < themes.length; i += 3) { - const one = themes[i]; - const two = themes[i + 1]; - const three = themes[i + 2]; + for (let i = 0; i < themesFiltered.length; i += 3) { + const one = themesFiltered[i]; + const two = themesFiltered[i + 1]; + const three = themesFiltered[i + 2]; let tableItem1 = createTableItem({ link: one, label: one, isRepoCard }); let tableItem2 = createTableItem({ link: two, label: two, isRepoCard }); @@ -84,7 +84,7 @@ const generateTable = ({ isRepoCard }) => { rows.push(`| ${tableItem1} | ${tableItem2} | ${tableItem3} |`); // if it's the last row & the row has no empty space push a new row - if (three && i + 3 === themes.length) { + if (three && i + 3 === themesFiltered.length) { rows.push(`| [Add your theme][add-theme] | | |`); } }