-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add linter #1750
Add linter #1750
Conversation
"space-unary-ops": [2, { "words": true, "nonwords": false }], | ||
"use-isnan": 2, | ||
"wrap-iife": 2 | ||
} |
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.
Kinda screwed up here and just deleted any rule I wanted to disable; in reality we should leave them in the config. --reset
is not yet the default, so most editors' linting plugins will re-enable those rules. Will add these back in before merge.
once we settle on a final rule list I'll remove those comments in |
@@ -0,0 +1,113 @@ | |||
{ | |||
"env": { | |||
"browser": true, |
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.
if we're building with browserify, we can just use the node
env
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.
Mostly to pick up on document
, window
, etc. in the reporters, lib/utils.js
, and a few other files. We should probably remove it eventually though
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.
in those cases we could do a
/* eslint-env browser */
// ^ top of file
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.
👍
everything in {lib,test}/browser
should have its env set to browser, maybe a few reporters. I think the references to browser stuff elsewhere is feature detection. was being lazy but I'll just fix those
@ndhoule thx for all the work on this |
a4e7c44
to
7981c25
Compare
@boneskull Think I addressed all your comments (added your config, converted Just rebased, should be good to go—let me know if you want to see other changes |
95a3142
to
21de4b3
Compare
Only point to updating npm was to fix 0.8 CI builds, so amended it PR to only update npm when necessary. Also added npm >= 1.3.7 (introduction of caret) to Mocha's |
just pinging here. I think I've addressed all issues, let me know if that's not the case |
taking another look now. I'm probably going to merge this unless someone objects. |
@ndhoule The only thing I see that would prevent me from merging as-is is the npm change. Let me check on |
@ndhoule OK, so that's necessary because why? If we changed the caret in the |
If we can avoid that, it'd be great, otherwise this would have to be rebased into branch |
And yeah, using |
well, I know that, I just wasn't sure if the caret was there for a reason |
yeah, sorry, too early in the morning here :x |
We can change the caret to tildes, which should leave Mocha installable on npm > 1.3.7, so long as users aren't trying to install it with its dev dependencies. ESLint has carets in its dev dependencies, so including it will make npm 1.3.7+ a hard dev dependency for Mocha going forward—so those lines in |
Follows @boneskull's `make test` suggestion in mochajs#1534 (comment)
@boneskull rebased from master and fixed the caret issue. |
ty. That's fine with the dev deps. |
@boneskull Cool. Removed |
gonna try to merge this. |
just waiting on CI. oh boy oh boy oh boy |
@ndhoule thanks a ton! |
@jbnicolai @boneskull
Addresses #1359
The Make task uses eslint's
--reset
flag to disable all default ESLint settings because ESLint is planning on making that the default in the future and I'd rather not have to go back through and change all the settings when that happens. I know there are a lot of settings here, but would be good to get some feedback on what's here. Most of the rules are pretty uncontroversial and we already follow them, but there are a few sections (labeled in.eslintrc
) worth looking at.We should also add more directories (e.g.
bin
andtest
), but I'm thinking we can do that in a separate PR to speed this one along to minimize merge conflicts. (Happy to handle that too.)