From 04fa5a14536aca01dbf545f972b9883797730535 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Mon, 28 Aug 2023 21:05:20 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/cli/telemetry/index.ts | 2 +- packages/astro/src/core/messages.ts | 22 +++++++++++----------- packages/telemetry/src/index.ts | 4 ++-- packages/telemetry/test/index.test.js | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/astro/src/cli/telemetry/index.ts b/packages/astro/src/cli/telemetry/index.ts index 1c9703a9c..b702a5baa 100644 --- a/packages/astro/src/cli/telemetry/index.ts +++ b/packages/astro/src/cli/telemetry/index.ts @@ -11,7 +11,7 @@ export async function notify() { await telemetry.notify(() => { console.log(msg.telemetryNotice() + '\n'); return true; - }) + }); } export async function update(subcommand: string, { flags }: TelemetryOptions) { diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts index 9feecb26a..974bf79bf 100644 --- a/packages/astro/src/core/messages.ts +++ b/packages/astro/src/core/messages.ts @@ -107,28 +107,28 @@ export function serverStart({ export function telemetryNotice() { const headline = `${cyan('◆')} Astro collects completely anonymous usage data.`; - const why = dim(' This optional program helps shape our roadmap.') + const why = dim(' This optional program helps shape our roadmap.'); const disable = dim(' Run `npm run astro telemetry disable` to opt-out.'); const details = ` Details: ${underline('https://astro.build/telemetry')}`; - return [headline, why, disable, details].map(v => ' ' + v).join('\n'); + return [headline, why, disable, details].map((v) => ' ' + v).join('\n'); } export function telemetryEnabled() { - return `${green('◉')} Anonymous telemetry is now ${bgGreen( - black(' enabled ') - )}\n ${dim('Thank you for improving Astro!')}\n`; + return `${green('◉')} Anonymous telemetry is now ${bgGreen(black(' enabled '))}\n ${dim( + 'Thank you for improving Astro!' + )}\n`; } export function telemetryDisabled() { - return `${yellow('◯')} Anonymous telemetry is now ${bgYellow( - black(' disabled ') - )}\n ${dim('We won\'t ever record your usage data.')}\n`; + return `${yellow('◯')} Anonymous telemetry is now ${bgYellow(black(' disabled '))}\n ${dim( + "We won't ever record your usage data." + )}\n`; } export function telemetryReset() { - return `${cyan('◆')} Anonymous telemetry has been ${bgCyan( - black(' reset ') - )}\n ${dim('You may be prompted again.')}\n`; + return `${cyan('◆')} Anonymous telemetry has been ${bgCyan(black(' reset '))}\n ${dim( + 'You may be prompted again.' + )}\n`; } export function fsStrictWarning() { diff --git a/packages/telemetry/src/index.ts b/packages/telemetry/src/index.ts index b63ff9c23..e103d2a16 100644 --- a/packages/telemetry/src/index.ts +++ b/packages/telemetry/src/index.ts @@ -115,13 +115,13 @@ export class AstroTelemetry { // The end-user has already been notified about our telemetry integration! // Don't bother them about it again. if (this.isValidNotice()) { - this.debug(`[notify] last notified on ${this.notifyDate}`) + this.debug(`[notify] last notified on ${this.notifyDate}`); return; } const enabled = await callback(); this.config.set(KEY.TELEMETRY_NOTIFY_DATE, new Date().valueOf().toString()); this.config.set(KEY.TELEMETRY_ENABLED, enabled); - this.debug(`[notify] telemetry has been ${enabled ? 'enabled' : 'disabled'}`) + this.debug(`[notify] telemetry has been ${enabled ? 'enabled' : 'disabled'}`); } async record(event: TelemetryEvent | TelemetryEvent[] = []) { diff --git a/packages/telemetry/test/index.test.js b/packages/telemetry/test/index.test.js index a8929329e..40afbe184 100644 --- a/packages/telemetry/test/index.test.js +++ b/packages/telemetry/test/index.test.js @@ -15,18 +15,18 @@ function setup() { telemetry.debug.enabled = true; telemetry.debug.log = (...args) => logs.push(args); - return { telemetry, config, logs } + return { telemetry, config, logs }; } -describe('AstroTelemetry', () => { +describe('AstroTelemetry', () => { let oldCI; before(() => { oldCI = process.env.CI; // Stub process.env.CI to `false` process.env.CI = 'false'; - }) + }); after(() => { process.env.CI = oldCI; - }) + }); it('initializes when expected arguments are given', () => { const { telemetry } = setup(); expect(telemetry).to.be.instanceOf(AstroTelemetry);