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

Eslint #385

Closed
wants to merge 11 commits into from
Closed

Eslint #385

wants to merge 11 commits into from

Conversation

digawp
Copy link
Contributor

@digawp digawp commented Mar 22, 2016

Brief:

  • Add ESLint
  • Fix code to make it conform to the standard
  • Add gulp task for linting (gulp lint)
  • Run lint before test

Important changes/refactoring due to ESLint will be annotated on the diff.
There is a lint error I purposely left out because I would like to check with the core team regarding that. I will comment on the diff itself

this.verify(req, true, function(err, success) {
if (!success) {
this.verify(req, true, function (err, success) {
if (err) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint requires us to make use of err when handling the error callback. Should I make an exception to the rule here, or is the way I handle it currently is fine? It passes the test now.

digawp added 5 commits March 23, 2016 00:39
To note:
- check err instead of !success in lib/server.js:321
- Change while loop with assignment to for loop
var path = (options.path || '/engine.io').replace(/\/$/, '');

var destroyUpgrade = (options.destroyUpgrade !== undefined) ? options.destroyUpgrade : true;
var destroyUpgradeTimeout = options.destroyUpgradeTimeout || 1000;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the diff comment that requires attention

This variable destroyUpgradeTimeout is not actually used, but it seems as if it should be used, looking at line 450.

@darrachequesne
Copy link
Member

@digawp how about using something like https://github.com/Flet/semistandard? Won't it be easier to maintain?

@darrachequesne
Copy link
Member

Thanks a lot for the hard work, btw!

darrachequesne pushed a commit that referenced this pull request Oct 31, 2016
@darrachequesne
Copy link
Member

Merged as 7cbdd5e.

Thanks a lot!

@darrachequesne darrachequesne added this to the 1.8.0 milestone Nov 20, 2016
darrachequesne pushed a commit that referenced this pull request May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants