We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
libdom name
libdom
name
When checking the identifier definition, if the symbol is defined in libdom.d.ts and the identifier is called name, emit a diagnostics.
libdom.d.ts
name is a common variable in daily programming, unfortunately, there is a global variable named name in libdom.d.ts ( https://developer.mozilla.org/en-US/docs/Web/API/Window/name )
Now the global name is type never but not all cases are covered by the never type. for example:
never
export function x(y: string) { if (y === name) return true // ~~~~ implicit bug, typescript won't give a type error here return false }
This is a breaking change. And if someone really wants to use the global name, I'd like to suggest them to use window.name.
window.name
I'd like to implement this feature if the TypeScript team will accept it.
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered:
Duplicate of #18433.
Sorry, something went wrong.
Is that okay?
Be trapped by this problem just 2 minutes ago:
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Search Terms
libdom
name
Suggestion
When checking the identifier definition, if the symbol is defined in
libdom.d.ts
and the identifier is calledname
, emit a diagnostics.Use Cases
name
is a common variable in daily programming, unfortunately, there is a global variable namedname
inlibdom.d.ts
( https://developer.mozilla.org/en-US/docs/Web/API/Window/name )Now the global
name
is type never but not all cases are covered by thenever
type. for example:This is a breaking change. And if someone really wants to use the global
name
, I'd like to suggest them to usewindow.name
.I'd like to implement this feature if the TypeScript team will accept it.
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: