Skip to content

Commit aebaf79

Browse files
committed
feat!: turn on noUncheckedIndexedAccess for libraries
See https://www.semver-ts.org/formal-spec/5-compiler-considerations.html#strictness for the arguments for turning on noUncheckedIndexedAccess for libraries. In short, it helps prevent shipping accidental breaking type changes to library consumers. (Note the link also suggests turning on `exactOptionalPropertyTypes`, but I still have doubts about it, as it would not be helpful without a specific coding style, which is hard to enforce.)
1 parent b22acb3 commit aebaf79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tsconfig.lib.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
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,
12+
13+
"noUncheckedIndexedAccess": true
1214
}
1315
}

0 commit comments

Comments
 (0)