Skip to content

Commit 8e4c247

Browse files
feat(cdk): update tsconfig to more modern settings in typescript init templates (#31927)
### Issue # (if applicable) n/A ### Reason for this change I think contents of `tsconfig.json` are a little outdated and seemed to need update. ### Description of changes The following two changes I made: 1. Removed unnecessary options 2. Updated `target` and `lib` options at compilerOptions #### 1. Removed unnecessary options Unnecessary options included in the `compilerOptions` of tsconfig.json. The unnecessary options are as follows - noImplicitAny - strictNullChecks - noImplicitThis - alwaysStrict If `strict: true` is specified in compilerOptions, these options will also be `true`, so there is no need to specify them. see: https://www.typescriptlang.org/tsconfig/#strict #### 2. Updated `target` and `lib` options at compilerOptions - target - I think 'ES2023' is more appropriate for the target option at this point. - lib - Basically, it doesn't seem necessary to specify the same value for the lib option as the target specified in the target option. - see: https://www.typescriptlang.org/tsconfig/#lib ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 33a4a5d commit 8e4c247

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

packages/aws-cdk/lib/init-templates/app/typescript/tsconfig.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
3+
"target": "ES2022",
44
"module": "commonjs",
55
"lib": [
6-
"es2020",
6+
"ES2023",
77
"dom"
88
],
99
"declaration": true,
1010
"strict": true,
11-
"noImplicitAny": true,
12-
"strictNullChecks": true,
13-
"noImplicitThis": true,
14-
"alwaysStrict": true,
1511
"noUnusedLocals": false,
1612
"noUnusedParameters": false,
1713
"noImplicitReturns": true,

packages/aws-cdk/lib/init-templates/sample-app/typescript/tsconfig.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
3+
"target": "ES2022",
44
"module": "commonjs",
55
"lib": [
6-
"es2020",
6+
"ES2023",
77
"dom"
88
],
99
"declaration": true,
1010
"strict": true,
11-
"noImplicitAny": true,
12-
"strictNullChecks": true,
13-
"noImplicitThis": true,
14-
"alwaysStrict": true,
1511
"noUnusedLocals": false,
1612
"noUnusedParameters": false,
1713
"noImplicitReturns": true,

0 commit comments

Comments
 (0)