fix: resolve all ESLint errors across API and web packages
Fix 19+ lint errors: unused imports (Phone, DuplicateCandidate, listingDetailsSchema), import ordering violations, consistent-type-imports, and constant binary expression in test file. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
import { UserEntity } from '../../domain/entities/user.entity';
|
||||
import { HashedPassword } from '../../domain/value-objects/hashed-password.vo';
|
||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { type HashedPassword } from '../../domain/value-objects/hashed-password.vo';
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
import { RefreshTokenCommand } from '../commands/refresh-token/refresh-token.command';
|
||||
import { RefreshTokenHandler } from '../commands/refresh-token/refresh-token.handler';
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
import { RegisterUserCommand } from '../commands/register-user/register-user.command';
|
||||
import { RegisterUserHandler } from '../commands/register-user/register-user.handler';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type OAuthProvider } from '@prisma/client';
|
||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { UserEntity } from '../../domain/entities/user.entity';
|
||||
import { type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { Email } from '../../domain/value-objects/email.vo';
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type OAuthService } from '../services/oauth.service';
|
||||
import { ZaloOAuthStrategy } from '../strategies/zalo-oauth.strategy';
|
||||
import { type TokenPair } from '../services/token.service';
|
||||
import { ZaloOAuthStrategy } from '../strategies/zalo-oauth.strategy';
|
||||
|
||||
describe('ZaloOAuthStrategy', () => {
|
||||
const mockTokenPair: TokenPair = {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Inject, Injectable, Logger } from '@nestjs/common';
|
||||
import { type EventBus } from '@nestjs/cqrs';
|
||||
import { type OAuthProvider, type Prisma } from '@prisma/client';
|
||||
import { createId } from '@paralleldrive/cuid2';
|
||||
import { type OAuthProvider, type Prisma } from '@prisma/client';
|
||||
import { type PrismaService } from '@modules/shared/infrastructure/prisma.service';
|
||||
import { UserEntity } from '../../domain/entities/user.entity';
|
||||
import { UserRegisteredEvent } from '../../domain/events/user-registered.event';
|
||||
import { USER_REPOSITORY, type IUserRepository } from '../../domain/repositories/user.repository';
|
||||
import { Email } from '../../domain/value-objects/email.vo';
|
||||
import { Phone } from '../../domain/value-objects/phone.vo';
|
||||
import { UserRegisteredEvent } from '../../domain/events/user-registered.event';
|
||||
import { type TokenService, type TokenPair } from './token.service';
|
||||
|
||||
export interface OAuthUserProfile {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
|
||||
import { type TokenPair } from '../services/token.service';
|
||||
|
||||
/**
|
||||
* Zalo OAuth2 integration.
|
||||
@@ -70,7 +71,7 @@ export class ZaloOAuthStrategy {
|
||||
* Handle the OAuth callback: exchange code for tokens, fetch profile,
|
||||
* and authenticate via OAuthService.
|
||||
*/
|
||||
async handleCallback(code: string, codeVerifier?: string): Promise<{ tokens: import('../services/token.service').TokenPair }> {
|
||||
async handleCallback(code: string, codeVerifier?: string): Promise<{ tokens: TokenPair }> {
|
||||
// 1. Exchange authorization code for access token
|
||||
const tokenData = await this.exchangeCode(code, codeVerifier);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
import type { Request, Response } from 'express';
|
||||
import { type TokenPair } from '../../infrastructure/services/token.service';
|
||||
import { ZaloOAuthStrategy } from '../../infrastructure/strategies/zalo-oauth.strategy';
|
||||
import { type ZaloOAuthStrategy } from '../../infrastructure/strategies/zalo-oauth.strategy';
|
||||
import { GoogleOAuthGuard } from '../guards/google-oauth.guard';
|
||||
|
||||
const IS_PRODUCTION = process.env['NODE_ENV'] === 'production';
|
||||
|
||||
Reference in New Issue
Block a user