Skip to content

Commit

Permalink
feat(eslint-config): restore legacy lint rules (#2728)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Jan 25, 2024
1 parent 2626da8 commit 97e9203
Show file tree
Hide file tree
Showing 54 changed files with 376 additions and 67 deletions.
6 changes: 5 additions & 1 deletion apps/daffio/src/app/docs/resolvers/docs-resolver.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import {
ActivatedRouteSnapshot,
RouterStateSnapshot,
Router,
} from '@angular/router';
import {
Observable,
EMPTY,
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { environment } from '../environments/environment';
StoreDevtoolsModule.instrument({
maxAge: 25, // Retains last 25 states
logOnly: environment.production, // Restrict extension to log-only mode
connectInZone: true
connectInZone: true,
}),

AppRoutingModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('ProductGridComponent', () => {

fixture = TestBed.createComponent(WrapperComponent);
wrapper = fixture.componentInstance;
wrapper.productsValue = new Array(productFactory.create(), productFactory.create());
wrapper.productsValue = [productFactory.create(), productFactory.create()];

fixture.detectChanges();

Expand Down
2 changes: 2 additions & 0 deletions apps/demo/src/app/routing/router-percent-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export enum RouterPercentEnum {
ResolveStart = 70,
ResolveEnd = 80,
NavigationEnd = 100,
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
NavigationCancel = 100,
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
NavigationError = 100
}
4 changes: 2 additions & 2 deletions libs/analytics-provider-data-layer/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = {
],
parserOptions: {
project: [
'libs/analytics/tsconfig.lib.json',
'libs/analytics/tsconfig.spec.json'
'libs/analytics-provider-data-layer/tsconfig.lib.json',
'libs/analytics-provider-data-layer/tsconfig.spec.json'
],
createDefaultProgram: true
},
Expand Down
2 changes: 1 addition & 1 deletion libs/authorizenet/driver/src/errors/error-codes.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export enum DaffAuthorizeNetDriverErrorCodes {
AUTH_FAILED = 'DAFF_AUTHORIZE_NET_AUTH_FAILED',
INPUT_MISSING = 'DAFF_AUTHORIZE_NET_INPUT_MISSING',
INSECURE_CONNECTION = 'DAFF_AUTHORIZE_NET_INSECURE_CONNECTION',
INVALID_API_RESPONSE = 'DAFF_AUTHORIZE_NET_ACCEPTJS_INVALID',
INVALID_API_RESPONSE = 'DAFF_AUTHORIZE_NET_INVALID_API_RESPONSE',
INVALID_CC_CVV = 'DAFF_AUTHORIZE_NET_INVALID_CC_CVV',
INVALID_CC_EXP_MONTH = 'DAFF_AUTHORIZE_NET_INVALID_CC_EXP_MONTH',
INVALID_CC_EXP_YEAR = 'DAFF_AUTHORIZE_NET_INVALID_CC_EXP_YEAR',
Expand Down
4 changes: 2 additions & 2 deletions libs/cart-store-credit/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = {
],
parserOptions: {
project: [
'libs/cart/tsconfig.lib.json',
'libs/cart/tsconfig.spec.json'
'libs/cart-store-credit/tsconfig.lib.json',
'libs/cart-store-credit/tsconfig.spec.json'
],
createDefaultProgram: true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import {
Injectable,
Inject,
} from '@angular/core';
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
import {
ActivatedRouteSnapshot,
Router,
RouterStateSnapshot,
UrlTree,
} from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import {
Injectable,
Inject,
} from '@angular/core';
import { Router, UrlTree } from '@angular/router';
import {
Router,
UrlTree,
} from '@angular/router';
import {
Observable,
iif,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import {
Injectable,
Inject,
} from '@angular/core';
import { Router, UrlTree } from '@angular/router';
import {
Router,
UrlTree,
} from '@angular/router';
import { Observable } from 'rxjs';
import {
tap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import {
Injectable,
PLATFORM_ID,
} from '@angular/core';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import {
ActivatedRouteSnapshot,
RouterStateSnapshot,
} from '@angular/router';
import { ofType } from '@ngrx/effects';
import {
ActionsSubject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MagentoContentBlock } from '@daffodil/content/driver/magento';
import { DaffModelFactory } from '@daffodil/core/testing';

export class MockMagentoContentBlock implements MagentoContentBlock {
__typename: 'CmsBlock' = 'CmsBlock';
__typename = <const>'CmsBlock';
identifier = faker.datatype.uuid();
title = faker.random.word();
content = faker.random.words(5);
Expand Down
2 changes: 1 addition & 1 deletion libs/core/src/utils/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
* @returns number
*/
export const range = (start: number, end: number): Array<number> =>
Array.apply(null, Array(end - start + 1)).map((val, index) => index + start);
Array(end - start + 1).fill(0).map((val, index) => index + start);

1 change: 1 addition & 0 deletions libs/core/state/src/states/state.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ export const enum DaffState {
* @deprecated
* Use DaffState.Stable instead.
*/
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
Complete = 'Stable'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DaffFilterRangeNumericOptionFactory } from './option';
import { DaffModelFactory } from '../../../factory';

export class MockDaffFilterRangeNumericPair implements DaffFilterRangePair<number> {
applied: true = true;
applied = <const>true;
max: DaffFilterRangeOption<number>;
min: DaffFilterRangeOption<number>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {

export class MockMagentoCustomerOrder implements MagentoCustomerOrder {
protected _numberOfSuborders = faker.datatype.number({ min: 1, max: 3 });
__typename: 'CustomerOrder' = 'CustomerOrder';
__typename = <const>'CustomerOrder';
id = faker.datatype.uuid();
order_date = faker.date.past().toString();
status = faker.random.word();
Expand Down
4 changes: 2 additions & 2 deletions libs/customer-payment-authorizenet/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = {
],
parserOptions: {
project: [
'libs/customer/tsconfig.lib.json',
'libs/customer/tsconfig.spec.json'
'libs/customer-payment-authorizenet/tsconfig.lib.json',
'libs/customer-payment-authorizenet/tsconfig.spec.json'
],
createDefaultProgram: true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@daffodil/customer-payment-authorizenet/driver/magento';

export class MockMagentoTokenBaseCard implements MagentoTokenBaseCard {
__typename: 'TokenBaseCard' = 'TokenBaseCard';
__typename = <const>'TokenBaseCard';
hash = faker.datatype.uuid();
address = this.addressFactory.create();
customer_email = faker.internet.email();
Expand Down
4 changes: 2 additions & 2 deletions libs/customer-payment/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = {
],
parserOptions: {
project: [
'libs/customer/tsconfig.lib.json',
'libs/customer/tsconfig.spec.json'
'libs/customer-payment/tsconfig.lib.json',
'libs/customer-payment/tsconfig.spec.json'
],
createDefaultProgram: true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';

import {
Observable,
of,
Expand Down
4 changes: 2 additions & 2 deletions libs/customer-store-credit/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = {
],
parserOptions: {
project: [
'libs/customer/tsconfig.lib.json',
'libs/customer/tsconfig.spec.json'
'libs/customer-store-credit/tsconfig.lib.json',
'libs/customer-store-credit/tsconfig.spec.json'
],
createDefaultProgram: true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MagentoCustomerStoreCredit } from '@daffodil/customer-store-credit/driv
import { MagentoMoneyFactory } from '@daffodil/driver/magento/testing';

export class MockMagentoCustomerStoreCredit implements MagentoCustomerStoreCredit {
__typename: 'CustomerStoreCredit' = 'CustomerStoreCredit';
__typename = <const>'CustomerStoreCredit';
current_balance = this.moneyFactory.create();
enabled = faker.datatype.boolean();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';

import {
Observable,
of,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { MagentoCustomerAddressFactory } from './address.factory';

class MockMagentoCustomer implements MagentoCustomer {
__typename: 'Customer' = 'Customer';
__typename = <const>'Customer';
email = faker.internet.email();
firstname = faker.name.firstName();
lastname = faker.name.lastName();
Expand Down
1 change: 0 additions & 1 deletion libs/customer/routing/src/resolvers/customer.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';

import {
Observable,
of,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
ChangeDetectionStrategy,
Component,
OnInit,
} from '@angular/core';
import {
UntypedFormGroup,
Expand All @@ -14,14 +13,10 @@ import {
templateUrl: './basic-radio.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BasicRadioComponent implements OnInit {

export class BasicRadioComponent {
radioGroup = new UntypedFormGroup({
race: new UntypedFormControl('Zerg'),
});
constructor() {
}

ngOnInit() {
}
constructor() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class DaffProgressIndicatorComponent extends _daffProgressIndicatorBase i
* @param event: AnimationEvent
*/
onAnimationComplete(event: AnimationEvent): void {
// @ts-ignore: @angular/animations typing error on event.toState as string
// @ts-expect-error: @angular/animations typing error on event.toState as string
// See: https://github.com/angular/angular/issues/26507
if(event.toState === '100' || event.toState === 100) {
this.finished.emit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,9 @@ export class DaffQtyDropdownComponent implements OnInit {

private selectInput() {
// TODO: readdress this method
// why are we binding `this`?
// why use `setTimeout` instead of angular patterns?
const that = this;
setTimeout(() => {
const input = <HTMLInputElement>document.getElementById('input_' + that.id);
const input = <HTMLInputElement>document.getElementById('input_' + this.id);
input?.select();
});
}
Expand Down
7 changes: 6 additions & 1 deletion libs/external-router/routing/src/guard/existence.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import {
Inject,
PLATFORM_ID,
} from '@angular/core';
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
import {
ActivatedRouteSnapshot,
Router,
RouterStateSnapshot,
UrlTree,
} from '@angular/router';
import {
Observable,
of,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DaffModelFactory } from '@daffodil/core/testing';
import { MagentoOrderAddress } from '@daffodil/order/driver/magento/2-4-1';

export class MockOrderAddress implements MagentoOrderAddress {
__typename: 'OrderAddress' = 'OrderAddress';
__typename = <const>'OrderAddress';
street = [faker.address.streetName()];
city = faker.address.city();
region_id = faker.unique(faker.datatype.number);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MagentoOrderCreditItem } from '@daffodil/order/driver/magento/2-4-1';
import { MagentoOrderItemFactory } from './order-item.factory';

export class MockOrderCreditItem implements MagentoOrderCreditItem {
__typename: 'CreditMemoItem' = 'CreditMemoItem';
__typename = <const>'CreditMemoItem';
order_item = this.itemFactory.create();
quantity_refunded = faker.datatype.number({ min: 1, max: 100 });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MagentoOrderCreditItemFactory } from './order-credit-item.factory';
import { MagentoOrderTotalFactory } from './order-total.factory';

export class MockOrderCredit implements MagentoOrderCredit {
__typename: 'CreditMemo' = 'CreditMemo';
__typename = <const>'CreditMemo';
items = this.itemFactory.createMany(faker.datatype.number({ min: 1, max: 3 }));
total = this.totalFactory.create({
__typename: 'CreditMemoTotal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MagentoOrderInvoiceItem } from '@daffodil/order/driver/magento/2-4-1';
import { MagentoOrderItemFactory } from './order-item.factory';

export class MockOrderInvoiceItem implements MagentoOrderInvoiceItem {
__typename: 'InvoiceItem' = 'InvoiceItem';
__typename = <const>'InvoiceItem';
order_item = this.itemFactory.create();
quantity_invoiced = faker.datatype.number({ min: 1, max: 100 });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MagentoOrderInvoiceItemFactory } from './order-invoice-item.factory';
import { MagentoOrderTotalFactory } from './order-total.factory';

export class MockOrderInvoice implements MagentoOrderInvoice {
__typename: 'Invoice' = 'Invoice';
__typename = <const>'Invoice';
items = this.itemFactory.createMany(faker.datatype.number({ min: 1, max: 3 }));
total = this.totalFactory.create({
__typename: 'InvoiceTotal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DaffModelFactory } from '@daffodil/core/testing';
import { MagentoOrderPayment } from '@daffodil/order/driver/magento/2-4-1';

export class MockOrderPayment implements MagentoOrderPayment {
__typename: 'OrderPaymentMethod' = 'OrderPaymentMethod';
__typename = <const>'OrderPaymentMethod';
name = 'card';
type = 'visa';
additional_data = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MagentoOrderShipmentItem } from '@daffodil/order/driver/magento/2-4-1';
import { MagentoOrderItemFactory } from './order-item.factory';

export class MockOrderShipmentItem implements MagentoOrderShipmentItem {
__typename: 'ShipmentItem' = 'ShipmentItem';
__typename = <const>'ShipmentItem';
order_item = this.itemFactory.create();
quantity_shipped = faker.datatype.number({ min: 1, max: 100 });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DaffModelFactory } from '@daffodil/core/testing';
import { MagentoOrderShipmentTracking } from '@daffodil/order/driver/magento/2-4-1';

export class MockOrderShipmentTracking implements MagentoOrderShipmentTracking {
__typename: 'ShipmentTracking' = 'ShipmentTracking';
__typename = <const>'ShipmentTracking';
number = faker.random.alphaNumeric(16);
carrier = faker.random.word();
title = faker.random.word();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MagentoOrderShipmentItemFactory } from './order-shipment-item.factory';
import { MagentoOrderShipmentTrackingFactory } from './order-shipment-tracking.factory';

export class MockOrderShipment implements MagentoOrderShipment {
__typename: 'OrderShipment' = 'OrderShipment';
__typename = <const>'OrderShipment';
tracking = this.createTracking();
items = this.createItems();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { MagentoOrderShipmentFactory } from './order-shipment.factory';
import { MagentoOrderTotalFactory } from './order-total.factory';

export class MockOrder implements MagentoOrder {
__typename: 'GraycoreGuestOrder' = 'GraycoreGuestOrder';
__typename = <const>'GraycoreGuestOrder';
id = faker.datatype.uuid();
number = faker.datatype.uuid();
email = faker.internet.email();
Expand Down
2 changes: 1 addition & 1 deletion libs/paypal/driver/magento/src/constants/method.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const MAGENTO_PAYPAL_EXPRESS_PAYMENT_METHOD: 'paypal_express' = 'paypal_express';
export const MAGENTO_PAYPAL_EXPRESS_PAYMENT_METHOD = <const>'paypal_express';
Loading

0 comments on commit 97e9203

Please sign in to comment.