From 55b5a43a032ada6e2f0b78dc65c5bb16561517f0 Mon Sep 17 00:00:00 2001 From: LitoMore Date: Tue, 17 Sep 2024 09:46:48 +0800 Subject: [PATCH] Bump xo to v0.59.3 (#11781) --- .xo-config.json | 2 +- package.json | 2 +- scripts/build/clean.js | 13 ++++++++----- scripts/build/package.js | 4 ++-- sdk.d.ts | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.xo-config.json b/.xo-config.json index 49d31dd8a..3d48af531 100644 --- a/.xo-config.json +++ b/.xo-config.json @@ -34,7 +34,7 @@ "overrides": [ { "files": ["sdk.mjs", "sdk.d.ts"], - "nodeVersion": ">=14", + "nodeVersion": ">=14.13.1", "rules": { "eslint-comments/disable-enable-pair": "off", "unicorn/no-abusive-eslint-disable": "off" diff --git a/package.json b/package.json index 2dc1ce802..b52444f68 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "svgo": "3.2.0", "svgpath": "2.6.0", "typescript": "5.4.5", - "xo": "0.58.0" + "xo": "0.59.3" }, "scripts": { "build": "node scripts/build/package.js", diff --git a/scripts/build/clean.js b/scripts/build/clean.js index ada054674..485c8e1f9 100644 --- a/scripts/build/clean.js +++ b/scripts/build/clean.js @@ -13,11 +13,14 @@ const __dirname = getDirnameFromImportMeta(import.meta.url); const rootDirectory = path.resolve(__dirname, '..', '..'); const files = ['index.js', 'index.mjs', 'index.d.ts', 'sdk.js']; -const fileExists = (fpath) => - fs - .access(fpath, fs.constants.F_OK) - .then(() => true) - .catch(() => false); +const fileExists = async (fpath) => { + try { + await fs.access(fpath); + return true; + } catch { + return false; + } +}; try { Promise.all( diff --git a/scripts/build/package.js b/scripts/build/package.js index a2b2de2a5..125ff17d4 100644 --- a/scripts/build/package.js +++ b/scripts/build/package.js @@ -11,7 +11,7 @@ import {promises as fs} from 'node:fs'; import path from 'node:path'; -import util from 'node:util'; +import {format} from 'node:util'; import {transform as esbuildTransform} from 'esbuild'; import { collator, @@ -78,7 +78,7 @@ const licenseToObject = (license) => { * @returns {string} The JavaScript object */ const iconToJsObject = (icon) => { - return util.format( + return format( iconObjectTemplate, escape(icon.title), escape(icon.slug), diff --git a/sdk.d.ts b/sdk.d.ts index 4ad8726f4..a61144fc8 100644 --- a/sdk.d.ts +++ b/sdk.d.ts @@ -2,7 +2,7 @@ * @file * Types for Simple Icons SDK. */ - +// eslint-disable-next-line n/file-extension-in-import import type {CustomLicense, SPDXLicense} from './types'; /**