Commit 5627f7b
fix: import elision for inline type specifiers, declare property decorators, and computed keys (#10)
* fix: import elision for inline type specifiers, declare property decorators, and computed keys
Three import specifier mismatches fixed:
1. Inline `type` specifiers (`import { type FormGroup }`) now tracked and elided
2. `declare` property decorator args (`@ViewChild(X) declare y`) now elided
3. Computed property keys in type annotations (`[fromEmail]: T`) now preserved
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: recurse into nested type literals for computed property key detection
The computed property key collector only checked the top-level members of
a TSTypeLiteral but did not recurse into property type annotations. This
meant nested patterns like `{ nested: { [fromEmail]: string } }` would
miss inner computed keys, incorrectly eliding those imports.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: handle computed keys in array, tuple, generic, and parenthesized types
The computed property key collector only handled TSTypeLiteral, TSUnionType,
and TSIntersectionType. Added support for TSArrayType, TSTupleType,
TSTypeReference (generics), and TSParenthesizedType so computed keys like
`[myKey]` inside these type structures are correctly preserved.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test: assert ViewChild decorator is also elided on declare properties
Adds explicit assertion that the decorator name itself (not just its
arguments) is correctly elided when only used on declare properties.
TypeScript does not emit declare properties, so the decorator has no
runtime effect.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 9e2d565 commit 5627f7b
File tree
1 file changed
+454
-16
lines changed- crates/oxc_angular_compiler/src/component
1 file changed
+454
-16
lines changed
0 commit comments