From bdccdaab5e3a2fd745ae7f49a39407c32b91c009 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 15 Mar 2024 18:35:01 -0700 Subject: [PATCH] build: set module=node16 in tsconfig.json #4546 Problem: vscode shows warning: TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16' Solution: - Set `module=node16`. - Update all tsconfig.json files to use the same "moduleResolution" and "module" settings. Reference: - https://www.typescriptlang.org/tsconfig#moduleResolution --- packages/tsconfig.packages.json | 2 +- plugins/eslint-plugin-aws-toolkits/tsconfig.json | 4 ++-- tsconfig.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/tsconfig.packages.json b/packages/tsconfig.packages.json index e33baf9829b..95ff55262ef 100644 --- a/packages/tsconfig.packages.json +++ b/packages/tsconfig.packages.json @@ -5,7 +5,7 @@ "@sinonjs/fake-timers": ["node_modules/@types/sinonjs__fake-timers"] }, "incremental": true, - "module": "commonjs", + "module": "node16", "target": "es2021", "sourceMap": true, "moduleResolution": "node16", diff --git a/plugins/eslint-plugin-aws-toolkits/tsconfig.json b/plugins/eslint-plugin-aws-toolkits/tsconfig.json index a08e2959604..028f3597dcc 100644 --- a/plugins/eslint-plugin-aws-toolkits/tsconfig.json +++ b/plugins/eslint-plugin-aws-toolkits/tsconfig.json @@ -2,12 +2,12 @@ "compilerOptions": { "baseUrl": ".", "incremental": true, - "module": "commonjs", + "module": "node16", "target": "es2021", "outDir": "dist", "lib": ["dom", "es2021"], "sourceMap": true, - "moduleResolution": "node", + "moduleResolution": "node16", "resolveJsonModule": true, "strict": true, "noUnusedLocals": true, diff --git a/tsconfig.json b/tsconfig.json index 5532990031a..b5676bad46b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,9 @@ // If you are looking for the base config for subprojects, see packages/tsconfig.packages.json { "compilerOptions": { - "module": "commonjs", + "module": "node16", "target": "es2021", - "moduleResolution": "node", + "moduleResolution": "node16", "rootDir": ".", "resolveJsonModule": true, "strict": true,