-
-
Notifications
You must be signed in to change notification settings - Fork 453
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 #415
Enable ESLint #415
Conversation
This is awesome, thanks! I'll check two.js line 1335 to make sure that changing |
.eslintrc.json
Outdated
}, | ||
"overrides": [ | ||
{ | ||
"files": ["utils/**", "tests/**"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm it lines everything that's not in the overrides?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overrides mean "apply these linting rules to only these specific files".
I'm using it here so it knows that "utils" and "tests" are running in Node, and "tests" has some QUnit-related global variables (ESLint will otherwise complain about accessing undeclared global variables).
Since QUnit runs in the browser, I've removed it from the |
I'll add linting as a step in the build script 🙇 |
This has been merged, but actually I'm getting errors when trying to lint. "ESLint couldn't find the config "airbnb-base" to extend from. Please check that the name of the config is correct." Is that something you have |
I'm not sure--there's nothing Airbnb-related in the .eslintrc.json, and no Airbnb-related dependencies that appear in ESLint's dependencies. Are you running the version of eslint this project depends on with |
I deleted my |
An error log would be helpful; I can't seem to reproduce this on Linux or Windows. |
It was an issue with me. I keep a |
Enable ESLint
This PR enables ESLint and lints the codebase with it.
The linting rules used are the "recommended" settings for ESLint, with the following exceptions:
The vast majority of fixes fall into the following categories:
var
scoping more explicitvar
sThere are a few changes that may affect code behavior:
v
was missing avar
statement and hence leaking into global scope)max
function (I confirmed with a debugger that it's not defined in that scope) was replaced with Math.maxi
given by 'forEach' now uses thej
variable--not sure if that changes anythingev
has been changed toevent
.ev
was not defined.