mikaa123 / linear

Ruler app with web-development in mind
http://mikaa123.github.io/linear-website/
MIT License
262 stars 21 forks source link

add linter to development dependencies #18

Closed radiovisual closed 8 years ago

radiovisual commented 8 years ago

In my latest PR #17, I cleaned up a lot of code inconsistencies (mostly just spaces and tabs), to make things a bit more uniform, but I propose that a linter be added to the devDependencies, so that developers working on new features or pull requests can all adhere to the same coding style.

The best tool I have seen for this is XO, which is super simple to use. Just install it with:

npm install --save-dev xo

and then add this to your package.json:

"scripts": {
  "test": "xo"
}

That's all you need to get linting support, but you can take it a step further and get Travis to run your linting on all Pull Requests that get submitted (highly recommended) by adding a .travis.yml file with:

language: node_js
node_js:
  - 'stable'

and then whenever a new pull request (from any user) has been submitted, Travis will run the linting, and will report that the PR is not ready to be merged until the linting issues have been fixed.

Its a beautiful thing! :smile:

radiovisual commented 8 years ago

Note: XO uses ESLint behind the scenes, so you can configure it to suit your preferred coding style, but XO comes with a set of defaults "out of the box" that I think are really great.

radiovisual commented 8 years ago

If you want linting support via XO, I am happy to get the project all setup and do all of the initial linting, then submit a new PR. All you would have to do is hook this repo up to Travis.

mikaa123 commented 8 years ago

Greaaaat! Let's do that. Yeah, let's use the "out of the box" configs for now and see if we need to tweak things later. I'll add the Travis hook ;) Thanks!

radiovisual commented 8 years ago

Awesome! Thanks! To avoid any merge conflicts (that would ultimately arise from a linting pass, since it would touch all source code files) and things easier to manage, I will work on finishing up the center guides functionality in PR #17, and then once that gets merged, I will add the linter and send a new PR with the linted code. This is the path of least resistance to get the code linted (at least for me) and avoid all the inevitable merge conflicts.

mikaa123 commented 8 years ago

Sounds like a good plan!