alexanderGugel / ied

:package: Like npm, but faster - an alternative package manager for Node
http://alexandergugel.github.io/ied
MIT License
1.99k stars 53 forks source link

Refactor unit tests #138

Closed mgcrea closed 8 years ago

mgcrea commented 8 years ago
Checklist

Tests

Description of change
mgcrea commented 8 years ago

Just added a commit refactoring eslint leveraging Airbnb's config which is a pretty good (strict) starting point. Tried to minimize the changes to the code by adding according rules.

One thing that we should definitely change in my opinion is the indenting. The whole JS world uses spaces (both airbnb and feross/standard styleguide do recommend spaces), as an open-source library, this project should try to closely follow commonly used standards.

I did not want to push the change in this commit (should be a single separated commit) without polling you about it as it is often a "sensitive" subject since changing habits is hard. I won't mind if you do not want to switch.

alexanderGugel commented 8 years ago

I'm mostly ok with this. I think there are a lot of good changes in there, but a lot of things are just a matter of taste I think.

E.g. I don't think using forEach instead of for of is necessarily "better", so I don't really think it makes sense to change that kind of stuff. I don't feel strongly about balanced spacing in params. Not sure if it really makes sense to change it.

I really like the tooling changes, e.g. the Mocha config etc. Also consistently using template strings is a great idea. And we definitely needed test coverage.

Concerning tabs vs spaces: I'm using a tabstop of 8, but I realise that the rest of the world uses either 2 or 4. I think using a tabstop of 8 makes it more painful to write deeply nested functions. I think that's generally speaking not a bad thing.

Any chance we can keep 5702f15 separate and discuss the changes to the linting rules first?

mgcrea commented 8 years ago

Thanks for the review, indeed some changes are cosmetic, and a matter of state, I don't really mind about any of them, a few side-notes:

I'll see if I can cherrypick the eslint commit to another PR.

alexanderGugel commented 8 years ago

@mgcrea It looks like this conflicted with the dependency update PR.

Can we change the forEachs back to for of?

Will merge as soon as the conflicts are resolved. Great stuff!

mgcrea commented 8 years ago

@alexanderGugel, I'm on it.

mgcrea commented 8 years ago

Travis is green, ready for merge! Thanks for the review.