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

Linter should show global event reference as an error #20014

Closed
cvializ opened this issue Dec 20, 2018 · 2 comments
Closed

Linter should show global event reference as an error #20014

cvializ opened this issue Dec 20, 2018 · 2 comments
Assignees

Comments

@cvializ
Copy link
Contributor

cvializ commented Dec 20, 2018

Describe the new feature or change to an existing feature you'd like to see

Currently the linter / type checker does not complain if a reference to window.event is used in a function. This is a common footgun in JavaScript and should be avoided in AMP's code.

Describe alternatives you've considered

Code review is one way to avoid adding references to window.event in code, but it can miss instances.

/cc @erwinmombay

@erwinmombay
Copy link
Member

would doing https://eslint.org/docs/rules/no-restricted-globals suffice?

@cvializ
Copy link
Contributor Author

cvializ commented Dec 20, 2018

Oh cool! Yes, that looks like exactly what's needed for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants