Browse Source

Task/enforce noImplicitOverride TypeScript rule (#7355)

* feat(ts): enable no implicit override

* fix(api): resolve type errors

* fix(client): resolve type errors

* fix(ui): resolve type errors

* fix(common): resolve type errors
pull/7374/head
Kenrick Tandrian 3 days ago
committed by GitHub
parent
commit
11db199b94
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      apps/api/src/guards/custom-throttler.guard.ts
  2. 2
      apps/api/src/models/rules/account-cluster-risk/current-investment.ts
  3. 2
      apps/api/src/models/rules/account-cluster-risk/single-account.ts
  4. 2
      apps/api/src/models/rules/asset-class-cluster-risk/equity.ts
  5. 2
      apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts
  6. 2
      apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts
  7. 2
      apps/api/src/models/rules/currency-cluster-risk/current-investment.ts
  8. 2
      apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts
  9. 2
      apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts
  10. 2
      apps/api/src/models/rules/emergency-fund/emergency-fund-setup.ts
  11. 2
      apps/api/src/models/rules/fees/fee-ratio-total-investment-volume.ts
  12. 2
      apps/api/src/models/rules/liquidity/buying-power.ts
  13. 2
      apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts
  14. 2
      apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts
  15. 2
      apps/api/src/models/rules/regional-market-cluster-risk/europe.ts
  16. 2
      apps/api/src/models/rules/regional-market-cluster-risk/japan.ts
  17. 2
      apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts
  18. 8
      apps/client/src/app/adapter/custom-date-adapter.ts
  19. 2
      libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts
  20. 12
      libs/ui/src/lib/currency-selector/currency-selector.component.ts
  21. 12
      libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts
  22. 2
      tsconfig.base.json

4
apps/api/src/guards/custom-throttler.guard.ts

@ -5,7 +5,9 @@ import { ThrottlerException, ThrottlerGuard } from '@nestjs/throttler';
export class CustomThrottlerGuard extends ThrottlerGuard { export class CustomThrottlerGuard extends ThrottlerGuard {
private readonly logger = new Logger(CustomThrottlerGuard.name); private readonly logger = new Logger(CustomThrottlerGuard.name);
public async canActivate(context: ExecutionContext): Promise<boolean> { public override async canActivate(
context: ExecutionContext
): Promise<boolean> {
try { try {
return await super.canActivate(context); return await super.canActivate(context);
} catch (error) { } catch (error) {

2
apps/api/src/models/rules/account-cluster-risk/current-investment.ts

@ -13,7 +13,7 @@ export class AccountClusterRiskCurrentInvestment extends Rule<Settings> {
private accounts: PortfolioDetails['accounts']; private accounts: PortfolioDetails['accounts'];
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
accounts: PortfolioDetails['accounts'] accounts: PortfolioDetails['accounts']

2
apps/api/src/models/rules/account-cluster-risk/single-account.ts

@ -11,7 +11,7 @@ export class AccountClusterRiskSingleAccount extends Rule<RuleSettings> {
private accounts: PortfolioDetails['accounts']; private accounts: PortfolioDetails['accounts'];
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
accounts: PortfolioDetails['accounts'] accounts: PortfolioDetails['accounts']

2
apps/api/src/models/rules/asset-class-cluster-risk/equity.ts

@ -11,7 +11,7 @@ export class AssetClassClusterRiskEquity extends Rule<Settings> {
private holdings: PortfolioPosition[]; private holdings: PortfolioPosition[];
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
holdings: PortfolioPosition[] holdings: PortfolioPosition[]

2
apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts

@ -11,7 +11,7 @@ export class AssetClassClusterRiskFixedIncome extends Rule<Settings> {
private holdings: PortfolioPosition[]; private holdings: PortfolioPosition[];
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
holdings: PortfolioPosition[] holdings: PortfolioPosition[]

2
apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts

@ -11,7 +11,7 @@ export class CurrencyClusterRiskBaseCurrencyCurrentInvestment extends Rule<Setti
private holdings: PortfolioPosition[]; private holdings: PortfolioPosition[];
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
holdings: PortfolioPosition[], holdings: PortfolioPosition[],
languageCode: string languageCode: string

2
apps/api/src/models/rules/currency-cluster-risk/current-investment.ts

@ -11,7 +11,7 @@ export class CurrencyClusterRiskCurrentInvestment extends Rule<Settings> {
private holdings: PortfolioPosition[]; private holdings: PortfolioPosition[];
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
holdings: PortfolioPosition[], holdings: PortfolioPosition[],
languageCode: string languageCode: string

2
apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts

@ -8,7 +8,7 @@ export class EconomicMarketClusterRiskDevelopedMarkets extends Rule<Settings> {
private developedMarketsValueInBaseCurrency: number; private developedMarketsValueInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,
developedMarketsValueInBaseCurrency: number, developedMarketsValueInBaseCurrency: number,

2
apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts

@ -8,7 +8,7 @@ export class EconomicMarketClusterRiskEmergingMarkets extends Rule<Settings> {
private emergingMarketsValueInBaseCurrency: number; private emergingMarketsValueInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,
emergingMarketsValueInBaseCurrency: number, emergingMarketsValueInBaseCurrency: number,

2
apps/api/src/models/rules/emergency-fund/emergency-fund-setup.ts

@ -7,7 +7,7 @@ export class EmergencyFundSetup extends Rule<Settings> {
private emergencyFund: number; private emergencyFund: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
emergencyFund: number emergencyFund: number

2
apps/api/src/models/rules/fees/fee-ratio-total-investment-volume.ts

@ -8,7 +8,7 @@ export class FeeRatioTotalInvestmentVolume extends Rule<Settings> {
private totalInvestmentVolumeInBaseCurrency: number; private totalInvestmentVolumeInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
totalInvestmentVolumeInBaseCurrency: number, totalInvestmentVolumeInBaseCurrency: number,

2
apps/api/src/models/rules/liquidity/buying-power.ts

@ -7,7 +7,7 @@ export class BuyingPower extends Rule<Settings> {
private buyingPower: number; private buyingPower: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
buyingPower: number, buyingPower: number,
languageCode: string languageCode: string

2
apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts

@ -10,7 +10,7 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> {
private currentValueInBaseCurrency: number; private currentValueInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,

2
apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts

@ -10,7 +10,7 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> {
private emergingMarketsValueInBaseCurrency: number; private emergingMarketsValueInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,

2
apps/api/src/models/rules/regional-market-cluster-risk/europe.ts

@ -10,7 +10,7 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> {
private europeValueInBaseCurrency: number; private europeValueInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,

2
apps/api/src/models/rules/regional-market-cluster-risk/japan.ts

@ -10,7 +10,7 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> {
private japanValueInBaseCurrency: number; private japanValueInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,

2
apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts

@ -10,7 +10,7 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> {
private northAmericaValueInBaseCurrency: number; private northAmericaValueInBaseCurrency: number;
public constructor( public constructor(
protected exchangeRateDataService: ExchangeRateDataService, exchangeRateDataService: ExchangeRateDataService,
private i18nService: I18nService, private i18nService: I18nService,
languageCode: string, languageCode: string,
currentValueInBaseCurrency: number, currentValueInBaseCurrency: number,

8
apps/client/src/app/adapter/custom-date-adapter.ts

@ -6,7 +6,7 @@ import { addYears, format, getYear, parse } from 'date-fns';
export class CustomDateAdapter extends NativeDateAdapter { export class CustomDateAdapter extends NativeDateAdapter {
public constructor( public constructor(
@Inject(MAT_DATE_LOCALE) public locale: string, @Inject(MAT_DATE_LOCALE) public override locale: string,
@Inject(forwardRef(() => MAT_DATE_LOCALE)) matDateLocale: string @Inject(forwardRef(() => MAT_DATE_LOCALE)) matDateLocale: string
) { ) {
super(matDateLocale); super(matDateLocale);
@ -15,21 +15,21 @@ export class CustomDateAdapter extends NativeDateAdapter {
/** /**
* Formats a date as a string * Formats a date as a string
*/ */
public format(aDate: Date): string { public override format(aDate: Date): string {
return format(aDate, getDateFormatString(this.locale)); return format(aDate, getDateFormatString(this.locale));
} }
/** /**
* Sets the first day of the week to Monday * Sets the first day of the week to Monday
*/ */
public getFirstDayOfWeek(): number { public override getFirstDayOfWeek(): number {
return 1; return 1;
} }
/** /**
* Parses a date from a provided value * Parses a date from a provided value
*/ */
public parse(aValue: string): Date { public override parse(aValue: string): Date {
let date = parse(aValue, getDateFormatString(this.locale), new Date()); let date = parse(aValue, getDateFormatString(this.locale), new Date());
if (getYear(date) < 1900) { if (getYear(date) < 1900) {

2
libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts

@ -9,7 +9,7 @@ export class CreateAssetProfileWithMarketDataDto extends CreateAssetProfileDto {
@IsIn([DataSource.MANUAL], { @IsIn([DataSource.MANUAL], {
message: `dataSource must be '${DataSource.MANUAL}'` message: `dataSource must be '${DataSource.MANUAL}'`
}) })
dataSource: DataSource; override dataSource: DataSource;
@IsArray() @IsArray()
@IsOptional() @IsOptional()

12
libs/ui/src/lib/currency-selector/currency-selector.component.ts

@ -75,22 +75,22 @@ export class GfCurrencySelectorComponent
private readonly input = viewChild.required(MatInput); private readonly input = viewChild.required(MatInput);
public constructor( public constructor(
public readonly _elementRef: ElementRef, public override readonly _elementRef: ElementRef,
public readonly _focusMonitor: FocusMonitor, public override readonly _focusMonitor: FocusMonitor,
public readonly changeDetectorRef: ChangeDetectorRef, public readonly changeDetectorRef: ChangeDetectorRef,
private readonly formGroupDirective: FormGroupDirective, private readonly formGroupDirective: FormGroupDirective,
public readonly ngControl: NgControl public override readonly ngControl: NgControl
) { ) {
super(_elementRef, _focusMonitor, ngControl); super(_elementRef, _focusMonitor, ngControl);
this.controlType = 'currency-selector'; this.controlType = 'currency-selector';
} }
public get empty() { public override get empty() {
return this.input().empty; return this.input().empty;
} }
public set value(value: string | null) { public override set value(value: string | null) {
this.control.setValue(value); this.control.setValue(value);
super.value = value; super.value = value;
} }
@ -138,7 +138,7 @@ export class GfCurrencySelectorComponent
}); });
} }
public ngDoCheck() { public override ngDoCheck() {
if (this.ngControl) { if (this.ngControl) {
this.validateRequired(); this.validateRequired();
this.errorState = !!(this.ngControl.invalid && this.ngControl.touched); this.errorState = !!(this.ngControl.invalid && this.ngControl.touched);

12
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

@ -95,22 +95,22 @@ export class GfSymbolAutocompleteComponent
private readonly input = viewChild.required(MatInput); private readonly input = viewChild.required(MatInput);
public constructor( public constructor(
public readonly _elementRef: ElementRef, public override readonly _elementRef: ElementRef<HTMLElement>,
public readonly _focusMonitor: FocusMonitor, public override readonly _focusMonitor: FocusMonitor,
public readonly changeDetectorRef: ChangeDetectorRef, public readonly changeDetectorRef: ChangeDetectorRef,
public readonly dataService: DataService, public readonly dataService: DataService,
public readonly ngControl: NgControl public override readonly ngControl: NgControl
) { ) {
super(_elementRef, _focusMonitor, ngControl); super(_elementRef, _focusMonitor, ngControl);
this.controlType = 'symbol-autocomplete'; this.controlType = 'symbol-autocomplete';
} }
public get empty() { public override get empty() {
return this.input().empty; return this.input().empty;
} }
public set value(value: LookupItem) { public override set value(value: LookupItem) {
this.control.setValue(value); this.control.setValue(value);
super.value = value; super.value = value;
} }
@ -188,7 +188,7 @@ export class GfSymbolAutocompleteComponent
}); });
} }
public ngDoCheck() { public override ngDoCheck() {
if (this.ngControl) { if (this.ngControl) {
this.validateRequired(); this.validateRequired();
this.errorState = !!(this.ngControl.invalid && this.ngControl.touched); this.errorState = !!(this.ngControl.invalid && this.ngControl.touched);

2
tsconfig.base.json

@ -30,7 +30,7 @@
"noImplicitReturns": false, "noImplicitReturns": false,
"noImplicitAny": false, "noImplicitAny": false,
"noImplicitThis": true, "noImplicitThis": true,
"noImplicitOverride": false, "noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": false, "noPropertyAccessFromIndexSignature": false,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,

Loading…
Cancel
Save