Skip to content

Commit eb4990c

Browse files
committed
fix: Cannot find type definition file for 'jest' & node by updating the tsconfig file to let TS discover the packages from nodemodules
1 parent 57d16a2 commit eb4990c

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
{
2-
"name": "rest-express",
2+
"name": "library-management-rest-api",
3+
"description": "Library Management REST API",
4+
"main": "dist/index.js",
5+
"repository": {
6+
"type": "git",
7+
"url": "git@github.com:frckbrice/library-management-REST-API.git"
8+
},
9+
"author": "Avom Brice",
10+
"license": "MIT",
11+
"homepage": "https://github.com/frckbrice/library-management-REST-API",
312
"version": "1.0.0",
413
"type": "commonjs",
5-
"license": "MIT",
614
"scripts": {
715
"dev": "nodemon --exec ts-node index.ts",
816
"start": "node dist/index.js",

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/auth.routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @module src/routes/auth.routes
88
*/
99

10+
/// <reference path="../types/express.d.ts" />
1011
import type { Express, Request, Response, NextFunction } from "express";
1112
import { compare } from "bcrypt";
1213
import drizzleService from "../services/drizzle-services";

tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@
88
"moduleResolution": "node",
99
"esModuleInterop": true,
1010
"skipLibCheck": true, // Moved inside compilerOptions
11-
"types": [
12-
"node",
13-
"jest"
14-
],
1511
"resolveJsonModule": true
1612
},
1713
"include": [
1814
"index.ts",
1915
"server/**/*.ts",
2016
"config/**/*.ts",
2117
"src/**/*.ts",
18+
"src/types/**/*.d.ts",
2219
"drizzle.config.ts"
2320
],
2421
"exclude": [

0 commit comments

Comments
 (0)