-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Switch from jshint to eslint #885
Conversation
Hi there, any update on this? To avoid conflicts, would be great to get it merged before much else goes in. |
Still have a failing unit test here, in Do you understand what the assertion is supposed to be doing? |
tests/test_back.js
Outdated
@@ -208,7 +208,6 @@ tap.test('nockBack dryrun tests', function (nw) { | |||
try { | |||
done(); | |||
t.false(exists(fixtureLoc)); | |||
scope.done(); |
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.
^^ Since scope
is not defined, this line caused a ReferenceError, which erroneously caused the test to pass.
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.
I’ve looked into the test, and they try/catch doesn’t make any sense to me, so I’ll just remove it ¯\_(ツ)_/¯ 58c120c
.travis.yml
Outdated
script: | ||
- npm run lint | ||
- npm run coverage | ||
- npm run integration |
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.
how about we put npm run lint
into a "pretest"
script or "posttest"
script in package.json, so it automatically gets run with tests? That’s what I usually do
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.
Makes sense to me! I didn't realize it wasn't in there. It should definitely get run with npm run test
.
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.
Looks like it is getting run with npm test
!
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.
Ah I see it now. But we should probably add npm run unit
to the list?
And move npm run coverage
to after_success
?
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.
npm run unit
: we sure should! Hahaha.
I'm inclined to run npm run coverage
in after_script
rather than after_success
. Coverage data is still useful, even if a couple unit tests fail or a lint rule fails.
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.
great work 👍
Hey @paulmelnikow thanks for helping out with answering issues and reviewing Pull Request! I’d be happy to make you part of the maintainers team if you like? That would allow you to actually review & merge pull requests and create your own pull requests from branches instead of forks |
@gr2m I'd be down! I depend on nock for shields, and feel it's an important dependency for so much of the community. I've dug into it before and am glad to keep doing that. While I'm not sure how consistently I'll be able to help, I'm glad to do it when I can! |
No worries, there are no expectations, it’s all volunteer work and life happens. Just keep us posted :) And us know if you have any ideas on how to move the project forward towards a more open, contributor friendly project :) I’ve invited you, you should see the notification on https://github.com/node-nock |
looks like it’s currently failing due to a linting error :) |
This seems way excessively frequently to run these and they slow down my workflow a bunch. I end up using Frankly I'm inclined to move |
the current lint errors are legit, I’m looking into it. Let’s keep it in CI, but there are ways to speed things up that we can look into later :) |
Ah, I'm not suggesting removing anything from CI, rather removing unit tests from the pre-commit hook, and moving lint from pre-commit to pre-push. |
ah got it, only seen the pre-commit hook, it doesn’t work for me anyway. I’d remove all the commit hooks, I’ve seen people had so many struggle with them, it’s not worth the pain |
good to go from my side :) Maybe squash the commits when merging |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you! |
This is using
eslint:recommended
, which provides a bunch of mostly style-agnostic rules (look for the ✔️'s). Plus a couple extra whitespace rules, and strict mode.no-console
is turned off for tests and examples to avoid needing a bunch of overrides. It's a moderately large diff, primarily on account of a mass of unused variables intest_intercept.js
.There's not much changing of substance though.
I've got one failing unit test. It's been passing erroneously because
scope.done()
on line 161 causes a ReferenceError. (scope
is not defined.) It's not immediately clear how to fix it.I ran the .jshintrc through polyjuice. Some of the rules it generated would have produced large diffs, so I added them to eslintrc but left them commented out. We can turn them back on in subsequent passes. We may also want to look for a shared config.
For #868
Summary
Switch from jshint to eslint
Closes #868