Repository navigation
Report empty-area expect-error directives, document Node 22 and upstream differences - #24
Merged
NullVoxPopuli merged 3 commits intoAug 27, 2026
Conversation
A `{{! @glint-expect-error }}` directive owns the mapping nodes of the
line after it. When that line is blank, closes a tag or block, or is
another directive, there are no nodes, so no Expect directive was
emitted for it and TypeScript never reported it as unused. `ember-tsc`
reports every one of these. In a large migration this looked like the
unused-directive diagnostic landing on the line after the directive:
with two consecutive directives, only the second was reported.
Expect a diagnostic on the placeholder's empty `;` statement for such
directives. There never is one, so TypeScript reports the directive.
A directive that suppresses a transform error (a special-form arity
error, for example) also owns no nodes, but it is used. The transform
now decides which placeholders suppressed an error before building the
directives, so those stay silent.
Refs NullVoxPopuli#15
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Wt614FPhxrjKFAARVNqFS
Node 22.15.0 to 22.20.0 and 24.0.0 to 24.9.x start `process.execve` targets with an empty environment (nodejs/node#60029). The `typescript` package's `bin/tsc` uses `process.execve`, so the native compiler has no `PATH` and cannot start `node` for the mapper. The mapper never runs, so it cannot report anything better than TS100025. Record the range in `engines` so package managers warn at install, and explain it in the README. Add `test/diagnostics-tests/upstream-differences`, one file per report from the AuditBoard migration that `ember-tsc` accepts and the mapper rejects, with the reason for each in `test/test-packages/README.md`: - `Args: Record<string, never>`, a conditional `Element` over an unresolved type parameter, and `{{component X a=1}}` in content position are rejected by `@glint/template`'s types. TypeScript 5.9 reports the same errors on the transformed text. `ember-tsc` drops them because no Volar verification mapping covers the generated text they anchor on. - JSDoc `@extends` over `Component.extend(Mixin)` is ignored by TypeScript 7 and honored by 5.9, in plain JavaScript too. Refs NullVoxPopuli#12, NullVoxPopuli#13, NullVoxPopuli#14, NullVoxPopuli#15, NullVoxPopuli#16 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Wt614FPhxrjKFAARVNqFS
Merged
This was referenced Aug 27, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assessment and fixes for #12, #13, #14, #15, and #16.
Mapper fix (#15, second part)
A
{{! @glint-expect-error }}whose next line transforms to nothing (blank, closing tag, closing block, another directive) was never reported as unused.ember-tscreports all of them. With two consecutive directives the mapper reported only the second, which reads as "the diagnostic is on the line after the directive". The mapper now expects a diagnostic on the placeholder's empty;statement for such directives, and stays silent when the directive suppressed a transform error.test/diagnostics-tests/directivescovers the shapes.I could not reproduce a
(1,1)position for an unused directive. A file that shows it would help.Node 22 (#16)
The mapper process runs on Node 22. The failure is in the
typescriptlauncher:bin/tsccallsprocess.execve, and Node 22.15.0 to 22.20.0 and 24.0.0 to 24.9.x pass an empty environment to it (nodejs/node#60029, fixed in 22.21.1 and 24.10.0). The native compiler has noPATH, cannot startnode, and reports TS100025 for every file. The mapper never starts, so a runtime check cannot help. This PR addsenginesand a README section with the exact range and the error text.Upstream differences (#12, #13, #14, #15 first part)
test/diagnostics-tests/upstream-differencesrecords each report with the reason intest/test-packages/README.md:@glint/template's types reject these. TypeScript 5.9 reports the same errors on the transformed text.ember-tschides them because no Volar verification mapping covers the generated text the diagnostics anchor on. The mapper maps that text back to the template, so it reports them.@extendsover a call-expression heritage, in plain JavaScript too. TypeScript 5.9 honors it.🤖 Generated with Claude Code
https://claude.ai/code/session_011Wt614FPhxrjKFAARVNqFS