question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Everything resolves to strings

See original GitHub issue

Hi there!

It seems to me that all typing resolves to string?

Example:

export type BorderStyleProperty = Globals | LineStyle | string;

Since it can be a string that will override both Globals and LineStyle, not giving intellisense on the possible properties of the border style.

Is this intentional?

I did some more research: https://github.com/Microsoft/TypeScript/issues/29729#issuecomment-471566609

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
remorsescommented, Jun 22, 2020

Adding the string type to the union does not make much sense imo, you lose auto completion and type validation

1reaction
freniccommented, Oct 16, 2020

@kylemh display can have combinations of values https://drafts.csswg.org/css-display/#the-display-properties so it would be wrong to remove | string from that property. I’ve given it some attempts to combine different values into multiple string literals and in that way be able to skip | string but it’s really complicated to do problematically and the type definitions exploded in size and performance issues became a concern so the progress halted.

I may give it another try soon thanks to this which will make things a bit easier. At least support a fragment of different combinations so display becomes complete without | string would be really nice. I’m well aware of the issue but you’re welcome to submit a separate issue if you’d like.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - Resolve list of strings as respective objects
I have a list containing [bool, "string of function name", ["parameters","to","pass"]] but when I pass them, they don't resolve to anything ...
Read more >
What is string theory? - Space.com
String theory has been held up as a possible "theory of everything," a single framework that could unite general relativity and quantum ...
Read more >
String theory - Wikipedia
In physics, string theory is a theoretical framework in which the point-like particles of particle physics are replaced by one-dimensional objects called ...
Read more >
Promise.resolve() - JavaScript - MDN Web Docs
The Promise.resolve() method "resolves" a given value to a Promise. If the value is a promise, that promise is returned; if the value...
Read more >
Strings - C# Programming Guide | Microsoft Learn
Everything inside the braces ( {...} ) will be resolved to a value and output as a formatted string at run time.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found