Turn off unreachable code and unused labels in tsconfig
Check / check (pull_request) Successful in 39s

This commit is contained in:
Danny Kim
2026-10-18 03:18:25 +09:00
parent 60c63dee98
commit 5b568f9ea6
2 changed files with 12 additions and 9 deletions
+9 -8
View File
@@ -6,16 +6,17 @@ The user's rule, from the Deno days and restated for Node (2026-10-12): "No
JS, not even JSX/TSX, only TS." Source, scripts, tests, and configs are all JS, not even JSX/TSX, only TS." Source, scripts, tests, and configs are all
plain `.ts`. Build output in a gitignored folder is the only JS. plain `.ts`. Build output in a gitignored folder is the only JS.
`tsconfig.json`: no `allowJs`, no `jsx`, and exactly this strictness set `tsconfig.json`: no `allowJs`, no `jsx`, and exactly this strictness set (user
(user decision, 2026-10-18): `strict` (written out), `noUncheckedIndexedAccess`, decision, 2026-10-18): `strict` (written out), `noUncheckedIndexedAccess`,
`noPropertyAccessFromIndexSignature`, `noImplicitReturns`, `noUnusedLocals`, `noPropertyAccessFromIndexSignature`, `noImplicitReturns`, `noUnusedLocals`,
`noUnusedParameters`, `noImplicitOverride`, `noFallthroughCasesInSwitch`, `noUnusedParameters`, `noImplicitOverride`, `noFallthroughCasesInSwitch`,
`erasableSyntaxOnly`, plus the mechanical `verbatimModuleSyntax`, `erasableSyntaxOnly`, and `allowUnreachableCode: false` plus
`allowImportingTsExtensions`, and `noEmit` (packages also keep `declaration` `allowUnusedLabels: false` (user decision, 2026-10-18; on in the Deno setup),
and `isolatedDeclarations`). `exactOptionalPropertyTypes` is off everywhere: plus the mechanical `verbatimModuleSyntax`, `allowImportingTsExtensions`, and
write `{ key: maybeUndefined }` rather than leaving the key out to please it. `noEmit` (packages also keep `declaration` and `isolatedDeclarations`).
If a tool or framework seems to need a JS or TSX file, stop and flag it `exactOptionalPropertyTypes` is off everywhere: write `{ key: maybeUndefined }`
instead of adding one. rather than leaving the key out to please it. If a tool or framework seems to
need a JS or TSX file, stop and flag it instead of adding one.
## No asset imports (2026-10-14, widened 2026-10-16 and 2026-10-17) ## No asset imports (2026-10-14, widened 2026-10-16 and 2026-10-17)
+3 -1
View File
@@ -15,6 +15,8 @@
"noImplicitReturns": true, "noImplicitReturns": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true "noUnusedParameters": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false
} }
} }