π 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