🔍 Search Terms
isolated declarations, computed properties
✅ Viability Checklist
⭐ Suggestion
Now that #60052 allows for (some) computed properties in in .d.ts files I think the next step is for --isolatedDeclaration to be updated to not error and to emit the computed properties. Opening this issue if helpful to track this work.
I believe the previous plan (#58800) to introduce a new syntactic marker is no longer required.
Related issues: #58533#60818#61068
📃 Motivating Example
exportconstprop: unique symbol=Symbol();exportclassMyClass{[prop]=()=>Math.random();}@isolatedDeclarations: false
playground
exportdeclareconstprop: unique symbol;exportdeclareclassMyClass{[prop]: ()=>number;}@isolatedDeclarations: true (current 🙁)
playground
ts(9038) Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
exportdeclareconstprop: unique symbol;exportdeclareclassMyClass{}@isolatedDeclarations: true (future 🚀 )
No error and same emit as @isolatedDeclarations: false
exportdeclareconstprop: unique symbol;exportdeclareclassMyClass{[prop]: ()=>number;}💻 Use Cases
The primary use case is enabling isolated declarations at scale on large codebases that make heavy use of computed properties.
🔍 Search Terms
isolated declarations, computed properties
✅ Viability Checklist
⭐ Suggestion
Now that #60052 allows for (some) computed properties in in
.d.tsfiles I think the next step is for--isolatedDeclarationto be updated to not error and to emit the computed properties. Opening this issue if helpful to track this work.I believe the previous plan (#58800) to introduce a new syntactic marker is no longer required.
Related issues: #58533#60818#61068
📃 Motivating Example
@isolatedDeclarations: falseplayground
@isolatedDeclarations: true(current 🙁)playground
@isolatedDeclarations: true(future 🚀 )No error and same emit as
@isolatedDeclarations: false💻 Use Cases
The primary use case is enabling isolated declarations at scale on large codebases that make heavy use of computed properties.