diff --git a/package.json b/package.json index 64c5029..3a36869 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "lint": "eslint src --ext ts", "test": "node ./out/test/runTest.js", "prettier:write": "prettier --write \"src/**/*.{ts, js}\"", - "prettier:verify": "prettier --check \"src/**/*.{ts, js}\"" + "prettier:verify": "prettier --list-different \"src/**/*.{ts, js}\"" }, "devDependencies": { "@types/glob": "^8.1.0", diff --git a/src/commands/landingPageCommand.ts b/src/commands/landingPageCommand.ts index a5475a2..83197a2 100644 --- a/src/commands/landingPageCommand.ts +++ b/src/commands/landingPageCommand.ts @@ -80,7 +80,9 @@ export class LandingPageCommand { */ static async configureRecordListCard(uem: UEMBuilder): Promise { const selectedItem = await UIUtils.showQuickPick( - l10n.t('Select which sObject you want to display on the Record List.'), + l10n.t( + 'Select which sObject you want to display on the Record List.' + ), l10n.t('Retrieving sObjects from your org, please wait...'), () => { return new Promise(async (resolve, reject) => { @@ -110,13 +112,15 @@ export class LandingPageCommand { const finishedOption: QuickPickItem = { label: l10n.t('-- Finished --'), - detail: l10n.t('I don\'t want any more fields to be displayed.') + detail: l10n.t("I don't want any more fields to be displayed.") }; // Prompt user for up to 3 fields. The first request we will retrieve the fields and show a progress // message const selectedFieldPickItem1 = await UIUtils.showQuickPick( - l10n.t('Select which field you want to display as the primary field.'), + l10n.t( + 'Select which field you want to display as the primary field.' + ), l10n.t('Retrieving list of fields for sObject.'), () => { return new Promise(async (resolve, reject) => { @@ -142,7 +146,9 @@ export class LandingPageCommand { // get optional field 2 -- do not show a progress message. const selectedFieldPickItem2 = await UIUtils.showQuickPick( - l10n.t('Select which field you want to display as the second field (or Finished to skip).'), + l10n.t( + 'Select which field you want to display as the second field (or Finished to skip).' + ), undefined, () => { return new Promise(async (resolve, reject) => { @@ -165,7 +171,9 @@ export class LandingPageCommand { let selectedFieldPickItem3: QuickPickItem; if (selectedFieldPickItem2.label !== finishedOption.label) { selectedFieldPickItem3 = await UIUtils.showQuickPick( - l10n.t('Select which field you want to display as the third field (or Finished to skip).'), + l10n.t( + 'Select which field you want to display as the third field (or Finished to skip).' + ), undefined, () => { return new Promise( @@ -218,7 +226,9 @@ export class LandingPageCommand { const cardTypes: QuickPickItem[] = [ { label: `${LandingPageCommand.GLOBAL_ACTIONS_CARD_LABEL}`, - description: l10n.t('A card showing the LWC Global Quick Actions defined in the org.') + description: l10n.t( + 'A card showing the LWC Global Quick Actions defined in the org.' + ) }, { label: `${LandingPageCommand.RECORD_LIST_CARD_LABEL}`, @@ -226,7 +236,9 @@ const cardTypes: QuickPickItem[] = [ }, { label: `${LandingPageCommand.TIMED_LIST_CARD_LABEL}`, - description: l10n.t('A card showing a list of records filtered and sorted by a date/time range.') + description: l10n.t( + 'A card showing a list of records filtered and sorted by a date/time range.' + ) }, { label: '', diff --git a/src/commands/templateChooserCommand.ts b/src/commands/templateChooserCommand.ts index c93510f..e7e4362 100644 --- a/src/commands/templateChooserCommand.ts +++ b/src/commands/templateChooserCommand.ts @@ -48,7 +48,9 @@ export class TemplateChooserCommand { }, { label: l10n.t('Retail Execution'), - detail: l10n.t('Global quick actions with new Opportunity, new Lead, and more.'), + detail: l10n.t( + 'Global quick actions with new Opportunity, new Lead, and more.' + ), filename: 'landing_page_retail_execution.json' } ]; diff --git a/src/test/suite/webviews.test.ts b/src/test/suite/webviews.test.ts index 35ac96a..ff50a8e 100644 --- a/src/test/suite/webviews.test.ts +++ b/src/test/suite/webviews.test.ts @@ -13,7 +13,7 @@ import { afterEach, beforeEach } from 'mocha'; import * as fs from 'fs'; suite('InstructionsWebviewProvider Test Suite', () => { - const extensionUri = Uri.parse("file:///tmp/testdir"); + const extensionUri = Uri.parse('file:///tmp/testdir'); beforeEach(function () {}); @@ -22,29 +22,28 @@ suite('InstructionsWebviewProvider Test Suite', () => { }); test('Locale-specific file is returned if it exists', async () => { - const languageStub = sinon.stub(env, "language"); - languageStub.value("es"); + const languageStub = sinon.stub(env, 'language'); + languageStub.value('es'); - const fsExistStub = sinon.stub(fs, "existsSync"); + const fsExistStub = sinon.stub(fs, 'existsSync'); fsExistStub.returns(true); const provider = new InstructionsWebviewProvider(extensionUri); - const path = provider.getLocaleContentPath(extensionUri, "test.html"); + const path = provider.getLocaleContentPath(extensionUri, 'test.html'); - assert.equal(path, "test.es.html"); + assert.equal(path, 'test.es.html'); }); test('Defaults to english file if locale-specific file does not exist.', async () => { - const languageStub = sinon.stub(env, "language"); - languageStub.value("es"); + const languageStub = sinon.stub(env, 'language'); + languageStub.value('es'); - const fsExistStub = sinon.stub(fs, "existsSync"); + const fsExistStub = sinon.stub(fs, 'existsSync'); fsExistStub.returns(false); const provider = new InstructionsWebviewProvider(extensionUri); - const path = provider.getLocaleContentPath(extensionUri, "test.html"); + const path = provider.getLocaleContentPath(extensionUri, 'test.html'); - assert.equal(path, "test.html"); + assert.equal(path, 'test.html'); }); - }); diff --git a/src/webviews.ts b/src/webviews.ts index fe0850f..f290546 100644 --- a/src/webviews.ts +++ b/src/webviews.ts @@ -53,7 +53,10 @@ export class InstructionsWebviewProvider { this.extensionUri, contentPath ); - const htmlPath = vscode.Uri.joinPath(this.extensionUri, localeContentPath); + const htmlPath = vscode.Uri.joinPath( + this.extensionUri, + localeContentPath + ); const messagingJsPath = vscode.Uri.joinPath( this.extensionUri, MESSAGING_JS_PATH