Skip to content

Commit d80ccbd

Browse files
committed
fix: handle decorators after type declarations
1 parent 5cf669b commit d80ccbd

File tree

3 files changed

+423
-1
lines changed

3 files changed

+423
-1
lines changed

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,14 @@ export function tsPlugin(options?: {
256256
if (code === 60) {
257257
return this.finishOp(tt.relational, 1);
258258
}
259+
// Handle @ for decorators - can appear after type declarations
260+
if (code === 64) {
261+
++this.pos;
262+
return this.finishToken(tokTypes.at);
263+
}
259264

260265
return super.getTokenFromCode(code);
261266
}
262-
263267
readToken(code: number): any {
264268
if (!this.inType) {
265269
let context = this.curContext();

0 commit comments

Comments
 (0)