From 054f32205fe246b0990340a1e8f7de2ae456c471 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Thu, 9 May 2019 11:32:42 -0400 Subject: [PATCH] style: update code to pass object format lint rule change --- package.json | 2 +- .../src/autocomplete.component.spec.ts | 66 +++---------- .../src/autocomplete.component.ts | 4 +- .../autofocus/src/autofocus.directive.spec.ts | 4 +- .../autofocus/src/autofocus.directive.ts | 4 +- terminus-ui/button/src/button.component.ts | 4 +- terminus-ui/card/src/card-title.directive.ts | 4 +- terminus-ui/card/src/card.component.ts | 4 +- .../chart/src/amcharts.service.spec.ts | 4 +- terminus-ui/chart/src/chart.component.spec.ts | 44 +++------ terminus-ui/chart/src/chart.component.ts | 4 +- .../src/confirmation-overlay.component.ts | 4 +- .../src/confirmation.directive.ts | 4 +- terminus-ui/copy/src/copy.component.spec.ts | 4 +- terminus-ui/copy/src/copy.component.ts | 4 +- .../csv-entry/src/csv-entry.component.spec.ts | 94 +++++-------------- .../csv-entry/src/csv-entry.component.ts | 8 +- .../src/date-range.component.spec.ts | 8 +- .../date-range/src/date-range.component.ts | 4 +- .../src/accordion/accordion.component.spec.ts | 16 +--- .../src/accordion/accordion.component.ts | 8 +- .../src/expansion-animations.ts | 28 +----- .../src/expansion-panel-action-row.ts | 4 +- .../src/expansion-panel-content.directive.ts | 4 +- .../src/expansion-panel.component.spec.ts | 6 +- ...ion-panel-trigger-description.component.ts | 4 +- ...expansion-panel-trigger-title.component.ts | 4 +- .../src/drop-protection-service.spec.ts | 8 +- .../src/file-upload.component.spec.ts | 48 +++------- .../file-upload/src/selected-file.spec.ts | 12 +-- .../src/form-field.component.spec.ts | 8 +- terminus-ui/form-field/src/label.directive.ts | 4 +- .../form-field/src/prefix.directive.ts | 4 +- .../form-field/src/suffix.directive.ts | 4 +- .../icon-button/src/icon-button.component.ts | 4 +- terminus-ui/input/src/date-adapter.spec.ts | 4 +- terminus-ui/input/src/input.component.spec.ts | 12 +-- terminus-ui/input/src/input.component.ts | 16 +--- .../input/testing/src/test-components.ts | 60 +++--------- terminus-ui/link/src/link.component.ts | 4 +- .../src/loading-overlay.component.ts | 4 +- .../src/loading-overlay.directive.ts | 4 +- .../src/login-form.component.spec.ts | 8 +- .../login-form/src/login-form.component.ts | 4 +- terminus-ui/menu/src/menu.component.spec.ts | 8 +- terminus-ui/menu/src/menu.component.ts | 4 +- .../src/navigation.component.spec.ts | 34 ++----- .../navigation/src/navigation.component.ts | 4 +- .../paginator/src/paginator.component.spec.ts | 20 +--- .../paginator/src/paginator.component.ts | 12 +-- terminus-ui/pipes/src/date/date.pipe.ts | 4 +- .../src/round-number/round-number.pipe.ts | 4 +- .../src/sentence-case/sentence-case.pipe.ts | 4 +- .../pipes/src/time-ago/time-ago.pipe.ts | 4 +- .../pipes/src/title-case/title-case.pipe.ts | 4 +- .../pipes/src/truncate/truncate.pipe.ts | 4 +- .../radio-group/src/radio-group.component.ts | 4 +- .../src/scrollbars.component.spec.ts | 12 +-- .../scrollbars/src/scrollbars.component.ts | 4 +- .../search/src/search.component.spec.ts | 16 +--- terminus-ui/search/src/search.component.ts | 12 +-- .../autocomplete-panel.component.ts | 4 +- .../autocomplete-trigger.directive.ts | 8 +- .../src/option/option-display.directive.ts | 4 +- terminus-ui/select/src/select-animations.ts | 4 +- .../select/src/select.component.spec.ts | 32 ++----- terminus-ui/select/src/select.component.ts | 8 +- .../select/testing/src/test-helpers.ts | 12 +-- terminus-ui/sort/src/sort-animations.ts | 24 ++--- terminus-ui/sort/src/sort.spec.ts | 6 +- .../spacing/src/vertical-spacing.directive.ts | 4 +- .../table/src/table-data-source.spec.ts | 8 +- terminus-ui/table/src/table.component.ts | 4 +- terminus-ui/tabs/src/body/tab-animations.ts | 12 +-- .../tabs/src/body/tab-body.component.ts | 4 +- .../tabs/src/body/tab-content.directive.ts | 4 +- .../tab-collection.component.spec.ts | 26 ++--- .../src/header/tab-header.component.spec.ts | 74 +++------------ .../tabs/src/header/tab-header.component.ts | 4 +- .../tabs/src/ink-bar/ink-bar.component.ts | 4 +- terminus-ui/tabs/src/tab/tab.component.ts | 4 +- .../tabs/testing/src/test-components.ts | 4 +- terminus-ui/toggle/src/toggle.component.ts | 4 +- terminus-ui/tooltip/src/tooltip.component.ts | 4 +- terminus-ui/utilities/src/merge/merge.spec.ts | 8 +- terminus-ui/utilities/src/merge/merge.ts | 4 +- .../src/validation-messages.component.spec.ts | 16 +--- .../src/validation-messages.component.ts | 4 +- .../src/validation-messages.services.spec.ts | 20 +--- yarn.lock | 8 +- 90 files changed, 249 insertions(+), 783 deletions(-) diff --git a/package.json b/package.json index b1580613a..dfb820d69 100644 --- a/package.json +++ b/package.json @@ -201,7 +201,7 @@ "@semantic-release/github": "^5.2.10", "@semantic-release/npm": "^5.1.4", "@semantic-release/release-notes-generator": "^7.1.4", - "@terminus/eslint-config-frontend": "^1.0.2", + "@terminus/eslint-config-frontend": "^1.0.3", "@terminus/tslint-config-frontend": "^1.0.3", "@types/jest": "^23.3.13", "@types/node": "^10.12.19", diff --git a/terminus-ui/autocomplete/src/autocomplete.component.spec.ts b/terminus-ui/autocomplete/src/autocomplete.component.spec.ts index ad32cfef0..f38e91727 100644 --- a/terminus-ui/autocomplete/src/autocomplete.component.spec.ts +++ b/terminus-ui/autocomplete/src/autocomplete.component.spec.ts @@ -15,9 +15,7 @@ import { describe(`TsAutocompleteComponent`, function() { let component: TsAutocompleteComponent; - const opt1 = { - id: 1, - }; + const opt1 = {id: 1}; let trigger: jest.Mocked; beforeEach(() => { @@ -150,11 +148,7 @@ describe(`TsAutocompleteComponent`, function() { expect(component.selectedOptions.length).toEqual(0); component.selectionsControl = new FormControl(); - const initial = [{ - id: 1, - }, { - id: 2, - }]; + const initial = [{id: 1}, {id: 2}]; component.initialSelections = initial; expect(component.selectedOptions.length).toEqual(2); @@ -163,20 +157,12 @@ describe(`TsAutocompleteComponent`, function() { test(`should not mutate the original array`, () => { - const initial = [{ - id: 1, - }, { - id: 2, - }]; + const initial = [{id: 1}, {id: 2}]; component.initialSelections = initial; component.multiple = v => v.id; const event: any = createMockInstance(MatAutocompleteSelectedEvent); - const option = { - id: 3, - }; - event.option = { - value: option, - }; + const option = {id: 3}; + event.option = {value: option}; component.selectOption(event); expect(component.selectedOptions).toContain(option); @@ -190,9 +176,7 @@ describe(`TsAutocompleteComponent`, function() { beforeEach(() => { jest.useFakeTimers(); - component.query = { - next: jest.fn(), - } as any; + component.query = {next: jest.fn()} as any; }); afterEach(() => { @@ -265,9 +249,7 @@ describe(`TsAutocompleteComponent`, function() { describe(`selectOption`, () => { const event: any = createMockInstance(MatAutocompleteSelectedEvent); - event.option = { - value: opt1, - }; + event.option = {value: opt1}; beforeEach(() => { component.selectionsControl = new FormControl(); @@ -338,9 +320,7 @@ describe(`TsAutocompleteComponent`, function() { expect(component.selectedOptions).toEqual([opt1]); expect(component.selectionsControl.value).toEqual([opt1]); - const result = component.deselectOption({ - id: 2, - }); + const result = component.deselectOption({id: 2}); expect(result).toEqual(undefined); expect(component.selectedOptions).toEqual([opt1]); @@ -366,19 +346,9 @@ describe(`TsAutocompleteComponent`, function() { describe(`handleBlur`, () => { - const eventDiv = { - relatedTarget: { - nodeName: 'DIV', - }, - } as any; - const eventOpt = { - relatedTarget: { - nodeName: 'MAT-OPTION', - }, - } as any; - const eventNoNode = { - relatedTarget: {}, - } as MouseEvent; + const eventDiv = {relatedTarget: {nodeName: 'DIV'}} as any; + const eventOpt = {relatedTarget: {nodeName: 'MAT-OPTION'}} as any; + const eventNoNode = {relatedTarget: {}} as MouseEvent; const eventNoRelatedTarget = {} as KeyboardEvent; @@ -431,11 +401,7 @@ describe(`TsAutocompleteComponent`, function() { beforeEach(() => { component.searchQuery = 'foo'; component.querySubject.next = jest.fn(); - component.input = { - nativeElement: { - value: 'foo', - }, - }; + component.input = {nativeElement: {value: 'foo'}}; component['trigger'] = { panelOpen: jest.fn().mockReturnValue(true), closePanel: jest.fn(), @@ -519,13 +485,9 @@ describe(`TsAutocompleteComponent`, function() { component.ngAfterViewInit(); expect(component.selectedOptions).toEqual([]); - component.selectionsControl.setValue([{ - id: 9, - }]); + component.selectionsControl.setValue([{id: 9}]); - expect(component.selectedOptions).toEqual([{ - id: 9, - }]); + expect(component.selectedOptions).toEqual([{id: 9}]); }); diff --git a/terminus-ui/autocomplete/src/autocomplete.component.ts b/terminus-ui/autocomplete/src/autocomplete.component.ts index eda360228..5bf43cd74 100644 --- a/terminus-ui/autocomplete/src/autocomplete.component.ts +++ b/terminus-ui/autocomplete/src/autocomplete.component.ts @@ -98,9 +98,7 @@ const DEFAULT_MINIMUM_CHARACTERS = 2; selector: 'ts-autocomplete', templateUrl: './autocomplete.component.html', styleUrls: ['./autocomplete.component.scss'], - host: { - class: 'ts-autocomplete', - }, + host: {class: 'ts-autocomplete'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsAutocomplete', diff --git a/terminus-ui/autofocus/src/autofocus.directive.spec.ts b/terminus-ui/autofocus/src/autofocus.directive.spec.ts index 0129d0a02..120570062 100644 --- a/terminus-ui/autofocus/src/autofocus.directive.spec.ts +++ b/terminus-ui/autofocus/src/autofocus.directive.spec.ts @@ -26,9 +26,7 @@ describe(`TsAutofocusDirective`, function() { new ElementRefMock(), new ChangeDetectorRefMock(), ); - directive['elementRef'].nativeElement = { - focus: jest.fn(), - }; + directive['elementRef'].nativeElement = {focus: jest.fn()}; directive['changeDetectorRef'].detectChanges = jest.fn(); directive.tsAutofocus = ''; }; diff --git a/terminus-ui/autofocus/src/autofocus.directive.ts b/terminus-ui/autofocus/src/autofocus.directive.ts index 9b73938c4..b54e2d9aa 100644 --- a/terminus-ui/autofocus/src/autofocus.directive.ts +++ b/terminus-ui/autofocus/src/autofocus.directive.ts @@ -20,9 +20,7 @@ import { coerceBooleanProperty } from '@terminus/ngx-tools/coercion'; * * https://getterminus.github.io/ui-demos-master/components/autofocus */ -@Directive({ - selector: '[tsAutofocus]', -}) +@Directive({selector: '[tsAutofocus]'}) export class TsAutofocusDirective implements AfterViewInit { /** * Store the shouldFocus value diff --git a/terminus-ui/button/src/button.component.ts b/terminus-ui/button/src/button.component.ts index d60a6f673..10ce9f3dd 100644 --- a/terminus-ui/button/src/button.component.ts +++ b/terminus-ui/button/src/button.component.ts @@ -82,9 +82,7 @@ const DEFAULT_COLLAPSE_DELAY_MS = 4000; selector: 'ts-button', templateUrl: './button.component.html', styleUrls: ['./button.component.scss'], - host: { - class: 'ts-button', - }, + host: {class: 'ts-button'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsButton', diff --git a/terminus-ui/card/src/card-title.directive.ts b/terminus-ui/card/src/card-title.directive.ts index 517728ec3..3ce544bc9 100644 --- a/terminus-ui/card/src/card-title.directive.ts +++ b/terminus-ui/card/src/card-title.directive.ts @@ -13,9 +13,7 @@ import { TsStyleThemeTypes } from '@terminus/ui/utilities'; import { TsCardComponent } from './card.component'; -@Directive({ - selector: '[tsCardTitle]', -}) +@Directive({selector: '[tsCardTitle]'}) export class TsCardTitleDirective { /** * Option to add a border to the header diff --git a/terminus-ui/card/src/card.component.ts b/terminus-ui/card/src/card.component.ts index 9621b4384..c8c21a02c 100644 --- a/terminus-ui/card/src/card.component.ts +++ b/terminus-ui/card/src/card.component.ts @@ -65,9 +65,7 @@ let nextUniqueId = 0; selector: 'ts-card', templateUrl: './card.component.html', styleUrls: ['./card.component.scss'], - host: { - class: 'ts-card', - }, + host: {class: 'ts-card'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsCard', diff --git a/terminus-ui/chart/src/amcharts.service.spec.ts b/terminus-ui/chart/src/amcharts.service.spec.ts index eaac74839..01c448e17 100644 --- a/terminus-ui/chart/src/amcharts.service.spec.ts +++ b/terminus-ui/chart/src/amcharts.service.spec.ts @@ -5,9 +5,7 @@ import { const AM_CHARTS_TOKEN_MOCK = { - core: { - useTheme: jest.fn(), - }, + core: {useTheme: jest.fn()}, themes: ['foo', null, 'bar'], } as TsAmChartsToken; diff --git a/terminus-ui/chart/src/chart.component.spec.ts b/terminus-ui/chart/src/chart.component.spec.ts index 5f223223f..6824b3726 100644 --- a/terminus-ui/chart/src/chart.component.spec.ts +++ b/terminus-ui/chart/src/chart.component.spec.ts @@ -124,57 +124,43 @@ describe(`ChartComponent`, function() { describe(`chart type coercion`, function() { test(`should validate xy chart`, function() { - const chart = { - className: 'XYChart', - } as TsChart; + const chart = {className: 'XYChart'} as TsChart; expect(tsChartXYTypeCheck(chart)).toEqual(true); }); test(`should validate pie chart`, function() { - const chart = { - className: 'PieChart', - } as TsChart; + const chart = {className: 'PieChart'} as TsChart; expect(tsChartPieTypeCheck(chart)).toEqual(true); }); test(`should validate map chart`, function() { - const chart = { - className: 'MapChart', - } as TsChart; + const chart = {className: 'MapChart'} as TsChart; expect(tsChartMapTypeCheck(chart)).toEqual(true); }); test(`should validate radar chart`, function() { - const chart = { - className: 'RadarChart', - } as TsChart; + const chart = {className: 'RadarChart'} as TsChart; expect(tsChartRadarTypeCheck(chart)).toEqual(true); }); test(`should validate tree chart`, function() { - const chart = { - className: 'TreeMap', - } as TsChart; + const chart = {className: 'TreeMap'} as TsChart; expect(tsChartTreeTypeCheck(chart)).toEqual(true); }); test(`should validate sankey chart`, function() { - const chart = { - className: 'SankeyDiagram', - } as TsChart; + const chart = {className: 'SankeyDiagram'} as TsChart; expect(tsChartSankeyTypeCheck(chart)).toEqual(true); }); test(`should validate chord chart`, function() { - const chart = { - className: 'ChordDiagram', - } as TsChart; + const chart = {className: 'ChordDiagram'} as TsChart; expect(tsChartChordTypeCheck(chart)).toEqual(true); }); @@ -194,9 +180,7 @@ class AmChartsServiceMock { return { core: { create: jest.fn(() => ({ - responsive: { - enabled: false, - }, + responsive: {enabled: false}, dispose: jest.fn(), })), }, @@ -208,9 +192,7 @@ class AmChartsServiceMock { SankeyDiagram: {}, ChordDiagram: {}, }, - maps: { - MapChart: {}, - }, + maps: {MapChart: {}}, }; } } @@ -241,17 +223,13 @@ function createComponent(component: Type, providers: Provider[] = AM_CHART * TEMPLATES */ - @Component({ - template: ``, - }) + @Component({template: ``}) class SimpleHost { @ViewChild(TsChartComponent) public component: TsChartComponent; } - @Component({ - template: ``, - }) + @Component({template: ``}) class VisualizationsHost { public visualization: TsChartVisualizationOptions | undefined; diff --git a/terminus-ui/chart/src/chart.component.ts b/terminus-ui/chart/src/chart.component.ts index 23e0a34a3..68258d5dc 100644 --- a/terminus-ui/chart/src/chart.component.ts +++ b/terminus-ui/chart/src/chart.component.ts @@ -73,9 +73,7 @@ export type TsChart selector: 'ts-chart', templateUrl: './chart.component.html', styleUrls: ['./chart.component.scss'], - host: { - class: 'ts-chart', - }, + host: {class: 'ts-chart'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsChart', diff --git a/terminus-ui/confirmation/src/confirmation-overlay.component.ts b/terminus-ui/confirmation/src/confirmation-overlay.component.ts index ce23bfd66..aeedcce81 100644 --- a/terminus-ui/confirmation/src/confirmation-overlay.component.ts +++ b/terminus-ui/confirmation/src/confirmation-overlay.component.ts @@ -14,9 +14,7 @@ import { Subject } from 'rxjs'; selector: 'ts-confirmation-overlay', styleUrls: ['./confirmation-overlay.component.scss'], templateUrl: './confirmation-overlay.component.html', - host: { - class: 'ts-confirmation', - }, + host: {class: 'ts-confirmation'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsConfirmation', diff --git a/terminus-ui/confirmation/src/confirmation.directive.ts b/terminus-ui/confirmation/src/confirmation.directive.ts index 857b2cf77..8fe7e9540 100644 --- a/terminus-ui/confirmation/src/confirmation.directive.ts +++ b/terminus-ui/confirmation/src/confirmation.directive.ts @@ -66,9 +66,7 @@ export const allowedOverlayPositionTypes: TsConfirmationOverlayPositionTypes[] = */ @Directive({ selector: '[tsConfirmation]', - host: { - class: 'ts-confirmation', - }, + host: {class: 'ts-confirmation'}, exportAs: 'tsConfirmation', }) export class TsConfirmationDirective implements OnDestroy, OnInit { diff --git a/terminus-ui/copy/src/copy.component.spec.ts b/terminus-ui/copy/src/copy.component.spec.ts index b84b87edf..fb6395f4c 100644 --- a/terminus-ui/copy/src/copy.component.spec.ts +++ b/terminus-ui/copy/src/copy.component.spec.ts @@ -74,9 +74,7 @@ describe(`TsCopyComponent`, function() { addRange: noop, }); - component['document'].createRange = jest.fn().mockReturnValue({ - selectNodeContents: noop, - }); + component['document'].createRange = jest.fn().mockReturnValue({selectNodeContents: noop}); component.selectText(component.content.nativeElement, false, false); expect(component['window'].getSelection).toHaveBeenCalled(); diff --git a/terminus-ui/copy/src/copy.component.ts b/terminus-ui/copy/src/copy.component.ts index 970e4e87c..6dd3bf929 100644 --- a/terminus-ui/copy/src/copy.component.ts +++ b/terminus-ui/copy/src/copy.component.ts @@ -34,9 +34,7 @@ import { TsStyleThemeTypes } from '@terminus/ui/utilities'; selector: 'ts-copy', templateUrl: './copy.component.html', styleUrls: ['./copy.component.scss'], - host: { - class: 'ts-copy', - }, + host: {class: 'ts-copy'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsCopy', diff --git a/terminus-ui/csv-entry/src/csv-entry.component.spec.ts b/terminus-ui/csv-entry/src/csv-entry.component.spec.ts index 325dbf920..33a0c0d56 100644 --- a/terminus-ui/csv-entry/src/csv-entry.component.spec.ts +++ b/terminus-ui/csv-entry/src/csv-entry.component.spec.ts @@ -105,9 +105,7 @@ describe(`TsCSVEntryComponent`, function() { const createPasteEvent = (content: TsCSVFormContents): ClipboardEvent => { const event = createFakeEvent('paste') as ClipboardEvent; const stringValue = stringifyForm(content); - (event.clipboardData as any) = { - getData: jest.fn().mockReturnValue(stringValue), - }; + (event.clipboardData as any) = {getData: jest.fn().mockReturnValue(stringValue)}; return event; }; let ENTER_EVENT: KeyboardEvent; @@ -246,60 +244,32 @@ describe(`TsCSVEntryComponent`, function() { TAB_EVENT = document.createEvent('KeyboardEvent'); TAB_EVENT.initEvent('keydown', true, false); Object.defineProperties(TAB_EVENT, { - code: { - get: () => KEYS.TAB.code, - }, - key: { - get: () => KEYS.TAB.code, - }, - keyCode: { - get: () => KEYS.TAB.keyCode, - }, + code: {get: () => KEYS.TAB.code}, + key: {get: () => KEYS.TAB.code}, + keyCode: {get: () => KEYS.TAB.keyCode}, }); SHIFT_TAB_EVENT = document.createEvent('KeyboardEvent'); SHIFT_TAB_EVENT.initEvent('keydown', true, false); Object.defineProperties(SHIFT_TAB_EVENT, { - code: { - get: () => KEYS.TAB.code, - }, - key: { - get: () => KEYS.TAB.code, - }, - keyCode: { - get: () => KEYS.TAB.keyCode, - }, - shiftKey: { - get: () => true, - }, + code: {get: () => KEYS.TAB.code}, + key: {get: () => KEYS.TAB.code}, + keyCode: {get: () => KEYS.TAB.keyCode}, + shiftKey: {get: () => true}, }); ENTER_EVENT = document.createEvent('KeyboardEvent'); ENTER_EVENT.initEvent('keydown', true, false); Object.defineProperties(ENTER_EVENT, { - code: { - get: () => KEYS.ENTER.code, - }, - key: { - get: () => KEYS.ENTER.code, - }, - keyCode: { - get: () => KEYS.ENTER.keyCode, - }, + code: {get: () => KEYS.ENTER.code}, + key: {get: () => KEYS.ENTER.code}, + keyCode: {get: () => KEYS.ENTER.keyCode}, }); SHIFT_ENTER_EVENT = document.createEvent('KeyboardEvent'); SHIFT_ENTER_EVENT.initEvent('keydown', true, false); Object.defineProperties(SHIFT_ENTER_EVENT, { - code: { - get: () => KEYS.ENTER.code, - }, - key: { - get: () => KEYS.ENTER.code, - }, - keyCode: { - get: () => KEYS.ENTER.keyCode, - }, - shiftKey: { - get: () => true, - }, + code: {get: () => KEYS.ENTER.code}, + key: {get: () => KEYS.ENTER.code}, + keyCode: {get: () => KEYS.ENTER.keyCode}, + shiftKey: {get: () => true}, }); /** @@ -365,9 +335,7 @@ describe(`TsCSVEntryComponent`, function() { const stringRecords = 'bing4\tbang4\r\nbing5\tbang5\r\n'; const event = createFakeEvent('paste') as ClipboardEvent; - (event.clipboardData as any) = { - getData: jest.fn().mockReturnValue(stringRecords), - }; + (event.clipboardData as any) = {getData: jest.fn().mockReturnValue(stringRecords)}; row2Cell1.dispatchEvent(event); fixture.detectChanges(); row2Cell1 = fixture.debugElement.query(By.css('#r_1Xc_0')).nativeElement; @@ -380,9 +348,7 @@ describe(`TsCSVEntryComponent`, function() { test(`should not create new rows when pasting content to a single cell`, () => { const event = createFakeEvent('paste') as ClipboardEvent; - (event.clipboardData as any) = { - getData: jest.fn().mockReturnValue('new'), - }; + (event.clipboardData as any) = {getData: jest.fn().mockReturnValue('new')}; component['splitContent'] = jest.fn(); component.onPaste(event); @@ -392,9 +358,7 @@ describe(`TsCSVEntryComponent`, function() { test(`should do nothing if the paste event has no content`, () => { const event = createFakeEvent('paste') as ClipboardEvent; - (event.clipboardData as any) = { - getData: jest.fn().mockReturnValue(''), - }; + (event.clipboardData as any) = {getData: jest.fn().mockReturnValue('')}; component['splitContent'] = jest.fn(); component.onPaste(event); @@ -731,18 +695,10 @@ describe(`TsCSVEntryComponent`, function() { event = createFakeEvent('scroll') as WheelEvent; event.preventDefault = jest.fn(); Object.defineProperties(event, { - target: { - value: target, - }, - srcElement: { - value: target, - }, - screenY: { - value: 200, - }, - deltaX: { - value: -1, - }, + target: {value: target}, + srcElement: {value: target}, + screenY: {value: 200}, + deltaX: {value: -1}, }); }); @@ -769,11 +725,7 @@ describe(`TsCSVEntryComponent`, function() { test(`should prevent the default event when reaching the right edge`, () => { - Object.defineProperties(event, { - deltaX: { - value: 1, - }, - }); + Object.defineProperties(event, {deltaX: {value: 1}}); component.onScroll(event); expect(event.preventDefault).not.toHaveBeenCalled(); diff --git a/terminus-ui/csv-entry/src/csv-entry.component.ts b/terminus-ui/csv-entry/src/csv-entry.component.ts index 3d7d286ce..ddf999d5f 100644 --- a/terminus-ui/csv-entry/src/csv-entry.component.ts +++ b/terminus-ui/csv-entry/src/csv-entry.component.ts @@ -705,9 +705,7 @@ export class TsCSVEntryComponent implements OnInit, OnDestroy { // Angular built in required validator only returns a boolean if (typeof error === 'boolean') { - error = { - valid: false, - }; + error = {valid: false}; } // If the rowId exists, add it to the errors object @@ -875,9 +873,7 @@ export class TsCSVEntryComponent implements OnInit, OnDestroy { joined = JSON.stringify(joined).replace(/\\t/g, ','); } - return new Blob([joined], { - type: 'text/csv', - }); + return new Blob([joined], {type: 'text/csv'}); } } diff --git a/terminus-ui/date-range/src/date-range.component.spec.ts b/terminus-ui/date-range/src/date-range.component.spec.ts index 5bf1faafb..23df838ba 100644 --- a/terminus-ui/date-range/src/date-range.component.spec.ts +++ b/terminus-ui/date-range/src/date-range.component.spec.ts @@ -99,12 +99,8 @@ describe(`TsDateRangeComponent`, function() { endInputInstance.inputElement.nativeElement.blur(); fixture.detectChanges(); - expect(startInputInstance.formControl.errors).toEqual({ - required: true, - }); - expect(endInputInstance.formControl.errors).toEqual({ - required: true, - }); + expect(startInputInstance.formControl.errors).toEqual({required: true}); + expect(endInputInstance.formControl.errors).toEqual({required: true}); jest.runAllTimers(); expect.assertions(4); }); diff --git a/terminus-ui/date-range/src/date-range.component.ts b/terminus-ui/date-range/src/date-range.component.ts index 14dd37139..096b8daf4 100644 --- a/terminus-ui/date-range/src/date-range.component.ts +++ b/terminus-ui/date-range/src/date-range.component.ts @@ -64,9 +64,7 @@ export interface TsDateRange { selector: 'ts-date-range', templateUrl: './date-range.component.html', styleUrls: ['./date-range.component.scss'], - host: { - class: 'ts-date-range', - }, + host: {class: 'ts-date-range'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsDateRange', diff --git a/terminus-ui/expansion-panel/src/accordion/accordion.component.spec.ts b/terminus-ui/expansion-panel/src/accordion/accordion.component.spec.ts index 9923395cd..6ccc96a59 100644 --- a/terminus-ui/expansion-panel/src/accordion/accordion.component.spec.ts +++ b/terminus-ui/expansion-panel/src/accordion/accordion.component.spec.ts @@ -154,22 +154,14 @@ describe(`TsAccordionComponent`, function() { const spaceEvent = document.createEvent('KeyboardEvent'); spaceEvent.initEvent('keydown', true, false); Object.defineProperties(spaceEvent, { - code: { - get: () => KEYS.SPACE.code, - }, - key: { - get: () => KEYS.SPACE.code, - }, + code: {get: () => KEYS.SPACE.code}, + key: {get: () => KEYS.SPACE.code}, }); const enterEvent = document.createEvent('KeyboardEvent'); enterEvent.initEvent('keydown', true, false); Object.defineProperties(enterEvent, { - code: { - get: () => KEYS.ENTER.code, - }, - key: { - get: () => KEYS.ENTER.code, - }, + code: {get: () => KEYS.ENTER.code}, + key: {get: () => KEYS.ENTER.code}, }); trigger1.dispatchEvent(spaceEvent); diff --git a/terminus-ui/expansion-panel/src/accordion/accordion.component.ts b/terminus-ui/expansion-panel/src/accordion/accordion.component.ts index e5befe9db..0bcb89b78 100644 --- a/terminus-ui/expansion-panel/src/accordion/accordion.component.ts +++ b/terminus-ui/expansion-panel/src/accordion/accordion.component.ts @@ -57,9 +57,7 @@ import { useExisting: TsAccordionComponent, }, ], - host: { - class: 'ts-accordion', - }, + host: {class: 'ts-accordion'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsAccordion', @@ -73,9 +71,7 @@ export class TsAccordionComponent extends CdkAccordion implements TsAccordionBas /** * Collect a list of all triggers */ - @ContentChildren(TsExpansionPanelTriggerComponent, { - descendants: true, - }) + @ContentChildren(TsExpansionPanelTriggerComponent, {descendants: true}) public triggers!: QueryList; /** diff --git a/terminus-ui/expansion-panel/src/expansion-animations.ts b/terminus-ui/expansion-panel/src/expansion-animations.ts index c4b0286f2..58089073b 100644 --- a/terminus-ui/expansion-panel/src/expansion-animations.ts +++ b/terminus-ui/expansion-panel/src/expansion-animations.ts @@ -46,12 +46,8 @@ export const tsExpansionPanelAnimations: { * Animation that rotates the indicator arrow */ indicatorRotate: trigger('indicatorRotate', [ - state('collapsed, void', style({ - transform: 'rotate(0deg)', - })), - state('expanded', style({ - transform: 'rotate(180deg)', - })), + state('collapsed, void', style({transform: 'rotate(0deg)'})), + state('expanded', style({transform: 'rotate(180deg)'})), transition('expanded <=> collapsed, void => collapsed', animate(TS_EXPANSION_PANEL_ANIMATION_TIMING)), ]), @@ -60,24 +56,10 @@ export const tsExpansionPanelAnimations: { * Animation that expands and collapses the panel trigger height */ expansionTriggerHeight: trigger('expansionHeight', [ - state('collapsed, void', style({ - height: '{{collapsedHeight}}', - }), { - params: { - collapsedHeight: '48px', - }, - }), - state('expanded', style({ - height: '{{expandedHeight}}', - }), { - params: { - expandedHeight: '64px', - }, - }), + state('collapsed, void', style({height: '{{collapsedHeight}}'}), {params: {collapsedHeight: '48px'}}), + state('expanded', style({height: '{{expandedHeight}}'}), {params: {expandedHeight: '64px'}}), transition('expanded <=> collapsed, void => collapsed', group([ - query('@indicatorRotate', animateChild(), { - optional: true, - }), + query('@indicatorRotate', animateChild(), {optional: true}), animate(TS_EXPANSION_PANEL_ANIMATION_TIMING), ])), ]), diff --git a/terminus-ui/expansion-panel/src/expansion-panel-action-row.ts b/terminus-ui/expansion-panel/src/expansion-panel-action-row.ts index 7a22e276d..6caf61439 100644 --- a/terminus-ui/expansion-panel/src/expansion-panel-action-row.ts +++ b/terminus-ui/expansion-panel/src/expansion-panel-action-row.ts @@ -26,9 +26,7 @@ import { @Component({ selector: 'ts-expansion-panel-action-row', template: ``, - host: { - class: 'ts-expansion-panel__action-row', - }, + host: {class: 'ts-expansion-panel__action-row'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsExpansionPanelActionRow', diff --git a/terminus-ui/expansion-panel/src/expansion-panel-content.directive.ts b/terminus-ui/expansion-panel/src/expansion-panel-content.directive.ts index fffe2ab6f..dcc83bd8e 100644 --- a/terminus-ui/expansion-panel/src/expansion-panel-content.directive.ts +++ b/terminus-ui/expansion-panel/src/expansion-panel-content.directive.ts @@ -20,9 +20,7 @@ import { * * https://getterminus.github.io/ui-demos-master/components/expansion-panel */ -@Directive({ - selector: 'ng-template[tsExpansionPanelContent]', -}) +@Directive({selector: 'ng-template[tsExpansionPanelContent]'}) export class TsExpansionPanelContentDirective { // tslint:disable-next-line no-any constructor(public template: TemplateRef) {} diff --git a/terminus-ui/expansion-panel/src/expansion-panel.component.spec.ts b/terminus-ui/expansion-panel/src/expansion-panel.component.spec.ts index 44f70a5cf..74f2f4585 100644 --- a/terminus-ui/expansion-panel/src/expansion-panel.component.spec.ts +++ b/terminus-ui/expansion-panel/src/expansion-panel.component.spec.ts @@ -125,11 +125,7 @@ describe(`TsExpansionPanelComponent`, function() { fixture.detectChanges(); const trigger = getTriggerInstance(fixture); const panel = getPanelInstance(fixture); - Object.defineProperties(panel, { - contentContainsFocus: { - get: () => true, - }, - }); + Object.defineProperties(panel, {contentContainsFocus: {get: () => true}}); trigger['focusMonitor'].focusVia = jest.fn(); panel.expanded = false; diff --git a/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-description.component.ts b/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-description.component.ts index 37a0620a8..83657ff45 100644 --- a/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-description.component.ts +++ b/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-description.component.ts @@ -8,9 +8,7 @@ import { @Component({ selector: 'ts-expansion-panel-trigger-description', template: ``, - host: { - class: 'ts-expansion-panel__trigger-description', - }, + host: {class: 'ts-expansion-panel__trigger-description'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsExpansionPanelTriggerDescription', diff --git a/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-title.component.ts b/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-title.component.ts index e59b2517a..f2e906504 100644 --- a/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-title.component.ts +++ b/terminus-ui/expansion-panel/src/trigger/expansion-panel-trigger-title.component.ts @@ -9,9 +9,7 @@ import { @Component({ selector: 'ts-expansion-panel-trigger-title', template: ``, - host: { - class: 'ts-expansion-panel__trigger-title', - }, + host: {class: 'ts-expansion-panel__trigger-title'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsExpansionPanelTriggerTitle', diff --git a/terminus-ui/file-upload/src/drop-protection-service.spec.ts b/terminus-ui/file-upload/src/drop-protection-service.spec.ts index 62ce2bd7c..c687c8aa3 100644 --- a/terminus-ui/file-upload/src/drop-protection-service.spec.ts +++ b/terminus-ui/file-upload/src/drop-protection-service.spec.ts @@ -8,13 +8,9 @@ describe(`TsDropProtectionService`, function() { let service: TsDropProtectionService; let myWindow: Window; const eventDrop = createFakeEvent('drop'); - Object.defineProperty(eventDrop, 'preventDefault', { - value: jest.fn(), - }); + Object.defineProperty(eventDrop, 'preventDefault', {value: jest.fn()}); const eventDrag = createFakeEvent('dragover'); - Object.defineProperty(eventDrag, 'preventDefault', { - value: jest.fn(), - }); + Object.defineProperty(eventDrag, 'preventDefault', {value: jest.fn()}); beforeEach(() => { diff --git a/terminus-ui/file-upload/src/file-upload.component.spec.ts b/terminus-ui/file-upload/src/file-upload.component.spec.ts index d0815c71f..3ac6ace60 100644 --- a/terminus-ui/file-upload/src/file-upload.component.spec.ts +++ b/terminus-ui/file-upload/src/file-upload.component.spec.ts @@ -34,9 +34,7 @@ const fileContentsMock = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABI // IMAGE MOCK const FILE_BLOB = new Blob( [fileContentsMock], - { - type: 'image/png', - }, + {type: 'image/png'}, ); FILE_BLOB['lastModifiedDate'] = new Date(); FILE_BLOB['name'] = 'foo'; @@ -558,12 +556,8 @@ describe(`TsFileUploadComponent`, function() { test(`should throw an error if no files exist in the dataTransfer object`, () => { const event = createFakeEvent('DragEvent') as DragEvent; - const dataTransfer = { - files: [], - }; - Object.defineProperty(event, 'dataTransfer', { - value: dataTransfer, - }); + const dataTransfer = {files: []}; + Object.defineProperty(event, 'dataTransfer', {value: dataTransfer}); component['setUpNewFile'] = jest.fn(); expect(() => { component['collectFilesFromEvent'](event); @@ -578,9 +572,7 @@ describe(`TsFileUploadComponent`, function() { test(`should throw an error if no files exist on the event target`, () => { const event = createFakeEvent('Event'); const input = document.createElement('input'); - Object.defineProperty(event, 'target', { - value: input, - }); + Object.defineProperty(event, 'target', {value: input}); component['setUpNewFile'] = jest.fn(); expect(() => { component['collectFilesFromEvent'](event); @@ -594,12 +586,8 @@ describe(`TsFileUploadComponent`, function() { test(`should collect a file from a drag/drop event`, () => { const event = createFakeEvent('DragEvent') as DragEvent; - const dataTransfer = { - files: [FILE_MOCK], - }; - Object.defineProperty(event, 'dataTransfer', { - value: dataTransfer, - }); + const dataTransfer = {files: [FILE_MOCK]}; + Object.defineProperty(event, 'dataTransfer', {value: dataTransfer}); component['setUpNewFile'] = jest.fn(); fixture.detectChanges(); component['collectFilesFromEvent'](event); @@ -614,12 +602,8 @@ describe(`TsFileUploadComponent`, function() { test(`should collect a file from an input change (manual selection)`, () => { const event = createFakeEvent('Event'); const input = document.createElement('input'); - Object.defineProperty(input, 'files', { - value: [FILE_MOCK], - }); - Object.defineProperty(event, 'target', { - value: input, - }); + Object.defineProperty(input, 'files', {value: [FILE_MOCK]}); + Object.defineProperty(event, 'target', {value: input}); component['setUpNewFile'] = jest.fn(); component['collectFilesFromEvent'](event); fixture.detectChanges(); @@ -631,12 +615,8 @@ describe(`TsFileUploadComponent`, function() { test(`should collect emit when multiple files are selected`, () => { const event = createFakeEvent('DragEvent') as DragEvent; - const dataTransfer = { - files: [FILE_MOCK, FILE_MOCK], - }; - Object.defineProperty(event, 'dataTransfer', { - value: dataTransfer, - }); + const dataTransfer = {files: [FILE_MOCK, FILE_MOCK]}; + Object.defineProperty(event, 'dataTransfer', {value: dataTransfer}); component['setUpNewFile'] = jest.fn(); component['collectFilesFromEvent'](event); fixture.detectChanges(); @@ -686,12 +666,8 @@ describe(`TsFileUploadComponent`, function() { test(`should both prevent and stop event propogation`, () => { const event = createFakeEvent('fake'); Object.defineProperties(event, { - preventDefault: { - value: jest.fn(), - }, - stopPropagation: { - value: jest.fn(), - }, + preventDefault: {value: jest.fn()}, + stopPropagation: {value: jest.fn()}, }); component['preventAndStopEventPropagation'](event); diff --git a/terminus-ui/file-upload/src/selected-file.spec.ts b/terminus-ui/file-upload/src/selected-file.spec.ts index 9d48f12d3..b6af5a360 100644 --- a/terminus-ui/file-upload/src/selected-file.spec.ts +++ b/terminus-ui/file-upload/src/selected-file.spec.ts @@ -31,9 +31,7 @@ const CONSTRAINTS_MOCK: TsFileImageDimensionConstraints = [ const FILE_BLOB = new Blob( // eslint-disable-next-line max-len ['data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAAA1BMVEXXbFn0Q9OUAAAADklEQVR4AWMYRmAUjAIAAtAAAaW+yXMAAAAASUVORK5CYII='], - { - type: 'image/png', - }, + {type: 'image/png'}, ); FILE_BLOB['lastModifiedDate'] = new Date(); FILE_BLOB['name'] = 'foo'; @@ -43,9 +41,7 @@ const FILE_MOCK = FILE_BLOB as File; // CSV MOCK const FILE_CSV_BLOB = new Blob( ['my csv value'], - { - type: 'text/csv', - }, + {type: 'text/csv'}, ); FILE_CSV_BLOB['lastModifiedDate'] = new Date(); FILE_CSV_BLOB['name'] = 'myCSV'; @@ -55,9 +51,7 @@ const FILE_CSV_MOCK = FILE_CSV_BLOB as File; // VIDEO MOCK const FILE_VIDEO_BLOB = new Blob( ['my video value'], - { - type: 'video/mp4', - }, + {type: 'video/mp4'}, ); FILE_VIDEO_BLOB['lastModifiedDate'] = new Date(); FILE_VIDEO_BLOB['name'] = 'myVideo'; diff --git a/terminus-ui/form-field/src/form-field.component.spec.ts b/terminus-ui/form-field/src/form-field.component.spec.ts index c1a0f1a52..e35b43bd6 100644 --- a/terminus-ui/form-field/src/form-field.component.spec.ts +++ b/terminus-ui/form-field/src/form-field.component.spec.ts @@ -186,9 +186,7 @@ describe(`TsFormFieldComponent`, function() { expect(formField.shouldAlwaysFloat).toBe(false); expect(formField.floatLabel).toBe('always'); - const fakeEvent = (Object as any).assign(createFakeEvent('transitionend'), { - propertyName: 'transform', - }); + const fakeEvent = (Object as any).assign(createFakeEvent('transitionend'), {propertyName: 'transform'}); label.dispatchEvent(fakeEvent); fixture.detectChanges(); @@ -344,9 +342,7 @@ function createComponent(component: Type, providers: Provider[] = [], impo class MyDocumentService extends TsDocumentServiceMock { shouldContain = true; document: any = { - documentElement: { - contains: jest.fn(() => false), - }, + documentElement: {contains: jest.fn(() => false)}, createEvent() { return document.createEvent('Event'); }, diff --git a/terminus-ui/form-field/src/label.directive.ts b/terminus-ui/form-field/src/label.directive.ts index ff38913d6..442d796d4 100644 --- a/terminus-ui/form-field/src/label.directive.ts +++ b/terminus-ui/form-field/src/label.directive.ts @@ -6,7 +6,5 @@ import { Directive } from '@angular/core'; /** * The floating label for a {@link TsFormFieldComponent} */ -@Directive({ - selector: 'ts-label', -}) +@Directive({selector: 'ts-label'}) export class TsLabelDirective {} diff --git a/terminus-ui/form-field/src/prefix.directive.ts b/terminus-ui/form-field/src/prefix.directive.ts index 7bb60fdff..efc5e3861 100644 --- a/terminus-ui/form-field/src/prefix.directive.ts +++ b/terminus-ui/form-field/src/prefix.directive.ts @@ -4,7 +4,5 @@ import { Directive } from '@angular/core'; /** * Prefix to be placed the front of the {@link TsFormFieldComponent} */ -@Directive({ - selector: '[tsPrefix]', -}) +@Directive({selector: '[tsPrefix]'}) export class TsPrefixDirective {} diff --git a/terminus-ui/form-field/src/suffix.directive.ts b/terminus-ui/form-field/src/suffix.directive.ts index 3809da684..7721bdc51 100644 --- a/terminus-ui/form-field/src/suffix.directive.ts +++ b/terminus-ui/form-field/src/suffix.directive.ts @@ -4,7 +4,5 @@ import { Directive } from '@angular/core'; /** * Suffix to be placed at the end of the {@link TsFormFieldComponent} */ -@Directive({ - selector: '[tsSuffix]', -}) +@Directive({selector: '[tsSuffix]'}) export class TsSuffixDirective {} diff --git a/terminus-ui/icon-button/src/icon-button.component.ts b/terminus-ui/icon-button/src/icon-button.component.ts index b68a6ac34..309e93462 100644 --- a/terminus-ui/icon-button/src/icon-button.component.ts +++ b/terminus-ui/icon-button/src/icon-button.component.ts @@ -34,9 +34,7 @@ import { selector: 'ts-icon-button', templateUrl: './icon-button.component.html', styleUrls: ['./icon-button.component.scss'], - host: { - class: 'ts-icon-button', - }, + host: {class: 'ts-icon-button'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsIconButton', diff --git a/terminus-ui/input/src/date-adapter.spec.ts b/terminus-ui/input/src/date-adapter.spec.ts index 2f5f17982..9e745e4c2 100644 --- a/terminus-ui/input/src/date-adapter.spec.ts +++ b/terminus-ui/input/src/date-adapter.spec.ts @@ -29,9 +29,7 @@ describe(`TsDateAdapter`, () => { */ -@Component({ - template: ``, -}) +@Component({template: ``}) class DemoComponent implements OnInit { constructor( diff --git a/terminus-ui/input/src/input.component.spec.ts b/terminus-ui/input/src/input.component.spec.ts index 9fa1226d1..f8cae873c 100644 --- a/terminus-ui/input/src/input.component.spec.ts +++ b/terminus-ui/input/src/input.component.spec.ts @@ -638,12 +638,8 @@ describe(`TsInputComponent`, function() { const outlineStartEl: HTMLDivElement = fixture.debugElement.query(By.css('.js-outline-start')).nativeElement; const outlineGapEl: HTMLDivElement = fixture.debugElement.query(By.css('.js-outline-gap')).nativeElement; const labelContent: HTMLSpanElement = fixture.debugElement.query(By.css('.c-input__label-text')).nativeElement; - const bounding1 = { - left: 50, - }; - const bounding2 = { - left: 100, - }; + const bounding1 = {left: 50}; + const bounding2 = {left: 100}; const formFieldInstance: TsFormFieldComponent = fixture.debugElement.query(By.css('.ts-form-field')).componentInstance; formFieldInstance['containerElement'].nativeElement.getBoundingClientRect = jest.fn(() => bounding1); formFieldInstance['labelElement'].nativeElement.children[0].getBoundingClientRect = jest.fn(() => bounding2); @@ -988,9 +984,7 @@ function createComponent(component: Type): ComponentFixture { class MyDocumentService extends TsDocumentServiceMock { public shouldContain = true; public document: any = { - documentElement: { - contains: jest.fn(() => !!this.shouldContain), - }, + documentElement: {contains: jest.fn(() => !!this.shouldContain)}, createEvent() { return document.createEvent('Event'); }, diff --git a/terminus-ui/input/src/input.component.ts b/terminus-ui/input/src/input.component.ts index b798a27ee..086353a1f 100644 --- a/terminus-ui/input/src/input.component.ts +++ b/terminus-ui/input/src/input.component.ts @@ -879,9 +879,7 @@ export class TsInputComponent implements this.document = this.documentService.document; // If no inputValueAccessor was passed in, default to a basic object with a value. - this.inputValueAccessor = inputValueAccessor || { - value: undefined, - }; + this.inputValueAccessor = inputValueAccessor || {value: undefined}; // If no value accessor was passed in, use this component for the ngControl ValueAccessor // istanbul ignore else @@ -1243,9 +1241,7 @@ export class TsInputComponent implements unmaskRegex: NUMBER_ONLY_REGEX, }, currency: { - mask: createNumberMask({ - allowDecimal, - }), + mask: createNumberMask({allowDecimal}), unmaskRegex: allowDecimal ? NUMBER_WITH_DECIMAL_REGEX : NUMBER_ONLY_REGEX, }, number: { @@ -1265,17 +1261,13 @@ export class TsInputComponent implements }), unmaskRegex: allowDecimal ? NUMBER_WITH_DECIMAL_REGEX : NUMBER_ONLY_REGEX, }, - postal: { - mask: this.determinePostalMask, - }, + postal: {mask: this.determinePostalMask}, date: { mask: [/\d/, /\d/, '-', /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], pipe: createAutoCorrectedDatePipe(this.defaultDateFormat), keepCharPositions: true, }, - default: { - mask: false, - }, + default: {mask: false}, }; } diff --git a/terminus-ui/input/testing/src/test-components.ts b/terminus-ui/input/testing/src/test-components.ts index 0a868dd4a..684f20561 100644 --- a/terminus-ui/input/testing/src/test-components.ts +++ b/terminus-ui/input/testing/src/test-components.ts @@ -60,9 +60,7 @@ export class Autocomplete implements AfterContentInit { } } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrReadonly { readOnly = false; @@ -70,9 +68,7 @@ export class AttrReadonly { inputComponent: TsInputComponent; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrSpellcheck { spellcheck = false; @@ -80,9 +76,7 @@ export class AttrSpellcheck { inputComponent: TsInputComponent; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrAutocapitalize { autocapitalize = false; @@ -90,30 +84,22 @@ export class AttrAutocapitalize { inputComponent: TsInputComponent; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrAutocomplete { autocomplete: TsInputAutocompleteTypes = 'on'; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrId { id: string | undefined = undefined; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrDisabled { disabled = false; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrAutofocus { focused = false; } @@ -216,9 +202,7 @@ export class PostalMask { inputComponent: TsInputComponent; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class MissingFormControl { @ViewChild(TsInputComponent) inputComponent: TsInputComponent; @@ -271,9 +255,7 @@ export class MinMaxDate { inputComponent: TsInputComponent; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrRequiredHidden { formControl: FormControl = new FormControl(null, Validators.required); hideRequiredMarker: boolean | undefined = false; @@ -332,40 +314,30 @@ export class NoExternalFormField { inputComponent: TsInputComponent; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class Hint { formControl = new FormControl(); hint: string | undefined = undefined; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrNotRequired { formControl: FormControl = new FormControl(null); } -@Component({ - template: ``, -}) +@Component({template: ``}) export class FormControlAttrRequired { formControl: FormControl = new FormControl(null, Validators.required); } -@Component({ - template: ``, -}) +@Component({template: ``}) export class AttrInputRequired { formControl: FormControl = new FormControl(null); required = false; } -@Component({ - template: ``, -}) +@Component({template: ``}) export class Label { @ViewChild(TsInputComponent) inputComponent: TsInputComponent; @@ -442,9 +414,7 @@ export class Textarea { inputComponent: TsInputComponent; } -@Component({ - template: `
`, -}) +@Component({template: `
`}) export class ToggleInputComponent { @ViewChild(TsInputComponent) diff --git a/terminus-ui/link/src/link.component.ts b/terminus-ui/link/src/link.component.ts index 6d644535f..9a2cf0a99 100644 --- a/terminus-ui/link/src/link.component.ts +++ b/terminus-ui/link/src/link.component.ts @@ -33,9 +33,7 @@ import { selector: 'ts-link', templateUrl: './link.component.html', styleUrls: ['./link.component.scss'], - host: { - class: 'ts-link', - }, + host: {class: 'ts-link'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsLink', diff --git a/terminus-ui/loading-overlay/src/loading-overlay.component.ts b/terminus-ui/loading-overlay/src/loading-overlay.component.ts index c7685b4d7..07dbb67c9 100644 --- a/terminus-ui/loading-overlay/src/loading-overlay.component.ts +++ b/terminus-ui/loading-overlay/src/loading-overlay.component.ts @@ -17,9 +17,7 @@ import { @Component({ selector: 'ts-loading-overlay', styleUrls: ['./loading-overlay.component.scss'], - host: { - class: 'ts-loading-overlay', - }, + host: {class: 'ts-loading-overlay'}, templateUrl: './loading-overlay.component.html', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, diff --git a/terminus-ui/loading-overlay/src/loading-overlay.directive.ts b/terminus-ui/loading-overlay/src/loading-overlay.directive.ts index 2cd4df436..68a28b0aa 100644 --- a/terminus-ui/loading-overlay/src/loading-overlay.directive.ts +++ b/terminus-ui/loading-overlay/src/loading-overlay.directive.ts @@ -27,9 +27,7 @@ import { TsLoadingOverlayComponent } from './loading-overlay.component'; * * https://getterminus.github.io/ui-demos-master/components/loading-overlay */ -@Directive({ - selector: '[tsLoadingOverlay]', -}) +@Directive({selector: '[tsLoadingOverlay]'}) export class TsLoadingOverlayDirective implements OnInit, OnDestroy { /** * A reference to the portal diff --git a/terminus-ui/login-form/src/login-form.component.spec.ts b/terminus-ui/login-form/src/login-form.component.spec.ts index 354effc49..e16ff82b5 100644 --- a/terminus-ui/login-form/src/login-form.component.spec.ts +++ b/terminus-ui/login-form/src/login-form.component.spec.ts @@ -66,9 +66,7 @@ describe(`TsLoginFormComponent`, function() { test(`should reset the form if 'triggerFormReset' was the passed in change`, () => { component['resetForm'] = jest.fn(); - const changesMock: SimpleChanges = { - triggerFormReset: new SimpleChange(true, false, false), - }; + const changesMock: SimpleChanges = {triggerFormReset: new SimpleChange(true, false, false)}; component.ngOnChanges(changesMock); expect(component['resetForm']).toHaveBeenCalled(); @@ -77,9 +75,7 @@ describe(`TsLoginFormComponent`, function() { test(`should not reset the form if 'resetForm' was not passed in with changes`, () => { component['resetForm'] = jest.fn(); - const changesMock: SimpleChanges = { - foo: new SimpleChange(true, false, false), - }; + const changesMock: SimpleChanges = {foo: new SimpleChange(true, false, false)}; component.ngOnChanges(changesMock); expect(component['resetForm']).not.toHaveBeenCalled(); diff --git a/terminus-ui/login-form/src/login-form.component.ts b/terminus-ui/login-form/src/login-form.component.ts index 819582481..b1fc42fc5 100644 --- a/terminus-ui/login-form/src/login-form.component.ts +++ b/terminus-ui/login-form/src/login-form.component.ts @@ -73,9 +73,7 @@ export interface TsLoginFormResponse { selector: 'ts-login-form', templateUrl: './login-form.component.html', styleUrls: ['./login-form.component.scss'], - host: { - class: 'ts-login-form', - }, + host: {class: 'ts-login-form'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsLoginForm', diff --git a/terminus-ui/menu/src/menu.component.spec.ts b/terminus-ui/menu/src/menu.component.spec.ts index 500bbac13..bba44d109 100644 --- a/terminus-ui/menu/src/menu.component.spec.ts +++ b/terminus-ui/menu/src/menu.component.spec.ts @@ -48,9 +48,7 @@ describe(`TsMenuComponent`, function() { describe(`ngAfterViewInit()`, () => { it(`should not open the menu when 'defaultOpened' is FALSE`, () => { - component.trigger = { - openMenu: jest.fn(), - } as any; + component.trigger = {openMenu: jest.fn()} as any; component.ngAfterViewInit(); expect(component.trigger.openMenu).not.toHaveBeenCalled(); @@ -59,9 +57,7 @@ describe(`TsMenuComponent`, function() { it(`should open the menu when 'defaultOpened' is TRUE`, () => { component.defaultOpened = true; - component.trigger = { - openMenu: jest.fn(), - } as any; + component.trigger = {openMenu: jest.fn()} as any; component.ngAfterViewInit(); expect(component.trigger.openMenu).toHaveBeenCalled(); diff --git a/terminus-ui/menu/src/menu.component.ts b/terminus-ui/menu/src/menu.component.ts index 510783da2..8830c64a8 100644 --- a/terminus-ui/menu/src/menu.component.ts +++ b/terminus-ui/menu/src/menu.component.ts @@ -66,9 +66,7 @@ export type TsMenuTriggerTypes selector: 'ts-menu', templateUrl: './menu.component.html', styleUrls: ['./menu.component.scss'], - host: { - class: 'ts-menu', - }, + host: {class: 'ts-menu'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsMenu', diff --git a/terminus-ui/navigation/src/navigation.component.spec.ts b/terminus-ui/navigation/src/navigation.component.spec.ts index 55b801800..c24ac60a0 100644 --- a/terminus-ui/navigation/src/navigation.component.spec.ts +++ b/terminus-ui/navigation/src/navigation.component.spec.ts @@ -19,9 +19,7 @@ const NAV_ITEMS_MOCK: TsNavigationItem[] = [ }, { name: 'NAV_ITEM_THREE', - action: { - type: 'foo:bar', - }, + action: {type: 'foo:bar'}, alwaysHidden: true, }, { @@ -49,21 +47,9 @@ const USER_MOCK_23 = { }; const visibleLinkElementMock = [ - { - nativeElement: { - offsetWidth: 50, - }, - }, - { - nativeElement: { - offsetWidth: 100, - }, - }, - { - nativeElement: { - offsetWidth: 200, - }, - }, + {nativeElement: {offsetWidth: 50}}, + {nativeElement: {offsetWidth: 100}}, + {nativeElement: {offsetWidth: 200}}, ]; @@ -228,11 +214,7 @@ describe(`TsNavigationComponent`, function() { // NOTE: For some reason we need to re-declare the visibleItemsList element each time. Using the // mock created very odd issues even when using Object.assign or {...} beforeEach(() => { - component.visibleItemsList = { - nativeElement: { - offsetWidth: 180, - }, - }; + component.visibleItemsList = {nativeElement: {offsetWidth: 180}}; component.visibleLinkElement = visibleLinkElementMock as any; component['breakWidths'] = [50, 150, 350]; component.items = NAV_ITEMS_MOCK; @@ -261,11 +243,7 @@ describe(`TsNavigationComponent`, function() { expect(component.visibleItemsLength).toEqual(2); expect(component.hiddenItems.getValue().length).toEqual(1); - component.visibleItemsList = { - nativeElement: { - offsetWidth: 380, - }, - }; + component.visibleItemsList = {nativeElement: {offsetWidth: 380}}; component['updateLists'](); const actualVisableLength = component.visibleItems.getValue().length; diff --git a/terminus-ui/navigation/src/navigation.component.ts b/terminus-ui/navigation/src/navigation.component.ts index 6655052d7..0b723aed3 100644 --- a/terminus-ui/navigation/src/navigation.component.ts +++ b/terminus-ui/navigation/src/navigation.component.ts @@ -157,9 +157,7 @@ const DEFAULT_WELCOME_MESSAGE_MAX_LENGTH = 20; selector: 'ts-navigation', templateUrl: './navigation.component.html', styleUrls: ['./navigation.component.scss'], - host: { - class: 'ts-navigation', - }, + host: {class: 'ts-navigation'}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'tsNavigation', diff --git a/terminus-ui/paginator/src/paginator.component.spec.ts b/terminus-ui/paginator/src/paginator.component.spec.ts index fec4763c7..788ae6a7f 100644 --- a/terminus-ui/paginator/src/paginator.component.spec.ts +++ b/terminus-ui/paginator/src/paginator.component.spec.ts @@ -64,9 +64,7 @@ describe(`TsPaginatorComponent`, function() { test(`should set the recordCountTooHighMessage if passed in`, () => { component.recordCountTooHighMessage = 'my new message'; - const changesMock: SimpleChanges = { - recordCountTooHighMessage: new SimpleChange('old message', 'my new message', false), - }; + const changesMock: SimpleChanges = {recordCountTooHighMessage: new SimpleChange('old message', 'my new message', false)}; // Fake the change event that Angular would normally trigger component.ngOnChanges(changesMock); @@ -75,17 +73,13 @@ describe(`TsPaginatorComponent`, function() { test(`should reset currentPageIndex if isZeroBased changed`, () => { - const changesMock1: SimpleChanges = { - isZeroBased: new SimpleChange(true, false, false), - }; + const changesMock1: SimpleChanges = {isZeroBased: new SimpleChange(true, false, false)}; // Fake the change event that Angular would normally trigger component.ngOnChanges(changesMock1); expect(component.currentPageIndex).toEqual(1); - const changesMock2: SimpleChanges = { - isZeroBased: new SimpleChange(false, true, false), - }; + const changesMock2: SimpleChanges = {isZeroBased: new SimpleChange(false, true, false)}; // Fake the change event that Angular would normally trigger component.ngOnChanges(changesMock2); @@ -422,12 +416,8 @@ describe(`TsPaginatorComponent`, function() { describe(`trackPagesArray()`, () => { test(`should return a tracking property or undefined`, () => { - expect(component.trackPagesArray(1, { - name: 'foo', - })).toEqual('foo'); - expect(component.trackPagesArray(2, { - name: 'bar', - })).toEqual('bar'); + expect(component.trackPagesArray(1, {name: 'foo'})).toEqual('foo'); + expect(component.trackPagesArray(2, {name: 'bar'})).toEqual('bar'); expect(component.trackPagesArray(3, null as any)).toBeUndefined(); }); diff --git a/terminus-ui/paginator/src/paginator.component.ts b/terminus-ui/paginator/src/paginator.component.ts index 35a48d1a9..d930a1e11 100644 --- a/terminus-ui/paginator/src/paginator.component.ts +++ b/terminus-ui/paginator/src/paginator.component.ts @@ -97,9 +97,7 @@ const DEFAULT_RECORDS_PER_PAGE_OPTIONS: number[] = [10, 20, 50]; selector: 'ts-paginator', templateUrl: './paginator.component.html', styleUrls: ['./paginator.component.scss'], - host: { - class: 'ts-paginator', - }, + host: {class: 'ts-paginator'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsPaginator', @@ -149,9 +147,7 @@ export class TsPaginatorComponent implements OnChanges, AfterViewInit { /** * Define the template context for the record count message */ - public templateContext = { - $implicit: this.DEFAULT_HIGH_RECORD_MESSAGE, - }; + public templateContext = {$implicit: this.DEFAULT_HIGH_RECORD_MESSAGE}; /** * GETTERS @@ -506,9 +502,7 @@ export class TsPaginatorComponent implements OnChanges, AfterViewInit { // This may be the case if there are no records if (!foundPage || !foundPage.name) { - foundPage = { - name: '0', - }; + foundPage = {name: '0'}; } // '1 - 10 of 243' diff --git a/terminus-ui/pipes/src/date/date.pipe.ts b/terminus-ui/pipes/src/date/date.pipe.ts index 856643016..4dcf8a73a 100644 --- a/terminus-ui/pipes/src/date/date.pipe.ts +++ b/terminus-ui/pipes/src/date/date.pipe.ts @@ -33,9 +33,7 @@ export type TsDateTypes = * * https://getterminus.github.io/ui-demos-master/components/pipes */ -@Pipe({ - name: 'tsDate', -}) +@Pipe({name: 'tsDate'}) export class TsDatePipe implements PipeTransform { public transform(value: string|Date, format: TsDateTypes = 'short'): string | undefined { const validFormats: TsDateTypes[] = [ diff --git a/terminus-ui/pipes/src/round-number/round-number.pipe.ts b/terminus-ui/pipes/src/round-number/round-number.pipe.ts index 0d1628467..d8900b2c3 100644 --- a/terminus-ui/pipes/src/round-number/round-number.pipe.ts +++ b/terminus-ui/pipes/src/round-number/round-number.pipe.ts @@ -14,9 +14,7 @@ import { roundNumber } from '@terminus/ngx-tools'; * * https://getterminus.github.io/ui-demos-master/components/pipes */ -@Pipe({ - name: 'tsRoundNumber', -}) +@Pipe({name: 'tsRoundNumber'}) export class TsRoundNumberPipe implements PipeTransform { public transform(value: number, precision = 0): number | undefined { // Check for null values to avoid issues during data-binding diff --git a/terminus-ui/pipes/src/sentence-case/sentence-case.pipe.ts b/terminus-ui/pipes/src/sentence-case/sentence-case.pipe.ts index 0045f8784..7a8926c91 100644 --- a/terminus-ui/pipes/src/sentence-case/sentence-case.pipe.ts +++ b/terminus-ui/pipes/src/sentence-case/sentence-case.pipe.ts @@ -12,9 +12,7 @@ import { * * https://getterminus.github.io/ui-demos-master/components/pipes */ -@Pipe({ - name: 'tsSentenceCase', -}) +@Pipe({name: 'tsSentenceCase'}) export class TsSentenceCasePipe implements PipeTransform { public transform(value: string): string | undefined { // Check for null values to avoid issues during data-binding diff --git a/terminus-ui/pipes/src/time-ago/time-ago.pipe.ts b/terminus-ui/pipes/src/time-ago/time-ago.pipe.ts index c3a90cda7..f66b4b79a 100644 --- a/terminus-ui/pipes/src/time-ago/time-ago.pipe.ts +++ b/terminus-ui/pipes/src/time-ago/time-ago.pipe.ts @@ -17,9 +17,7 @@ import { * * https://getterminus.github.io/ui-demos-master/components/pipes */ -@Pipe({ - name: 'tsTimeAgo', -}) +@Pipe({name: 'tsTimeAgo'}) export class TsTimeAgoPipe implements PipeTransform { public transform(value: string | Date, comparedDate: string | Date): string | undefined { // Check for null values to avoid issues during data-binding diff --git a/terminus-ui/pipes/src/title-case/title-case.pipe.ts b/terminus-ui/pipes/src/title-case/title-case.pipe.ts index 3df0a60fd..372ef45e7 100644 --- a/terminus-ui/pipes/src/title-case/title-case.pipe.ts +++ b/terminus-ui/pipes/src/title-case/title-case.pipe.ts @@ -12,9 +12,7 @@ import { * * https://getterminus.github.io/ui-demos-master/components/pipes */ -@Pipe({ - name: 'tsTitleCase', -}) +@Pipe({name: 'tsTitleCase'}) export class TsTitleCasePipe implements PipeTransform { public transform(value: string): string | undefined { // Check for null values to avoid issues during data-binding diff --git a/terminus-ui/pipes/src/truncate/truncate.pipe.ts b/terminus-ui/pipes/src/truncate/truncate.pipe.ts index 3f72ac411..503981359 100644 --- a/terminus-ui/pipes/src/truncate/truncate.pipe.ts +++ b/terminus-ui/pipes/src/truncate/truncate.pipe.ts @@ -34,9 +34,7 @@ export const allowedTruncationTypes: TsTruncatePositionType[] = [ * * https://getterminus.github.io/ui-demos-master/components/pipes */ -@Pipe({ - name: 'tsTruncateAt', -}) +@Pipe({name: 'tsTruncateAt'}) export class TsTruncateAtPipe implements PipeTransform { public transform(value: string, charCount = 0, position: TsTruncatePositionType = 'end'): string | undefined { // Check for null values to avoid issues during data-binding diff --git a/terminus-ui/radio-group/src/radio-group.component.ts b/terminus-ui/radio-group/src/radio-group.component.ts index 11f7be765..4ebc88c95 100644 --- a/terminus-ui/radio-group/src/radio-group.component.ts +++ b/terminus-ui/radio-group/src/radio-group.component.ts @@ -89,9 +89,7 @@ let nextUniqueId = 0; selector: 'ts-radio-group', templateUrl: './radio-group.component.html', styleUrls: ['./radio-group.component.scss'], - host: { - class: 'ts-radio-group', - }, + host: {class: 'ts-radio-group'}, providers: [ControlValueAccessorProviderFactory(TsRadioGroupComponent)], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, diff --git a/terminus-ui/scrollbars/src/scrollbars.component.spec.ts b/terminus-ui/scrollbars/src/scrollbars.component.spec.ts index b4511e207..0d914f788 100644 --- a/terminus-ui/scrollbars/src/scrollbars.component.spec.ts +++ b/terminus-ui/scrollbars/src/scrollbars.component.spec.ts @@ -3,12 +3,8 @@ import { TsScrollbarsComponent } from './scrollbars.component'; const divMock = document.createElement('div'); Object.defineProperties(divMock, { - scrollHeight: { - get: () => 300, - }, - scrollWidth: { - get: () => 200, - }, + scrollHeight: {get: () => 300}, + scrollWidth: {get: () => 200}, }); class PerfectScrollbarDirectiveMock { @@ -22,9 +18,7 @@ class PerfectScrollbarDirectiveMock { x: this.elementRef.nativeElement.scrollLeft, y: this.elementRef.nativeElement.scrollTop, })); - elementRef = { - nativeElement: divMock, - }; + elementRef = {nativeElement: divMock}; scrollable = jest.fn().mockImplementation(() => true); scrollTo = jest.fn(); scrollToElement = jest.fn(); diff --git a/terminus-ui/scrollbars/src/scrollbars.component.ts b/terminus-ui/scrollbars/src/scrollbars.component.ts index 9a4b49689..f5844f333 100644 --- a/terminus-ui/scrollbars/src/scrollbars.component.ts +++ b/terminus-ui/scrollbars/src/scrollbars.component.ts @@ -78,9 +78,7 @@ const DEFAULT_SCROLL_SPEED = 400; // tslint:disable-next-line relative-url-prefix './../../../node_modules/perfect-scrollbar/css/perfect-scrollbar.css', ], - host: { - class: 'ts-scrollbars', - }, + host: {class: 'ts-scrollbars'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsScrollbars', diff --git a/terminus-ui/search/src/search.component.spec.ts b/terminus-ui/search/src/search.component.spec.ts index 04291fc55..0be2e2e57 100644 --- a/terminus-ui/search/src/search.component.spec.ts +++ b/terminus-ui/search/src/search.component.spec.ts @@ -55,14 +55,10 @@ describe('TsSearchComponent', function() { component.ngOnInit(); expect(component.currentQuery).toEqual('foo'); - component.searchForm.patchValue({ - query: ' foo 23 ', - }); + component.searchForm.patchValue({query: ' foo 23 '}); expect(component.currentQuery).toEqual('foo 23'); - component.searchForm.patchValue({ - query: null, - }); + component.searchForm.patchValue({query: null}); expect(component.currentQuery).toEqual(''); }); @@ -154,9 +150,7 @@ describe('TsSearchComponent', function() { test(`should emit an event if the form is valid`, () => { component['emitSubmit'](); - expect(component.submitted.emit).toHaveBeenCalledWith({ - query: 'foo', - }); + expect(component.submitted.emit).toHaveBeenCalledWith({query: 'foo'}); }); @@ -165,9 +159,7 @@ describe('TsSearchComponent', function() { component['debouncedEmit'](); jest.runAllTimers(); - expect(component.submitted.emit).toHaveBeenCalledWith({ - query: 'foo', - }); + expect(component.submitted.emit).toHaveBeenCalledWith({query: 'foo'}); }); }); diff --git a/terminus-ui/search/src/search.component.ts b/terminus-ui/search/src/search.component.ts index 7840ce38d..16ae7f615 100644 --- a/terminus-ui/search/src/search.component.ts +++ b/terminus-ui/search/src/search.component.ts @@ -65,9 +65,7 @@ const INPUT_MINIMUM_LENGTH = 2; selector: 'ts-search', templateUrl: './search.component.html', styleUrls: ['./search.component.scss'], - host: { - class: 'ts-search', - }, + host: {class: 'ts-search'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsSearch', @@ -222,9 +220,7 @@ export class TsSearchComponent implements OnInit { public ngOnInit(): void { // istanbul ignore else if (this.initialValue) { - this.searchForm.patchValue({ - query: this.initialValue, - }); + this.searchForm.patchValue({query: this.initialValue}); } } @@ -249,9 +245,7 @@ export class TsSearchComponent implements OnInit { * NOTE: This wrapper is needed so that we can pass the query value to the emitter */ private emitSubmit(): void { - this.submitted.emit({ - query: this.currentQuery, - }); + this.submitted.emit({query: this.currentQuery}); } } diff --git a/terminus-ui/select/src/autocomplete/autocomplete-panel.component.ts b/terminus-ui/select/src/autocomplete/autocomplete-panel.component.ts index bb0284610..31a28c1a0 100644 --- a/terminus-ui/select/src/autocomplete/autocomplete-panel.component.ts +++ b/terminus-ui/select/src/autocomplete/autocomplete-panel.component.ts @@ -54,9 +54,7 @@ let nextUniqueId = 0; selector: 'ts-autocomplete-panel', templateUrl: './autocomplete-panel.component.html', styleUrls: ['./autocomplete-panel.component.scss'], - host: { - class: 'ts-autocomplete-panel qa-autocomplete-panel', - }, + host: {class: 'ts-autocomplete-panel qa-autocomplete-panel'}, providers: [ { provide: TS_OPTION_PARENT_COMPONENT, diff --git a/terminus-ui/select/src/autocomplete/autocomplete-trigger.directive.ts b/terminus-ui/select/src/autocomplete/autocomplete-trigger.directive.ts index a0c51b363..5d9fcd538 100644 --- a/terminus-ui/select/src/autocomplete/autocomplete-trigger.directive.ts +++ b/terminus-ui/select/src/autocomplete/autocomplete-trigger.directive.ts @@ -547,9 +547,7 @@ export class TsAutocompleteTriggerDirective implements ControlV if (this.overlayRef) { // Update the panel width in case anything has changed - this.overlayRef.updateSize({ - width: this.getPanelWidth(), - }); + this.overlayRef.updateSize({width: this.getPanelWidth()}); } else { this.portal = new TemplatePortal(this.autocompletePanel.template, this.viewContainerRef); this.overlayRef = this.overlay.create(this.getOverlayConfig()); @@ -566,9 +564,7 @@ export class TsAutocompleteTriggerDirective implements ControlV this.viewportSubscription = this.viewportRuler.change().subscribe(() => { if (this.panelOpen && this.overlayRef) { - this.overlayRef.updateSize({ - width: this.getPanelWidth(), - }); + this.overlayRef.updateSize({width: this.getPanelWidth()}); } }); } diff --git a/terminus-ui/select/src/option/option-display.directive.ts b/terminus-ui/select/src/option/option-display.directive.ts index 3a26b36fb..362df24a0 100644 --- a/terminus-ui/select/src/option/option-display.directive.ts +++ b/terminus-ui/select/src/option/option-display.directive.ts @@ -7,9 +7,7 @@ import { /** * Directive used to allow the consumer to define the view text for a {@link TsSelectOptionComponent} */ -@Directive({ - selector: '[tsSelectOptionDisplay]', -}) +@Directive({selector: '[tsSelectOptionDisplay]'}) export class TsSelectOptionDisplayDirective { constructor( public elementRef: ElementRef, diff --git a/terminus-ui/select/src/select-animations.ts b/terminus-ui/select/src/select-animations.ts index 3f78524af..4a24daae7 100644 --- a/terminus-ui/select/src/select-animations.ts +++ b/terminus-ui/select/src/select-animations.ts @@ -40,9 +40,7 @@ export const tsSelectAnimations: { transform: 'scaleY(1)', })), transition('void => *', animate('120ms cubic-bezier(0, 0, 0.2, 1)')), - transition('* => void', animate('100ms 25ms linear', style({ - opacity: 0, - }))), + transition('* => void', animate('100ms 25ms linear', style({opacity: 0}))), ]), }; diff --git a/terminus-ui/select/src/select.component.spec.ts b/terminus-ui/select/src/select.component.spec.ts index 57a8e2a59..db82fb881 100644 --- a/terminus-ui/select/src/select.component.spec.ts +++ b/terminus-ui/select/src/select.component.spec.ts @@ -438,9 +438,7 @@ describe(`TsSelectComponent`, function() { expect(instance.panelOpen).toEqual(true); const event = createKeyboardEvent('keydown', KEYS.DOWN_ARROW); - Object.defineProperty(event, 'altKey', { - get: () => true, - }); + Object.defineProperty(event, 'altKey', {get: () => true}); dispatchEvent(element, event); fixture.detectChanges(); @@ -644,9 +642,7 @@ describe(`TsSelectComponent`, function() { openSelect(fixture); const event = createKeyboardEvent('keydown', KEYS.A, element); - Object.defineProperty(event, 'ctrlKey', { - get: () => true, - }); + Object.defineProperty(event, 'ctrlKey', {get: () => true}); dispatchEvent(element, event); fixture.detectChanges(); @@ -677,9 +673,7 @@ describe(`TsSelectComponent`, function() { fixture.detectChanges(); const event = createKeydownEvent(KEYS.DOWN_ARROW); - Object.defineProperty(event, 'shiftKey', { - get: () => true, - }); + Object.defineProperty(event, 'shiftKey', {get: () => true}); element.dispatchEvent(event); fixture.detectChanges(); @@ -687,9 +681,7 @@ describe(`TsSelectComponent`, function() { expect(instance.value).toEqual(['Florida']); const event2 = createKeyboardEvent('keydown', KEYS.UP_ARROW); - Object.defineProperty(event2, 'shiftKey', { - get: () => true, - }); + Object.defineProperty(event2, 'shiftKey', {get: () => true}); element.dispatchEvent(event2); fixture.detectChanges(); @@ -1402,9 +1394,7 @@ describe(`TsSelectComponent`, function() { instance['propagateChanges']('foo'); fixture.detectChanges(); - expect(fixture.componentInstance.change).toHaveBeenCalledWith(expect.objectContaining({ - value: 'foo', - })); + expect(fixture.componentInstance.change).toHaveBeenCalledWith(expect.objectContaining({value: 'foo'})); }); }); @@ -1513,9 +1503,7 @@ describe(`TsSelectComponent`, function() { fixture.detectChanges(); const option = getOptionInstance(fixture, 0, 1); - expect(option.option).toEqual(expect.objectContaining({ - name: 'Alabama', - })); + expect(option.option).toEqual(expect.objectContaining({name: 'Alabama'})); }); }); @@ -1627,9 +1615,7 @@ describe(`TsSelectComponent`, function() { expect(instance.panelOpen).toEqual(true); let event = createKeyboardEvent('keydown', KEYS.DOWN_ARROW); - Object.defineProperty(event, 'altKey', { - get: () => true, - }); + Object.defineProperty(event, 'altKey', {get: () => true}); dispatchEvent(getSelectElement(fixture), event); fixture.detectChanges(); @@ -1643,9 +1629,7 @@ describe(`TsSelectComponent`, function() { expect(instance.panelOpen).toEqual(true); event = createKeyboardEvent('keydown', KEYS.UP_ARROW); - Object.defineProperty(event, 'altKey', { - get: () => true, - }); + Object.defineProperty(event, 'altKey', {get: () => true}); dispatchEvent(getSelectElement(fixture), event); fixture.detectChanges(); diff --git a/terminus-ui/select/src/select.component.ts b/terminus-ui/select/src/select.component.ts index 43b451a02..11f84de28 100644 --- a/terminus-ui/select/src/select.component.ts +++ b/terminus-ui/select/src/select.component.ts @@ -483,9 +483,7 @@ export class TsSelectComponent implements /** * Access a list of all the defined select options */ - @ContentChildren(TsSelectOptionComponent, { - descendants: true, - }) + @ContentChildren(TsSelectOptionComponent, {descendants: true}) public options!: QueryList; /** @@ -944,9 +942,7 @@ export class TsSelectComponent implements // istanbul ignore else if (newValue) { if (this.autocomplete) { - this.autocompleteFormControl.setValue(newValue, { - emitEvent: false, - }); + this.autocompleteFormControl.setValue(newValue, {emitEvent: false}); this.autocompleteSelections = this.ngControl.value; } else { this.setSelectionByValue(newValue); diff --git a/terminus-ui/select/testing/src/test-helpers.ts b/terminus-ui/select/testing/src/test-helpers.ts index 693a29e3d..993401fe6 100644 --- a/terminus-ui/select/testing/src/test-helpers.ts +++ b/terminus-ui/select/testing/src/test-helpers.ts @@ -21,15 +21,9 @@ export function createKeydownEvent(key: KeyCode): KeyboardEvent { const event = document.createEvent('KeyboardEvent'); event.initEvent('keydown', true, false); Object.defineProperties(event, { - key: { - get: () => key.code, - }, - code: { - get: () => key.code, - }, - keyCode: { - get: () => key.keyCode, - }, + key: {get: () => key.code}, + code: {get: () => key.code}, + keyCode: {get: () => key.keyCode}, }); return event; } diff --git a/terminus-ui/sort/src/sort-animations.ts b/terminus-ui/sort/src/sort-animations.ts index ccc88fad3..d1f8c5cc9 100644 --- a/terminus-ui/sort/src/sort-animations.ts +++ b/terminus-ui/sort/src/sort-animations.ts @@ -28,13 +28,9 @@ export const tsSortAnimations: { * Animation that moves the sort indicator */ indicator: trigger('indicator', [ - state('asc', style({ - transform: 'translateY(0px)', - })), + state('asc', style({transform: 'translateY(0px)'})), // 10px is the height of the sort indicator, minus the width of the pointers - state('desc', style({ - transform: 'translateY(10px)', - })), + state('desc', style({transform: 'translateY(10px)'})), transition('asc <=> desc', animate(SORT_ANIMATION_TRANSITION)), ]), @@ -43,12 +39,8 @@ export const tsSortAnimations: { * Animation that rotates the left pointer of the indicator based on the sorting direction */ leftPointer: trigger('leftPointer', [ - state('asc', style({ - transform: 'rotate(-45deg)', - })), - state('desc', style({ - transform: 'rotate(45deg)', - })), + state('asc', style({transform: 'rotate(-45deg)'})), + state('desc', style({transform: 'rotate(45deg)'})), transition('asc <=> desc', animate(SORT_ANIMATION_TRANSITION)), ]), @@ -57,12 +49,8 @@ export const tsSortAnimations: { * Animation that rotates the right pointer of the indicator based on the sorting direction */ rightPointer: trigger('rightPointer', [ - state('asc', style({ - transform: 'rotate(45deg)', - })), - state('desc', style({ - transform: 'rotate(-45deg)', - })), + state('asc', style({transform: 'rotate(45deg)'})), + state('desc', style({transform: 'rotate(-45deg)'})), transition('asc <=> desc', animate(SORT_ANIMATION_TRANSITION)), ]), diff --git a/terminus-ui/sort/src/sort.spec.ts b/terminus-ui/sort/src/sort.spec.ts index c7c0f0574..26a1e093e 100644 --- a/terminus-ui/sort/src/sort.spec.ts +++ b/terminus-ui/sort/src/sort.spec.ts @@ -52,7 +52,7 @@ import { TsSortModule } from './sort.module'; function testSingleColumnSortDirectionSequence( fixture: ComponentFixture, expectedSequence: TsSortDirection[], - id: string = 'defaultSortHeaderA', + id = 'defaultSortHeaderA', ) { // Detect any changes that were made in preparation for this sort sequence fixture.detectChanges(); @@ -193,9 +193,7 @@ class TsTableTsSortApp { } -@Component({ - template: `
A
`, -}) +@Component({template: `
A
`}) class TsSortHeaderMissingTsSortApp { } diff --git a/terminus-ui/spacing/src/vertical-spacing.directive.ts b/terminus-ui/spacing/src/vertical-spacing.directive.ts index d2ec080c1..65b8ed310 100644 --- a/terminus-ui/spacing/src/vertical-spacing.directive.ts +++ b/terminus-ui/spacing/src/vertical-spacing.directive.ts @@ -45,9 +45,7 @@ export type TsVerticalSpacingTypes * * https://goo.gl/ieUPaG */ -@Directive({ - selector: '[tsVerticalSpacing]', -}) +@Directive({selector: '[tsVerticalSpacing]'}) export class TsVerticalSpacingDirective { /** * Set a spacing class based on the passed in value diff --git a/terminus-ui/table/src/table-data-source.spec.ts b/terminus-ui/table/src/table-data-source.spec.ts index d5c1ca55e..27ead3e49 100644 --- a/terminus-ui/table/src/table-data-source.spec.ts +++ b/terminus-ui/table/src/table-data-source.spec.ts @@ -14,17 +14,13 @@ describe(`TsTableDataSource`, function() { beforeEach(() => { source = new TsTableDataSource(); - seededSource = new TsTableDataSource([{ - foo: 'bar', - }]); + seededSource = new TsTableDataSource([{foo: 'bar'}]); }); test(`should initialize an empty array if no data passed in`, () => { expect(source.data).toEqual([]); - expect(seededSource.data).toEqual([{ - foo: 'bar', - }]); + expect(seededSource.data).toEqual([{foo: 'bar'}]); }); diff --git a/terminus-ui/table/src/table.component.ts b/terminus-ui/table/src/table.component.ts index 0b5cb0551..e95abfeb5 100644 --- a/terminus-ui/table/src/table.component.ts +++ b/terminus-ui/table/src/table.component.ts @@ -42,9 +42,7 @@ import { selector: 'ts-table', templateUrl: './table.component.html', styleUrls: ['./table.component.scss'], - host: { - class: 'ts-table', - }, + host: {class: 'ts-table'}, exportAs: 'tsTable', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/terminus-ui/tabs/src/body/tab-animations.ts b/terminus-ui/tabs/src/body/tab-animations.ts index 66a1cfd01..7c2759088 100644 --- a/terminus-ui/tabs/src/body/tab-animations.ts +++ b/terminus-ui/tabs/src/body/tab-animations.ts @@ -17,9 +17,7 @@ export const tsTabsAnimations: { // This animation translates a tab along the X axis translateTab: trigger('translateTab', [ // Note: transitions to `none` instead of 0, because some browsers might blur the content. - state('center, void, left-origin-center, right-origin-center', style({ - transform: 'none', - })), + state('center, void, left-origin-center, right-origin-center', style({transform: 'none'})), // NOTE: If the tab is either on the left or right, we additionally add a `min-height` of 1px in order to ensure that the element has a // height before its state changes. This is necessary because Chrome does seem to skip the transition in RTL mode if the element does @@ -47,16 +45,12 @@ export const tsTabsAnimations: { ), transition('void => left-origin-center', [ - style({ - transform: 'translate3d(-100%, 0, 0)', - }), + style({transform: 'translate3d(-100%, 0, 0)'}), animate('200ms cubic-bezier(0.35, 0, 0.25, 1)'), ]), transition('void => right-origin-center', [ - style({ - transform: 'translate3d(100%, 0, 0)', - }), + style({transform: 'translate3d(100%, 0, 0)'}), animate('200ms cubic-bezier(0.35, 0, 0.25, 1)'), ]), ]), diff --git a/terminus-ui/tabs/src/body/tab-body.component.ts b/terminus-ui/tabs/src/body/tab-body.component.ts index ef60eb4f5..dc06a882d 100644 --- a/terminus-ui/tabs/src/body/tab-body.component.ts +++ b/terminus-ui/tabs/src/body/tab-body.component.ts @@ -68,9 +68,7 @@ let nextUniqueId = 0; selector: 'ts-tab-body', templateUrl: './tab-body.component.html', styleUrls: ['./tab-body.component.scss'], - host: { - class: 'ts-tab-body', - }, + host: {class: 'ts-tab-body'}, animations: [tsTabsAnimations.translateTab], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, diff --git a/terminus-ui/tabs/src/body/tab-content.directive.ts b/terminus-ui/tabs/src/body/tab-content.directive.ts index 8a2850687..83202fad5 100644 --- a/terminus-ui/tabs/src/body/tab-content.directive.ts +++ b/terminus-ui/tabs/src/body/tab-content.directive.ts @@ -16,9 +16,7 @@ import { * * https://getterminus.github.io/ui-demos-master/components/tabs */ -@Directive({ - selector: '[tsTabContent]', -}) +@Directive({selector: '[tsTabContent]'}) export class TsTabContentDirective { constructor( // tslint:disable-next-line no-any diff --git a/terminus-ui/tabs/src/collection/tab-collection.component.spec.ts b/terminus-ui/tabs/src/collection/tab-collection.component.spec.ts index 7d870e986..2a03faec0 100644 --- a/terminus-ui/tabs/src/collection/tab-collection.component.spec.ts +++ b/terminus-ui/tabs/src/collection/tab-collection.component.spec.ts @@ -232,9 +232,7 @@ describe(`TsTabCollectionComponent`, function() { fixture.detectChanges(); expect(fixture.componentInstance.handleFocus).toHaveBeenCalledTimes(1); - expect(fixture.componentInstance.handleFocus).toHaveBeenCalledWith(expect.objectContaining({ - index: 1, - })); + expect(fixture.componentInstance.handleFocus).toHaveBeenCalledWith(expect.objectContaining({index: 1})); }); @@ -258,23 +256,15 @@ describe(`TsTabCollectionComponent`, function() { const KEY_EVENT = document.createEvent('KeyboardEvent'); KEY_EVENT.initEvent('keydown', true, false); Object.defineProperties(KEY_EVENT, { - code: { - get: () => KEYS.LEFT_ARROW.code, - }, - key: { - get: () => KEYS.LEFT_ARROW.code, - }, - keyCode: { - get: () => KEYS.LEFT_ARROW.keyCode, - }, + code: {get: () => KEYS.LEFT_ARROW.code}, + key: {get: () => KEYS.LEFT_ARROW.code}, + keyCode: {get: () => KEYS.LEFT_ARROW.keyCode}, }); tabLabelContainer.dispatchEvent(KEY_EVENT); fixture.detectChanges(); expect(fixture.componentInstance.handleFocus).toHaveBeenCalledTimes(2); - expect(fixture.componentInstance.handleFocus).toHaveBeenCalledWith(expect.objectContaining({ - index: 0, - })); + expect(fixture.componentInstance.handleFocus).toHaveBeenCalledWith(expect.objectContaining({index: 0})); }); }); @@ -638,11 +628,7 @@ describe(`TsTabCollectionComponent`, function() { const bodyInstance = fixture.debugElement.query(By.css('.ts-tab-body')).componentInstance; - Object.defineProperties(instance.tabBodyWrapper.nativeElement, { - offsetHeight: { - get: () => '80px', - }, - }); + Object.defineProperties(instance.tabBodyWrapper.nativeElement, {offsetHeight: {get: () => '80px'}}); instance.setTabBodyWrapperHeight(75); fixture.detectChanges(); diff --git a/terminus-ui/tabs/src/header/tab-header.component.spec.ts b/terminus-ui/tabs/src/header/tab-header.component.spec.ts index c405cce9b..2e2b50386 100644 --- a/terminus-ui/tabs/src/header/tab-header.component.spec.ts +++ b/terminus-ui/tabs/src/header/tab-header.component.spec.ts @@ -32,15 +32,9 @@ function createKeydownEvent(key: KeyCode): KeyboardEvent { const event = document.createEvent('KeyboardEvent'); event.initEvent('keydown', true, false); Object.defineProperties(event, { - keyCode: { - get: () => key.keyCode, - }, - key: { - get: () => key.code, - }, - code: { - get: () => key.code, - }, + keyCode: {get: () => key.keyCode}, + key: {get: () => key.code}, + code: {get: () => key.code}, }); event.preventDefault = jest.fn(); return event; @@ -236,9 +230,7 @@ describe(`TsTabHeaderComponent`, function() { test(`should not do anything if a modifier key is pressed`, () => { [EVENTS.RIGHT, EVENTS.ENTER].forEach(event => { - Object.defineProperty(event, 'shiftKey', { - get: () => true, - }); + Object.defineProperty(event, 'shiftKey', {get: () => true}); }); hostComponent.tabHeader.focusIndex = 0; @@ -282,28 +274,16 @@ describe(`TsTabHeaderComponent`, function() { tabElements = fixture.debugElement.queryAll(By.directive(TsTabLabelWrapperDirective)).map(d => d.nativeElement); // Set list scrollWidth - Object.defineProperties(listElement, { - scrollWidth: { - get: () => tabElements.length * 100, - }, - }); + Object.defineProperties(listElement, {scrollWidth: {get: () => tabElements.length * 100}}); // Set container width - Object.defineProperties(containerElement, { - offsetWidth: { - get: () => 300, - }, - }); + Object.defineProperties(containerElement, {offsetWidth: {get: () => 300}}); // Set tabs width and position for (let i = 0; i < tabElements.length; i += 1) { Object.defineProperties(tabElements[i], { - offsetLeft: { - get: () => i * 100, - }, - offsetWidth: { - get: () => 100, - }, + offsetLeft: {get: () => i * 100}, + offsetWidth: {get: () => 100}, }); } }; @@ -391,28 +371,16 @@ describe(`TsTabHeaderComponent`, function() { tabElements = fixture.debugElement.queryAll(By.directive(TsTabLabelWrapperDirective)).map(d => d.nativeElement); // Set list scrollWidth - Object.defineProperties(listElement, { - scrollWidth: { - get: () => tabElements.length * 100, - }, - }); + Object.defineProperties(listElement, {scrollWidth: {get: () => tabElements.length * 100}}); // Set container width - Object.defineProperties(containerElement, { - offsetWidth: { - get: () => 300, - }, - }); + Object.defineProperties(containerElement, {offsetWidth: {get: () => 300}}); // Set tabs width and position for (let i = 0; i < tabElements.length; i += 1) { Object.defineProperties(tabElements[i], { - offsetLeft: { - get: () => i * 100, - }, - offsetWidth: { - get: () => 100, - }, + offsetLeft: {get: () => i * 100}, + offsetWidth: {get: () => 100}, }); } }; @@ -661,26 +629,14 @@ describe(`TsTabHeaderComponent`, function() { // Set mock dimensions const listElement = fixture.componentInstance.tabHeader.tabList.nativeElement; - Object.defineProperties(listElement, { - scrollWidth: { - get: () => 600, - }, - }); - Object.defineProperties(headerElement, { - offsetWidth: { - get: () => 300, - }, - }); + Object.defineProperties(listElement, {scrollWidth: {get: () => 600}}); + Object.defineProperties(headerElement, {offsetWidth: {get: () => 300}}); // Change label content to trigger update labels.forEach(label => { label.style.width = ''; label.textContent += extraText; - Object.defineProperties(label, { - offsetWidth: { - get: () => 200, - }, - }); + Object.defineProperties(label, {offsetWidth: {get: () => 200}}); }); mutationCallbacks.forEach(callback => callback()); diff --git a/terminus-ui/tabs/src/header/tab-header.component.ts b/terminus-ui/tabs/src/header/tab-header.component.ts index 1fd15b04f..ec8e8d4fe 100644 --- a/terminus-ui/tabs/src/header/tab-header.component.ts +++ b/terminus-ui/tabs/src/header/tab-header.component.ts @@ -43,9 +43,7 @@ import { TsTabLabelWrapperDirective } from './../label/tab-label-wrapper.directi /** * Config used to bind passive event listeners */ -const passiveEventListenerOptions = normalizePassiveListenerOptions({ - passive: true, -}) as EventListenerOptions; +const passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true}) as EventListenerOptions; /** * The directions that scrolling can go in when the header's tabs exceed the header width. 'After' will scroll the header towards the end of diff --git a/terminus-ui/tabs/src/ink-bar/ink-bar.component.ts b/terminus-ui/tabs/src/ink-bar/ink-bar.component.ts index 4792cd0a7..548e8c510 100644 --- a/terminus-ui/tabs/src/ink-bar/ink-bar.component.ts +++ b/terminus-ui/tabs/src/ink-bar/ink-bar.component.ts @@ -19,9 +19,7 @@ import { isSet } from '@terminus/ngx-tools'; selector: 'ts-tab-ink-bar', template: ``, styleUrls: ['./ink-bar.component.scss'], - host: { - class: 'ts-ink-bar', - }, + host: {class: 'ts-ink-bar'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'tsTabInkBar', diff --git a/terminus-ui/tabs/src/tab/tab.component.ts b/terminus-ui/tabs/src/tab/tab.component.ts index 3e0d933f5..ecb70cba6 100644 --- a/terminus-ui/tabs/src/tab/tab.component.ts +++ b/terminus-ui/tabs/src/tab/tab.component.ts @@ -95,9 +95,7 @@ export class TsTabComponent implements OnInit, OnChanges, OnDestroy { * Template provided in the tab content that will be used if present, used to enable lazy-loading */ // FIXME: Switch to `{read: TemplateRef, static: true}` once Angular v8 hits - @ContentChild(TsTabContentDirective, { - read: TemplateRef, - }) + @ContentChild(TsTabContentDirective, {read: TemplateRef}) // tslint:disable-next-line no-any public explicitContent: TemplateRef | undefined; diff --git a/terminus-ui/tabs/testing/src/test-components.ts b/terminus-ui/tabs/testing/src/test-components.ts index b9c35c3f1..328f8bd87 100644 --- a/terminus-ui/tabs/testing/src/test-components.ts +++ b/terminus-ui/tabs/testing/src/test-components.ts @@ -275,9 +275,7 @@ export class TabHeader { public addTabsForScrolling(amount = 4) { for (let i = 0; i < amount; i++) { - this.tabs.push({ - label: 'new', - }); + this.tabs.push({label: 'new'}); } } } diff --git a/terminus-ui/toggle/src/toggle.component.ts b/terminus-ui/toggle/src/toggle.component.ts index 09b750f8c..b31579135 100644 --- a/terminus-ui/toggle/src/toggle.component.ts +++ b/terminus-ui/toggle/src/toggle.component.ts @@ -44,9 +44,7 @@ export class TsSlideToggleChange extends MatSlideToggleChange {} selector: 'ts-toggle', templateUrl: './toggle.component.html', styleUrls: ['./toggle.component.scss'], - host: { - class: 'ts-toggle', - }, + host: {class: 'ts-toggle'}, providers: [ControlValueAccessorProviderFactory(TsToggleComponent)], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, diff --git a/terminus-ui/tooltip/src/tooltip.component.ts b/terminus-ui/tooltip/src/tooltip.component.ts index 239f7ab59..7f1ffd963 100644 --- a/terminus-ui/tooltip/src/tooltip.component.ts +++ b/terminus-ui/tooltip/src/tooltip.component.ts @@ -48,9 +48,7 @@ export const allowedTooltipTypes: TsTooltipPositionTypes[] = [ selector: 'ts-tooltip', templateUrl: './tooltip.component.html', styleUrls: ['./tooltip.component.scss'], - host: { - class: 'ts-tooltip', - }, + host: {class: 'ts-tooltip'}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, }) diff --git a/terminus-ui/utilities/src/merge/merge.spec.ts b/terminus-ui/utilities/src/merge/merge.spec.ts index 3391531cf..34764b99c 100644 --- a/terminus-ui/utilities/src/merge/merge.spec.ts +++ b/terminus-ui/utilities/src/merge/merge.spec.ts @@ -6,9 +6,7 @@ describe(`merge`, function() { key1: {}, key2: 'test', key3: [5, 2, 76, 21], - key4: { - key4a: 'foo', - }, + key4: {key4a: 'foo'}, }; const obj2 = { key1: { @@ -16,9 +14,7 @@ describe(`merge`, function() { ik2: 'world', ik3: 3, }, - key4: { - key4b: 'bar', - }, + key4: {key4b: 'bar'}, }; const expected = { key1: { diff --git a/terminus-ui/utilities/src/merge/merge.ts b/terminus-ui/utilities/src/merge/merge.ts index 04fe32db1..7ccad8115 100644 --- a/terminus-ui/utilities/src/merge/merge.ts +++ b/terminus-ui/utilities/src/merge/merge.ts @@ -9,9 +9,7 @@ * @return A new object */ export function merge(obj1: object, obj2: object): object { - const freshObject: object = { - ...obj1, - }; + const freshObject: object = {...obj1}; for (const n in obj2) { if (typeof freshObject[n] !== 'object') { diff --git a/terminus-ui/validation-messages/src/validation-messages.component.spec.ts b/terminus-ui/validation-messages/src/validation-messages.component.spec.ts index 4e1712399..ee401399d 100644 --- a/terminus-ui/validation-messages/src/validation-messages.component.spec.ts +++ b/terminus-ui/validation-messages/src/validation-messages.component.spec.ts @@ -24,15 +24,11 @@ describe('InputMessagesComponent', function() { describe(`get validationMessage()`, () => { test(`should return messages for validation errors if the control has been touched`, () => { - const ERROR = { - valid: false, - }; + const ERROR = {valid: false}; component.validateOnChange = false; component.control = { touched: true, - errors: { - invalidEmail: ERROR, - }, + errors: {invalidEmail: ERROR}, } as any; // tslint:disable: no-unused-variable const message = component.validationMessage; @@ -57,14 +53,10 @@ describe('InputMessagesComponent', function() { test(`should return null if the control hasn't been touched`, () => { - const ERROR = { - valid: false, - }; + const ERROR = {valid: false}; component.control = { touched: false, - errors: { - invalidEmail: ERROR, - }, + errors: {invalidEmail: ERROR}, } as any; const message = component.validationMessage; diff --git a/terminus-ui/validation-messages/src/validation-messages.component.ts b/terminus-ui/validation-messages/src/validation-messages.component.ts index 1ac2d6465..293d7b337 100644 --- a/terminus-ui/validation-messages/src/validation-messages.component.ts +++ b/terminus-ui/validation-messages/src/validation-messages.component.ts @@ -34,9 +34,7 @@ let nextUniqueId = 0; selector: 'ts-validation-messages', templateUrl: './validation-messages.component.html', styleUrls: ['./validation-messages.component.scss'], - host: { - class: 'ts-validation-messages', - }, + host: {class: 'ts-validation-messages'}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'tsValidationMessages', diff --git a/terminus-ui/validation-messages/src/validation-messages.services.spec.ts b/terminus-ui/validation-messages/src/validation-messages.services.spec.ts index 3b97f4472..2690054a2 100644 --- a/terminus-ui/validation-messages/src/validation-messages.services.spec.ts +++ b/terminus-ui/validation-messages/src/validation-messages.services.spec.ts @@ -19,9 +19,7 @@ describe(`TsValidationMessagesService`, function() { describe(`getValidatorErrorMessage()`, () => { test(`should return a supplied minLength message`, () => { - const validatorValueMock = { - requiredLength: 9, - }; + const validatorValueMock = {requiredLength: 9}; const actual = service.getValidatorErrorMessage('minLength', validatorValueMock); const expected = `be at least 9`; @@ -30,9 +28,7 @@ describe(`TsValidationMessagesService`, function() { test(`should return an error message when supplied lowercase letters less than required`, () => { - const validatorValueMock = { - lowercase: 4, - }; + const validatorValueMock = {lowercase: 4}; const actual = service.getValidatorErrorMessage('lowercase', validatorValueMock); const expected = `4 lowercase letters`; @@ -41,9 +37,7 @@ describe(`TsValidationMessagesService`, function() { test(`should return a maxLength message`, () => { - const validatorValueMock = { - requiredLength: 12, - }; + const validatorValueMock = {requiredLength: 12}; const actual = service.getValidatorErrorMessage('maxLength', validatorValueMock); const expected = `less than 12`; @@ -80,9 +74,7 @@ describe(`TsValidationMessagesService`, function() { test(`should return a maxLength message`, () => { - const validatorValueMock = { - actual: '3:12', - }; + const validatorValueMock = {actual: '3:12'}; const actual = service.getValidatorErrorMessage('imageRatio', validatorValueMock); const expected = `3:12 is not an allowed image ratio.`; @@ -115,9 +107,7 @@ describe(`TsValidationMessagesService`, function() { }); test(`requiredTrue should return requiredTrue message`, () => { - const validatorValueMock = { - actual: false, - }; + const validatorValueMock = {actual: false}; const actual = service.getValidatorErrorMessage('requiredTrue', validatorValueMock); const expected = `be checked.`; diff --git a/yarn.lock b/yarn.lock index 5b67edcc3..b2aabb255 100644 --- a/yarn.lock +++ b/yarn.lock @@ -780,10 +780,10 @@ into-stream "^4.0.0" lodash "^4.17.4" -"@terminus/eslint-config-frontend@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@terminus/eslint-config-frontend/-/eslint-config-frontend-1.0.2.tgz#d155a0f8162dc452a1d03341dd24ec02293ab45b" - integrity sha512-GLfmGaQEzJW2B5S1oLjh45a9oM/bbrhTPxktZfybiQjeoIM8EG1AqoHgBxlqeZWrHBKq4RaRtrvwPKbGrhQa+w== +"@terminus/eslint-config-frontend@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@terminus/eslint-config-frontend/-/eslint-config-frontend-1.0.3.tgz#2641a474f0ea9463022c692acb151f2d0babb8e6" + integrity sha512-kjUY4L2VUpQsLxgKT5wy5ElLO3YzzPVuPt6XQh8Yaz20788GxEzXrU4Hh3tqqpnlhJ3QFWowvITVwShiLSgWTQ== dependencies: "@typescript-eslint/eslint-plugin" "^1.4.2" "@typescript-eslint/eslint-plugin-tslint" "^1.4.2"