π Search Terms
"verbatimModuleSyntax", "enum"
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "verbatimModuleSyntax" (there wasn't any) and "enums".
β― Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?verbatimModuleSyntax=true&ts=5.0.4#code/PTAEAEDcFMCcCMCGAXAlgWwLIHsAmBXAG2gGUBPAO2UQA8AuUZWfaAKFZAgDNViLF00Bj2IBaAO6pkAC1HQaAB2yxkAOmQBnVvKUrQ0CvnSgA6stwbQAb1ag7oAIKgAvKABEDtwBpb9gEIu7n7erAC+7DrKyIxkCtCm5oEaTKgUAOYA3Oyc4CIGAkKgqbjy6loYutFWCbAWXjW4oKGgXLDYxm6qwHkSUrKRKm7sxNGIDGa1WSOgiBRkE7jj5hoZQA
π» Code
// @verbatimModuleSyntax: true
// @filename: file-with-export.ts
export enum Words {
A = "A",
B = "B",
}
export type Word = string;
// @filename: index.ts
import { Words, Word } from "./file-with-export"
let a: Word;
let anyWord: Words;
π Actual behavior
The import of the Words enum doesn't show any errors.
π Expected behavior
The import of the Words enum should show a 1484 error.
Additional information about the issue
The mentioned import should show an error because it's being used only as a type and the "verbatimModuleSyntax" flag is enabled.