GravityProject / gravity

Open source social network built with Meteor
MIT License
131 stars 62 forks source link

Add linter #66

Closed pmuens closed 8 years ago

pmuens commented 9 years ago

Add a linter which is run automatically during development. So that the code is checked automatically if the code conventions are met.

nchenbang commented 9 years ago

Do you want to use the same configuration that Meteor uses or you've your own preferred configuration in your mind?

pmuens commented 9 years ago

I think the same as Meteor should be sufficient!

I have seen that there's a JSHint package. Maybe we could use that @nchenbang ?

nchenbang commented 9 years ago

Do you mean this one JSHint? I'm not sure if that package is still maintained but according to this meteor todos, you just need to add these three files

and then run eslint. to check whether your code matches the MDG style guide. If you want the linter to run automatically during development maybe you can consider to setup a linter in your IDE or text editor and reuse the same config. (I'm using sublime text which is really easy to do this)

I just tried to run the eslint. and the result is this ✖ 172 problems (155 errors, 17 warnings)

pmuens commented 9 years ago

Thank you.

https://github.com/meteor/meteor/tree/devel/packages/jshint this package looks nice and it's maintained by the MDG.

Maybe we can utilize it!

nchenbang commented 8 years ago

Do you know if there is any way to convert eslint rules into jshint? The problem I'm facing right now is MDG only provides eslint configuration for their official style guide.

pmuens commented 8 years ago

Hmm. No, I have absolutely no clue...

nchenbang commented 8 years ago

Ok, I've found the solution, just stumbled across this awesome package for adding eslint plugin instead of jshint plugin into the Meteor build system.

Would you mind me sending in the PR?

pmuens commented 8 years ago

Great! Yeah, please send the PR! :+1: