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

Enable eslint "no-undef" rule #1

Open
3 tasks
Robbert opened this issue May 3, 2016 · 0 comments
Open
3 tasks

Enable eslint "no-undef" rule #1

Robbert opened this issue May 3, 2016 · 0 comments
Labels

Comments

@Robbert
Copy link
Member

Robbert commented May 3, 2016

Currently we have defined { "no-undef": ["off"] } in .eslintrc because there are dependencies between files but the files are checked as standalone scripts. This results in hundreds of "no-undef" errors, because constructors are extended with properties and methods in different files than were the constructor is defined. This is especially the case in the files were browser specific extensions to DOM APIs are defined. For example:

webkit_dom.js

Element.prototype.scrollIntoViewIfNeeded = function(opt_center) {};

Above will result in an error because Element is undefined. That's true, because it is defined in another file: w3c_dom1.js:

/**
 * @constructor
 * @extends {Node}
 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614
 */
function Element() {}

It would still be useful to catch unintended undefined references, which can be caused easily by a typo, so we need to find a way to resolve the dependencies before running eslint.

  • Clarify the subject of this issue, for future reference
  • Define and resolve dependencies between extern files.
  • Enable no-undef rule in .eslintrc
@Robbert Robbert added the testing label May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant