Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuckner committed Dec 19, 2024
1 parent 776a1e2 commit 08cc63e
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 93 deletions.
6 changes: 3 additions & 3 deletions packages/banner-thermometer/demo/app-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class AppRoot extends LitElement {
const value = (e.target as HTMLInputElement).value;
this.thermometer.style.setProperty(
'--bannerThermometerProgressColor',
value
value,
);
}

Expand All @@ -267,7 +267,7 @@ export class AppRoot extends LitElement {
const value = (e.target as HTMLInputElement).value;
this.thermometer.style.setProperty(
'--bannerThermometerBackgroundColor',
value
value,
);
}

Expand All @@ -276,7 +276,7 @@ export class AppRoot extends LitElement {
const value = (e.target as HTMLInputElement).value;
this.thermometer.style.setProperty(
'--bannerThermometerMarkerBorder',
value
value,
);
}

Expand Down
13 changes: 7 additions & 6 deletions packages/banner-thermometer/src/banner-thermometer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export type CurrentAmountMode = 'on' | 'off';
@customElement('donation-banner-thermometer')
export class DonationBannerThermometer
extends LitElement
implements SharedResizeObserverResizeHandlerInterface {
implements SharedResizeObserverResizeHandlerInterface
{
@property({ type: String }) goalMessageMode: GoalMessageMode = 'amount';

@property({ type: String }) goalNearMessage =
Expand Down Expand Up @@ -101,7 +102,7 @@ export class DonationBannerThermometer
updated(changed: PropertyValues): void {
if (changed.has('resizeObserver')) {
const oldObserver = changed.get(
'resizeObserver'
'resizeObserver',
) as SharedResizeObserverInterface;
this.disconnectResizeObserver(oldObserver);
this.setupResizeObserver(this.resizeObserver);
Expand All @@ -124,7 +125,7 @@ export class DonationBannerThermometer
case this.shadowRoot?.host:
this.style.setProperty(
'--bannerThermometerHeight',
entry.contentRect.height + 'px'
entry.contentRect.height + 'px',
);
break;
case this.thermometerValue:
Expand Down Expand Up @@ -153,7 +154,7 @@ export class DonationBannerThermometer
}

private disconnectResizeObserver(
observer?: SharedResizeObserverInterface
observer?: SharedResizeObserverInterface,
): void {
/* istanbul ignore next */
if (!this.shadowRoot?.host || !observer) return;
Expand All @@ -171,7 +172,7 @@ export class DonationBannerThermometer
}

private observeCurrentAmountResize(
observer?: SharedResizeObserverInterface
observer?: SharedResizeObserverInterface,
): void {
if (!this.thermometerValue || !observer) return;
observer?.addObserver({
Expand All @@ -181,7 +182,7 @@ export class DonationBannerThermometer
}

private unobserveCurrentAmountResize(
observer?: SharedResizeObserverInterface
observer?: SharedResizeObserverInterface,
): void {
if (!this.thermometerValue || !observer) return;
observer?.removeObserver({
Expand Down
24 changes: 12 additions & 12 deletions packages/banner-thermometer/test/banner-thermometer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ describe('DonationBannerThermometer', () => {
`);

const goalMessage = el.shadowRoot?.querySelector(
'.donate-goal'
'.donate-goal',
) as HTMLDivElement;
const currentValue = el.shadowRoot?.querySelector(
'.thermometer-value'
'.thermometer-value',
) as HTMLDivElement;
expect(goalMessage.innerText).to.equal('$1MM GOAL');
expect(currentValue.innerText).to.equal('$0.5MM');
Expand Down Expand Up @@ -76,7 +76,7 @@ describe('DonationBannerThermometer', () => {
`);

const goalMessage = el.shadowRoot?.querySelector(
'.donate-goal'
'.donate-goal',
) as HTMLDivElement;
expect(goalMessage.innerText).to.equal('GOAL MET');
});
Expand All @@ -93,7 +93,7 @@ describe('DonationBannerThermometer', () => {
`);

const goalMessage = el.shadowRoot?.querySelector(
'.donate-goal'
'.donate-goal',
) as HTMLDivElement;
expect(goalMessage.innerText).to.equal('GOAL NEAR');
});
Expand All @@ -108,7 +108,7 @@ describe('DonationBannerThermometer', () => {
`);

const currentAmountMessage = el.shadowRoot?.querySelector(
'.thermometer-value'
'.thermometer-value',
) as HTMLDivElement;
expect(currentAmountMessage.innerText).to.equal('$35MM');
});
Expand All @@ -122,10 +122,10 @@ describe('DonationBannerThermometer', () => {
`);

const thermometerValue = el.shadowRoot?.querySelector(
'.thermometer-value'
'.thermometer-value',
) as HTMLDivElement;
const thermometerFill = el.shadowRoot?.querySelector(
'.thermometer-fill'
'.thermometer-fill',
) as HTMLDivElement;

const sizes = new Map<Element, DOMRectReadOnly>();
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('DonationBannerThermometer', () => {

await el.updateComplete;
const thermometerBackground = el.shadowRoot?.querySelector(
'.thermometer-background'
'.thermometer-background',
) as HTMLDivElement;
expect(thermometerBackground.classList.contains('value-right')).to.be.true;
});
Expand All @@ -179,10 +179,10 @@ describe('DonationBannerThermometer', () => {
`);

const thermometerValue = el.shadowRoot?.querySelector(
'.thermometer-value'
'.thermometer-value',
) as HTMLDivElement;
const thermometerFill = el.shadowRoot?.querySelector(
'.thermometer-fill'
'.thermometer-fill',
) as HTMLDivElement;

const sizes = new Map<Element, DOMRectReadOnly>();
Expand Down Expand Up @@ -222,7 +222,7 @@ describe('DonationBannerThermometer', () => {

await el.updateComplete;
const thermometerBackground = el.shadowRoot?.querySelector(
'.thermometer-background'
'.thermometer-background',
) as HTMLDivElement;
expect(thermometerBackground.classList.contains('value-left')).to.be.true;
});
Expand Down Expand Up @@ -264,7 +264,7 @@ describe('DonationBannerThermometer', () => {

await el.updateComplete;
const styleProperty = el.style.getPropertyValue(
'--bannerThermometerHeight'
'--bannerThermometerHeight',
);
expect(styleProperty).to.equal('35px');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ export class PaymentClients implements PaymentClientsInterface {
this.environment = environment;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
private async loadBraintreeScript(scriptName: string): Promise<void> {
const extension = this.environment === HostingEnvironment.Production ? 'min.js' : 'js';
const scriptWithSuffix = `${scriptName}.${extension}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class ApplePayHandler implements ApplePayHandlerInterface {
this.applePayClient = options.applePayClient;
this.applePaySessionManager = options.applePaySessionManager;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.instance =
options.instancePromisedSingleton ??
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
1 change: 0 additions & 1 deletion packages/donation-form/src/donation-form-controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import { LitElement, html, PropertyValues, TemplateResult } from 'lit';
import { customElement, property, query } from 'lit/decorators.js';

Expand Down
1 change: 0 additions & 1 deletion packages/donation-form/src/donation-form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import { LitElement, html, css, CSSResult, TemplateResult, PropertyValues } from 'lit';
import { customElement, property, query } from 'lit/decorators.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/ban-types */
import { LitElement, html, TemplateResult, css, CSSResultGroup } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { DonationType } from '@internetarchive/donation-form-data-models';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import { html } from 'lit';
import { ModalConfig, ModalManagerInterface } from '@internetarchive/modal-manager';
import { UpsellModalCTAMode } from '../modals/upsell-modal-content';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ export class PayPalFlowHandler
}

async payPalPaymentStarted(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
dataSource: PayPalButtonDataSourceInterface,
// eslint-disable-next-line @typescript-eslint/no-unused-vars

options: object,
): Promise<void> {
this.emitter.emit('payPalPaymentStarted', dataSource, options);
Expand Down Expand Up @@ -216,9 +215,8 @@ export class PayPalFlowHandler
}

async payPalPaymentCancelled(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
dataSource: PayPalButtonDataSourceInterface,
// eslint-disable-next-line @typescript-eslint/no-unused-vars

data: object,
): Promise<void> {
this.emitter.emit('payPalPaymentCancelled', dataSource, data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-types */
import { ModalManagerInterface } from '@internetarchive/modal-manager';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Emitter, createNanoEvents, Unsubscribe } from 'nanoevents';
import {
CreditCardFlowHandlerInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
BraintreeManagerEvents,
Expand Down
1 change: 0 additions & 1 deletion packages/donation-form/test/mocks/mock-lazy-loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
LazyLoaderServiceEvents,
Expand Down
1 change: 0 additions & 1 deletion packages/donation-form/test/mocks/mock-modal-manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { ModalManager, ModalConfig, ModalManagerMode } from '@internetarchive/modal-manager';
import { TemplateResult } from 'lit';
import { customElement } from 'lit/decorators.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/donation-form/test/mocks/mock-payment-clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class MockPaymentClients implements PaymentClientsInterface {
resolve(mockGooglePayLibrary);
}),
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any

this.paypalLibrary =
generators?.paypalLibrary ??
new PromisedSingleton<any>({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
export class MockApplePaySession implements ApplePaySession {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */

export enum MockGrecaptchaMode {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { expect } from '@open-wc/testing';

import { BraintreeManager } from '../../src/braintree-manager/braintree-manager';
Expand Down
Loading

0 comments on commit 08cc63e

Please sign in to comment.