From 9b003ffa29055fbcaeabad75f08e8ba6b7fe650c Mon Sep 17 00:00:00 2001 From: Vallejo Alvarado Date: Sat, 22 Nov 2025 18:56:40 +0300 Subject: [PATCH] Update tsconfig.json --- tsconfig.json | 56 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 2aec18a..d0e63e9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,38 @@ +/** + * @fileoverview TypeScript configuration optimized for modern Node.js + * environments (e.g., Hardhat projects). + * NOTE: Assumes the project has been migrated from Buidler to Hardhat. + */ { - "compilerOptions": { - "target": "es5", - "module": "commonjs", - "strict": true, - "esModuleInterop": true, - "outDir": "dist", - "resolveJsonModule": true, - "downlevelIteration": true - }, - "include": ["./**/*"], - "files": [ - "./buidler.config.ts", - "node_modules/@nomiclabs/buidler-ethers/src/type-extensions.d.ts", - "node_modules/buidler-typechain/src/type-extensions.d.ts", - "node_modules/@nomiclabs/buidler-waffle/src/type-extensions.d.ts", - "node_modules/@nomiclabs/buidler-etherscan/src/type-extensions.d.ts" - ] - } - \ No newline at end of file + "compilerOptions": { + // 1. Target modern JavaScript features supported by recent Node.js versions + "target": "es2020", + // Recommended module system for modern Node.js development + "module": "commonjs", + // Enables all strict type-checking options + "strict": true, + // Allows default imports from modules with no default export (for compatibility) + "esModuleInterop": true, + // Directory for compiled JavaScript output + "outDir": "dist", + // Allows importing JSON files as modules + "resolveJsonModule": true, + // Ensures module resolution is handled correctly for Node environments + "moduleResolution": "node", + // Skip type checking of declaration files (faster compilation) + "skipLibCheck": true, + // Base URL for module resolution (useful if paths are configured) + "baseUrl": "." + + // CLEANUP: Removed "downlevelIteration": true as it is unnecessary for es2020 target. + }, + + // Include all files in the current directory and subdirectories for type checking + // Consider narrowing this down (e.g., ["src/**/*", "test/**/*"]) + "include": [ + "./**/*" + ] + + // CLEANUP: The "files" array containing manual node_modules paths is REMOVED. + // TypeScript will correctly discover type definitions automatically. +}