diff --git a/package.json b/package.json index ef7d57f..3d9245f 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "build": "tsc", "build:docs": "npx typedoc", "lint": "prettier --check \"src/**/*.ts\"", + "prettier:write": "prettier --write \"src/**/*.ts\"", "prepare": "yarn build", "test": "jest" }, @@ -37,7 +38,7 @@ "@types/node": "^13.7.7", "@types/promise-retry": "^1.1.3", "jest": "^29.0.0", - "prettier": "^1.18.2", + "prettier": "^3.4.2", "ts-jest": "^29.0.0", "typedoc": "~0.25.13", "typedoc-plugin-missing-exports": "^2.2.0", diff --git a/src/helpers.ts b/src/helpers.ts index 3745707..9dffc2b 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -33,7 +33,7 @@ class Secret { } export function makeSecret(s: string) { - return (new Secret(s) as any) as string; + return new Secret(s) as any as string; } export function isSecret(s: string) { @@ -63,10 +63,10 @@ export function parseNotarizationInfo(info: string): NotarizationInfo { } }; matchToProperty('uuid', /\n *RequestUUID: (.+?)\n/); - matchToProperty('date', /\n *Date: (.+?)\n/, d => new Date(d)); + matchToProperty('date', /\n *Date: (.+?)\n/, (d) => new Date(d)); matchToProperty('status', /\n *Status: (.+?)\n/); matchToProperty('logFileUrl', /\n *LogFileURL: (.+?)\n/); - matchToProperty('statusCode', /\n *Status Code: (.+?)\n/, n => parseInt(n, 10) as any); + matchToProperty('statusCode', /\n *Status Code: (.+?)\n/, (n) => parseInt(n, 10) as any); matchToProperty('statusMessage', /\n *Status Message: (.+?)\n/); if (out.logFileUrl === '(null)') { @@ -77,5 +77,5 @@ export function parseNotarizationInfo(info: string): NotarizationInfo { } export function delay(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/src/notarytool.ts b/src/notarytool.ts index c31103a..fc742af 100644 --- a/src/notarytool.ts +++ b/src/notarytool.ts @@ -72,7 +72,7 @@ export async function isNotaryToolAvailable(notarytoolPath?: string) { export async function notarizeAndWaitForNotaryTool(opts: NotaryToolStartOptions) { d('starting notarize process for app:', opts.appPath); - return await withTempDir(async dir => { + return await withTempDir(async (dir) => { const fileExt = path.extname(opts.appPath); let filePath; if (fileExt === '.dmg' || fileExt === '.pkg') { diff --git a/src/spawn.ts b/src/spawn.ts index 9a2ebec..17327dc 100644 --- a/src/spawn.ts +++ b/src/spawn.ts @@ -18,7 +18,7 @@ export const spawn = ( 'spawning cmd:', cmd, 'args:', - args.map(arg => (isSecret(arg) ? '*********' : arg)), + args.map((arg) => (isSecret(arg) ? '*********' : arg)), 'opts:', opts, ); @@ -28,10 +28,10 @@ export const spawn = ( child.stdout!.on('data', dataHandler); child.stderr!.on('data', dataHandler); return new Promise((resolve, reject) => { - child.on('error', err => { + child.on('error', (err) => { reject(err); }); - child.on('exit', code => { + child.on('exit', (code) => { d(`cmd ${cmd} terminated with code: ${code}`); resolve({ code, diff --git a/yarn.lock b/yarn.lock index 0f28e18..046544a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2062,10 +2062,10 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -prettier@^1.18.2: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f" + integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ== pretty-format@^29.0.0, pretty-format@^29.3.1: version "29.3.1"