kaleidawave / ezno

A JavaScript compiler and TypeScript checker written in Rust with a focus on static analysis and runtime performance
https://kaleidawave.github.io/posts/introducing-ezno/
MIT License
2.42k stars 45 forks source link

Allow type-only import labels #194

Open noahbald opened 4 weeks ago

noahbald commented 4 weeks ago

Hi, just playing around with this - I've noticed that checking type only imports seems to result in an error. This isn't mentioned in the specification docs, so perhaps it was missed?

error:
  ┌─ ./src/actions/address.ts:4:15
  │
4 │ import { type PartialMessage } from "@bufbuild/protobuf";
  │               ^^^^^^^^^^^^^^ Expected CloseBrace or Comma found Identifier("PartialMessage")
kaleidawave commented 4 weeks ago

Yep, seems to be a parser issue. I think I added support for type keyword in the import part recently

https://github.com/kaleidawave/ezno/blame/main/parser/src/declarations/mod.rs#L394

and yes doesn't appear to be a test for it in specification.md. Will take a look at it. I know I added import type ... from ... but I don't think the checker currently checks simple item type modifiers.