Browse Source

refactor: enable noUnusedLocals noUnusedParameters

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
pull/3895/head
dw-0 11 months ago
parent
commit
446d19696a
  1. 2
      apps/api/src/app/account/create-account.dto.ts
  2. 2
      apps/api/src/app/account/update-account.dto.ts
  3. 11
      apps/api/src/app/auth/auth.controller.ts
  4. 9
      apps/api/src/app/auth/google.strategy.ts
  5. 11
      apps/api/src/app/auth/web-auth.service.ts
  6. 2
      apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts
  7. 4
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.spec.ts
  8. 2
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
  9. 2
      apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts
  10. 5
      apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts
  11. 5
      apps/client/src/app/components/investment-chart/investment-chart.component.ts
  12. 2
      libs/common/src/lib/chart-helper.ts
  13. 5
      libs/ui/src/lib/line-chart/line-chart.component.ts
  14. 4
      tsconfig.base.json

2
apps/api/src/app/account/create-account.dto.ts

@ -36,6 +36,6 @@ export class CreateAccountDto {
name: string;
@IsString()
@ValidateIf((object, value) => value !== null)
@ValidateIf((value) => value !== null)
platformId: string | null;
}

2
apps/api/src/app/account/update-account.dto.ts

@ -35,6 +35,6 @@ export class UpdateAccountDto {
name: string;
@IsString()
@ValidateIf((object, value) => value !== null)
@ValidateIf((value) => value !== null)
platformId: string | null;
}

11
apps/api/src/app/auth/auth.controller.ts

