Skip to content

Commit

Permalink
refactor: better use relative path
Browse files Browse the repository at this point in the history
With baseUrl set to "./", vscode autocompletes import path as absolute.
It's a bad practice, see nestjs/typescript-starter#74 for more info.
Moreover, using absolute path conflicts with module resolution in jest.
  • Loading branch information
laireyx committed Apr 29, 2023
1 parent f8a265e commit dce78b7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/src/auth/auth.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common';
import { PassportModule } from '@nestjs/passport';
import { AuthService } from './auth.service';
import { UsersModule } from 'src/users/users.module';
import { UsersModule } from '../users/users.module';
import { LocalStrategy } from './local.strategy';
import { AuthController } from './auth.controller';
import { JwtModule } from '@nestjs/jwt';
Expand Down
2 changes: 1 addition & 1 deletion backend/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common';
import { UsersService } from 'src/users/users.service';
import { UsersService } from '../users/users.service';
import { IUserTag } from '../../../schema/user';
import { JwtService } from '@nestjs/jwt';

Expand Down
2 changes: 1 addition & 1 deletion backend/src/users/users.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
import { UsersService } from './users.service';
import { UsersController } from './users.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { User, UserSchema } from 'src/schema/user.schema';
import { User, UserSchema } from '../schema/user.schema';

@Module({
imports: [
Expand Down
2 changes: 1 addition & 1 deletion backend/src/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import crypto from 'node:crypto';
import { Model } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { User } from 'src/schema/user.schema';
import { User } from '../schema/user.schema';
import { ICreateUser } from '../../../schema/user';

@Injectable()
Expand Down
1 change: 0 additions & 1 deletion backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
Expand Down

0 comments on commit dce78b7

Please sign in to comment.