🔎 Search Terms
export enum ts2845
🕗 Version & Regression Information
5.4 doesn't flag it without the export modifier either.
⏯ Playground Link
https://www.typescriptlang.org/play/?target=99&module=0&ts=6.0.0-dev.20260416#code/KYDwDg9gTgLgBMAdgVwLZwIIBMCGYbBQDyyMYpAKgJ5jBwDeAUHJgAqsD6rGA4gKIAaZnG78AykIC+jRlmABjADY4odeREQBneDBrAAXJlz5CJMpT0z1W+AGsAloixwAvMN21XLl0bwFipOQw1LQAdBjsXLx8cAA+sb4mAebBeqGifGLCLAD0OSwFhUXFJaUUABb2mnDWWPYw9hpwAO72iopwOIrNOFTVqjDIUIhwAOQwUMjAo6EAFABMABwALACsAJTZcAD8Y4rAAGYwo1uGo1D2AOblxwDcQA
💻 Code
// remove `export` modifier
export enum AdapterOutputType {
APP_PAGE,
PAGES,
}
declare const type: AdapterOutputType
const kind =
type === AdapterOutputType.APP_PAGE || AdapterOutputType.PAGES
// ~ should be flagged with: This condition will always return 'true'.(2845)
? 'left'
: 'right';
🙁 Actual behavior
No typechecking error
🙂 Expected behavior
ts2845 because the condition is always true.
Additional information about the issue
No response
🔎 Search Terms
export enum ts2845
🕗 Version & Regression Information
5.4 doesn't flag it without the
exportmodifier either.⏯ Playground Link
https://www.typescriptlang.org/play/?target=99&module=0&ts=6.0.0-dev.20260416#code/KYDwDg9gTgLgBMAdgVwLZwIIBMCGYbBQDyyMYpAKgJ5jBwDeAUHJgAqsD6rGA4gKIAaZnG78AykIC+jRlmABjADY4odeREQBneDBrAAXJlz5CJMpT0z1W+AGsAloixwAvMN21XLl0bwFipOQw1LQAdBjsXLx8cAA+sb4mAebBeqGifGLCLAD0OSwFhUXFJaUUABb2mnDWWPYw9hpwAO72iopwOIrNOFTVqjDIUIhwAOQwUMjAo6EAFABMABwALACsAJTZcAD8Y4rAAGYwo1uGo1D2AOblxwDcQA
💻 Code
🙁 Actual behavior
No typechecking error
🙂 Expected behavior
ts2845because the condition is alwaystrue.Additional information about the issue
No response