diff --git a/lint-staged.config.js b/lint-staged.config.js index a943669..529f235 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -7,15 +7,15 @@ const micromatch = require("micromatch") const prettier = require("prettier") -// Figure out all extensions supported by Prettier. -const prettierSupportedExtensions = prettier - .getSupportInfo() - .languages.map(({ extensions }) => extensions) - .flat() - const addQuotes = (a) => `"${a}"` -module.exports = (allStagedFiles) => { +module.exports = async (allStagedFiles) => { + // Figure out all extensions supported by Prettier. + const prettierSupportedExtensions = await prettier + .getSupportInfo() + .languages.map(({ extensions }) => extensions) + .flat() + // Match files for ESLint const eslintFiles = micromatch(allStagedFiles, ["**/*.{js,ts}"], { dot: true, @@ -25,7 +25,7 @@ module.exports = (allStagedFiles) => { const prettierFiles = micromatch( allStagedFiles, prettierSupportedExtensions.map((extension) => `**/*${extension}`), - { dot: true } + { dot: true }, ) // Array of linters to be run in this sequence. diff --git a/scripts/build-optimized-svg.ts b/scripts/build-optimized-svg.ts index a2bb125..95e2fbb 100644 --- a/scripts/build-optimized-svg.ts +++ b/scripts/build-optimized-svg.ts @@ -22,7 +22,7 @@ export async function buildOptimizedSVG(): Promise { // iterate counter + output to inform user counter += 1 console.log( - `${counter}/${Object.keys(ops).length} - ${path.normalize(`${TEMP_DIR}/svg/${op}.svg`)}` + `${counter}/${Object.keys(ops).length} - ${path.normalize(`${TEMP_DIR}/svg/${op}.svg`)}`, ) // optimize svg with svgo diff --git a/src/functions.ts b/src/functions.ts index 35e6c26..c6cf476 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -18,7 +18,7 @@ function attributesToString(attributes: Record): string { */ export function getSVGIcon( op: Operator, - userAttributes?: { [key: string]: unknown } + userAttributes?: { [key: string]: unknown }, ): string | Error { // check if parameter is an object if (userAttributes && typeof userAttributes !== "object") {