@ -14,12 +14,12 @@ import {
Req,
Res,
UseGuards,
VERSION_NEUTRAL,
Version
Version,
VERSION_NEUTRAL
} from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { Request, Response } from 'express';
import { StatusCodes, getReasonPhrase } from 'http-status-codes';
import { getReasonPhrase, StatusCodes } from 'http-status-codes';
import { AuthService } from './auth.service';
import {
@ -130,10 +130,7 @@ export class AuthController {
public async verifyAttestation(
@Body() body: { deviceName: string; credential: AttestationCredentialJSON }
) {
return this.webAuthService.verifyAttestation(
body.deviceName,
body.credential
);
return this.webAuthService.verifyAttestation(body.credential);
}
@Post('webauthn/generate-assertion-options')

9
apps/api/src/app/auth/google.strategy.ts

@ -11,6 +11,7 @@ import { AuthService } from './auth.service';
export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
public constructor(
private readonly authService: AuthService,
// @ts-expect-error: Property is being used in the constructor
private readonly configurationService: ConfigurationService
) {
super({
@ -24,13 +25,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
});
}
public async validate(
request: any,
token: string,
refreshToken: string,
profile: Profile,
done: Function
) {
public async validate(profile: Profile, done: Function) {
try {
const jwt = await this.authService.validateOAuthLogin({
provider: Provider.GOOGLE,

11
apps/api/src/app/auth/web-auth.service.ts

@ -13,16 +13,16 @@ import {
import { REQUEST } from '@nestjs/core';
import { JwtService } from '@nestjs/jwt';
import {
generateAuthenticationOptions,
GenerateAuthenticationOptionsOpts,
generateRegistrationOptions,
GenerateRegistrationOptionsOpts,
VerifiedAuthenticationResponse,
VerifiedRegistrationResponse,
VerifyAuthenticationResponseOpts,
VerifyRegistrationResponseOpts,
generateAuthenticationOptions,
generateRegistrationOptions,
verifyAuthenticationResponse,
verifyRegistrationResponse
VerifyAuthenticationResponseOpts,
verifyRegistrationResponse,
VerifyRegistrationResponseOpts
} from '@simplewebauthn/server';
import {
@ -80,7 +80,6 @@ export class WebAuthService {
}
public async verifyAttestation(
deviceName: string,
credential: AttestationCredentialJSON
): Promise<AuthDeviceDto> {
const user = this.request.user;

2
apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts

@ -21,7 +21,7 @@ export class TransformDataSourceInResponseInterceptor<T>
) {}
public intercept(
context: ExecutionContext,
_context: ExecutionContext,
next: CallHandler<T>
): Observable<any> {
return next.handle().pipe(

4
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.spec.ts

@ -1,4 +1,3 @@
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { CryptocurrencyService } from '@ghostfolio/api/services/cryptocurrency/cryptocurrency.service';
import { YahooFinanceDataEnhancerService } from './yahoo-finance.service';
@ -26,16 +25,13 @@ jest.mock(
);
describe('YahooFinanceDataEnhancerService', () => {
let configurationService: ConfigurationService;
let cryptocurrencyService: CryptocurrencyService;
let yahooFinanceDataEnhancerService: YahooFinanceDataEnhancerService;
beforeAll(async () => {
configurationService = new ConfigurationService();
cryptocurrencyService = new CryptocurrencyService();
yahooFinanceDataEnhancerService = new YahooFinanceDataEnhancerService(
configurationService,
cryptocurrencyService
);
});

2
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts

@ -1,4 +1,3 @@
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { CryptocurrencyService } from '@ghostfolio/api/services/cryptocurrency/cryptocurrency.service';
import { DataEnhancerInterface } from '@ghostfolio/api/services/data-provider/interfaces/data-enhancer.interface';
import {
@ -24,7 +23,6 @@ import type { Price } from 'yahoo-finance2/dist/esm/src/modules/quoteSummary-ifa
@Injectable()
export class YahooFinanceDataEnhancerService implements DataEnhancerInterface {
public constructor(
private readonly configurationService: ConfigurationService,
private readonly cryptocurrencyService: CryptocurrencyService
) {}

2
apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts

@ -76,7 +76,7 @@ export class GoogleSheetsService implements DataProviderInterface {
} = {};
rows
.filter((row, index) => {
.filter((_row, index) => {
return index >= 1;
})
.forEach((row) => {

5
apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts

@ -34,7 +34,8 @@ import {
LinearScale,
PointElement,
TimeScale,
Tooltip
Tooltip,
TooltipPosition
} from 'chart.js';
import 'chartjs-adapter-date-fns';
import annotationPlugin from 'chartjs-plugin-annotation';
@ -74,7 +75,7 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy {
Tooltip
);
Tooltip.positioners['top'] = (elements, position) =>
Tooltip.positioners['top'] = (position: TooltipPosition) =>
getTooltipPositionerMapTop(this.chart, position);
}

5
apps/client/src/app/components/investment-chart/investment-chart.component.ts

@ -34,7 +34,8 @@ import {
LinearScale,
PointElement,
TimeScale,
Tooltip
Tooltip,
TooltipPosition
} from 'chart.js';
import 'chartjs-adapter-date-fns';
import annotationPlugin from 'chartjs-plugin-annotation';
@ -79,7 +80,7 @@ export class InvestmentChartComponent implements OnChanges, OnDestroy {
Tooltip
);
Tooltip.positioners['top'] = (elements, position) =>
Tooltip.positioners['top'] = (position: TooltipPosition) =>
getTooltipPositionerMapTop(this.chart, position);
}

2
libs/common/src/lib/chart-helper.ts

@ -103,7 +103,7 @@ export function getVerticalHoverLinePlugin(
colorScheme?: ColorScheme
) {
return {
afterDatasetsDraw: (chart, x, options) => {
afterDatasetsDraw: (chart, options) => {
const active = chart.getActiveElements();
if (!active || active.length === 0) {

5
libs/ui/src/lib/line-chart/line-chart.component.ts

@ -32,7 +32,8 @@ import {
LinearScale,
PointElement,
TimeScale,
Tooltip
Tooltip,
TooltipPosition
} from 'chart.js';
import 'chartjs-adapter-date-fns';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@ -85,7 +86,7 @@ export class GfLineChartComponent
Tooltip
);
Tooltip.positioners['top'] = (elements, position) =>
Tooltip.positioners['top'] = (position: TooltipPosition) =>
getTooltipPositionerMapTop(this.chart, position);
}

4
tsconfig.base.json

@ -31,8 +31,8 @@
"noImplicitThis": false,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"allowUnreachableCode": true
},
"exclude": ["node_modules", "tmp"]

Loading…
Cancel
Save