-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strict mode: hash is required to be imported, but glint reports it as not used. #374
Comments
This is why I want dedicated template syntax for object and array literals 😂 This is definitely a bug, but will need to think a bit on how to best address it. (Note: |
you and me both <3 I don't think I captured that in emberjs/rfcs#816 🤔 |
I remember during discussions around the default helper manager, there was some discussion that it would be easier to avoid supporting named args if there were dedicated object syntax (basically just 1:1 parity with JS function invocation), but I don't know that that was ever actually captured anywhere. |
Instead of compiling I confirmed that this keeps typescript's strict object literal handling, in the sense that it makes unused keys into type errors. |
Ah, that's clever. Using an empty array literal as a canary (both because I know that's particularly fragile inference behavior in TS and because it could affect us with I think we'd want to be careful to make sure that there aren't situations where this can impact inference users may rely on in templates, but if not I like the comma expression approach. Thanks for the suggestion! |
with |
It already compiles to an object literal. But this isn't code that runs, it's just code that tsc looks at. |
Is this just waiting on someone to do the work? |
Sample gjs:
Sample Error:
Since removing the import creates a runtime error, "hash is not defined", I think Glint should not report the hash import as never read?
I'm using
The text was updated successfully, but these errors were encountered: