Bump xo to v0.59.3 (#11781)

This commit is contained in:
LitoMore 2024-09-17 09:46:48 +08:00 committed by GitHub
parent 099de86f12
commit 55b5a43a03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 10 deletions

View File

@ -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"

View File

@ -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",

View File

@ -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(

View File

@ -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),

2
sdk.d.ts vendored
View File

@ -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';
/**