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

No compile time warning on using event #6530

Closed
AJamesPhillips opened this issue Jan 18, 2016 · 4 comments
Closed

No compile time warning on using event #6530

AJamesPhillips opened this issue Jan 18, 2016 · 4 comments
Labels
Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Question An issue which isn't directly actionable in code

Comments

@AJamesPhillips
Copy link

Is this expected behaviour?

function broken(evt: Event) {
    // Meant to do something with `evt` but typed it incorrectly.
    Event.target;  // Errors correctly
    event.target;  // No error.  Expected behaviour?
}

tsc version: 1.7.5

@DanielRosenwasser DanielRosenwasser added Question An issue which isn't directly actionable in code Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Jan 18, 2016
@DanielRosenwasser
Copy link
Member

event has an ambient declaration in lib.d.ts. We've run into similar problems with name. I don't think there's anything we can do about this. Ideally one could write a linter rule forbidding use of these declarations.

@AJamesPhillips
Copy link
Author

Got it. Thanks for the speedy response!

@adidahiya
Copy link
Contributor

we've run into this problem as well. filed a TSLint issue to track it palantir/tslint#922

@DanielRosenwasser
Copy link
Member

Thanks @adidahiya!

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants