Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preserve typescript autocomplete #1188

Merged
merged 4 commits into from Mar 30, 2023

Conversation

Mist3rBru
Copy link
Contributor

@Mist3rBru Mist3rBru commented Mar 9, 2023

When we type something like 'literal-string' | string we loose all the typescript autocomplete. My proposal is to maintain either typescript autocomplete and generic strings by using the Omit hack.

// before
type TString = 'foo' | 'bar' | string

const test: TString = 'any' // no autocomplete and no error
const test2: TString = 'foo' // no autocomplete and no error


// after 
type TString = 'foo' | 'bar' | Omit<string, 'foo' | 'bar'>

const test: TString = 'any' // no autocomplete and no error
const test2: TString = 'foo' // with autocomplete and no error

@Mist3rBru Mist3rBru changed the title fix: presenve type autocomplete fix: preserve typescript autocomplete Mar 9, 2023
typings/index.d.ts Outdated Show resolved Hide resolved
@TimeForANinja TimeForANinja merged commit e57c6f2 into fent:master Mar 30, 2023
5 checks passed
@github-actions
Copy link

🎉 This PR is included in version 4.11.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Mist3rBru Mist3rBru deleted the fix/preserve-type-autocomplete branch March 30, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants