Feature request: Track references of string literals on keys and vice-versa for better intellisense #45549
Open
5 tasks done
Labels
Bug
A bug in TypeScript
Domain: Refactorings
e.g. extract to constant or function, rename symbol
Effort: Difficult
Good luck.
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Help Wanted
You can do this
Milestone
Suggestion
π Search Terms
rename string literals, refactor
β Viability Checklist
β Suggestion
Playground for code below
π Motivating Example
A bunch of popular libraries that will benefit from this for example...
1. xstate
This feature will enable ctrl+click on "doStuff" in index.tsx navigating to "doStuff" in machine.ts and renaming both "doStuff" by renaming either of them (given the types are correct ofc)
2. stitches
Taken from here
Here the string literal
"violet"
in<Button color="violet">Button</Button>
references theviolet
key in the object passed tostyled
function3. framer-motion
Taken from here
Here the string literals
"open"
and"close"
inmotion.nav
'sanimate
reference the keys ofvariants
passed to it.These three come to my mind right now, but I think this is a very common pattern so the improvement in the intellisense will have a significant impact.
The text was updated successfully, but these errors were encountered: