When:
undefined
(default) provide suggestions as warnings to editorstrue
unused labels are ignoredfalse
raises compiler errors about unused labels
Labels are very rare in JavaScript and typically indicate an attempt to write an object literal:
ts
// @errors: 7028
// @allowUnusedLabels: false
function verifyAge(age: number) {
// Forgot 'return' statement
if (age > 18) {
verified: true;
}
}
// @errors: 7028
// @allowUnusedLabels: false
function verifyAge(age: number) {
// Forgot 'return' statement
if (age > 18) {
verified: true;
}
}