gstroup / apimocker

node.js module to run a simple http server for mock service responses.
MIT License
280 stars 81 forks source link

Switch from jshint to eslint and delint using airbnb styles #99

Closed twalker closed 5 years ago

twalker commented 5 years ago

This swaps out jshint with eslint as a step toward updating the repository to use ES6 and targeting later versions of Node.js.

eslint provides more capabilities than jshint, and supports style presets such as the popular airbnb styles.

All files have also been delinted to comply with the new styling rules. No functional changes have been made--only syntactic and whitespace updates. This should improve the consistency of the JS.

I recognize this is a significant stylistic change, and style is subjective, so I will not be offended if the current style is preferred over airbnb's.

To verify

Since delinting has modified a lot of files, it's best to pull the branch and view the output locally rather than within github.

  1. npm run lint (or grunt eslint) Expected results Linting should pass and exit without an error code.

  2. npm test Expected results All tests should pass.

twalker commented 5 years ago

@gstroup , I'm going to exercise my contributor permissions and merge this. Please let me know if you'd rather I not, and I'll can revert the merge.

I'm looking forward to my next PR, which add js support for config files. 😄

gstroup commented 5 years ago

@twalker Thanks for merging this in. Sorry, I was slacking, and didn't merge it. The change looks good. I'm really happy you've moved ahead with more ES6 syntax. Thanks for all your help!

twalker commented 5 years ago

@gstroup , no problem--it's holiday season after all!

I wanted to make use of the updated syntax during the next PR #100 , which adds support for JS config files. I used it to shrink a 3000 line config.json file down to a 40 line config.js file. I'm most interested in having that PR reviewed & published whenever it's convenient.