diff --git a/.xo-config.json b/.xo-config.json index 5bc1ec3f..e30f926f 100644 --- a/.xo-config.json +++ b/.xo-config.json @@ -3,9 +3,6 @@ "space": 2, "plugins": ["import"], "rules": { - "n/no-unsupported-features": "off", - "n/no-unsupported-features/node-builtins": "off", - "n/file-extension-in-import": "off", "sort-imports": [ "error", { @@ -29,7 +26,8 @@ "warnOnUnassignedImports": true, "newlines-between": "never" } - ] + ], + "no-console": ["error", {"allow": ["warn", "error"]}] }, "overrides": [ { diff --git a/scripts/add-icon-data.js b/scripts/add-icon-data.js index 7ee85e25..d48dc378 100644 --- a/scripts/add-icon-data.js +++ b/scripts/add-icon-data.js @@ -121,9 +121,10 @@ try { : undefined, }; - console.log( + process.stdout.write( 'About to write the following to simple-icons.json:\n' + - JSON.stringify(answers, null, 4), + JSON.stringify(answers, null, 4) + + '\n', ); if ( @@ -134,14 +135,14 @@ try { iconsData.icons.push(answers); iconsData.icons.sort((a, b) => collator.compare(a.title, b.title)); await writeIconsData(iconsData); - console.log(chalk.green('\nData written successfully.')); + process.stdout.write(chalk.green('\nData written successfully.\n')); } else { - console.log(chalk.red('\nAborted.')); + process.stdout.write(chalk.red('\nAborted.\n')); process.exit(1); } } catch (error) { if (error instanceof ExitPromptError) { - console.log(chalk.red('\nAborted.')); + process.stdout.write(chalk.red('\nAborted.\n')); process.exit(1); } diff --git a/scripts/get-filename.js b/scripts/get-filename.js index 29118cbc..e20f4c12 100644 --- a/scripts/get-filename.js +++ b/scripts/get-filename.js @@ -14,5 +14,7 @@ if (process.argv.length < 3) { } else { const brandName = process.argv[2]; const filename = titleToSlug(brandName); - console.log(`For '${brandName}' use the file 'icons/${filename}.svg'`); + process.stdout.write( + `For '${brandName}' use the file 'icons/${filename}.svg'\n`, + ); } diff --git a/scripts/release/update-sdk-ts-defs.js b/scripts/release/update-sdk-ts-defs.js index fe934154..9856c31e 100644 --- a/scripts/release/update-sdk-ts-defs.js +++ b/scripts/release/update-sdk-ts-defs.js @@ -36,9 +36,10 @@ const generateSdkMts = async () => { ); } catch (error) { await fs.writeFile(sdkMjs, originalSdkMjsContent); - console.log( + process.stdout.write( `Error ${error.status} generating Typescript` + - ` definitions: '${error.message}'`, + ` definitions: '${error.message}'` + + '\n', ); process.exit(1); } @@ -67,9 +68,10 @@ const generateSdkTs = async () => { try { execSync('npx prettier -w sdk.d.ts'); } catch (error) { - console.log( + process.stdout.write( `Error ${error.status} executing Prettier` + - ` to prettify SDK TS definitions: '${error.message}'`, + ` to prettify SDK TS definitions: '${error.message}'` + + '\n', ); process.exit(1); }