Skip to content

Commit e690a76

Browse files
authored
feat!: enable noUncheckedIndexedAccess and exactOptionalPropertyTypes (#36)
See https://www.semver-ts.org/formal-spec/5-compiler-considerations.html#strictness for the arguments for turning these options on. Both are now turned on by default in the `tsc --init` template of TS 5.9 microsoft/TypeScript#61813
1 parent 85a620a commit e690a76

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
"noImplicitThis": true,
3232
"strict": true,
3333

34+
// See <https://www.semver-ts.org/formal-spec/5-compiler-considerations.html#strictness>
35+
// These 2 options are also part of the recommended tsconfig as of TS 5.9
36+
"noUncheckedIndexedAccess": true,
37+
"exactOptionalPropertyTypes": true,
38+
3439
// <https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#verbatimmodulesyntax>
3540
// Any imports or exports without a type modifier are left around. This is important for `<script setup>`.
3641
// Anything that uses the type modifier is dropped entirely.

tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// Libraries generally require more strict type accuracy.
99
// For example, its types must be compatible with the Vue types.
1010
// So we don't want to skip the type checking of its dependencies.
11-
"skipLibCheck": false
11+
"skipLibCheck": false,
1212
}
1313
}

0 commit comments

Comments
 (0)