google / mathsteps

Step by step math solutions for everyone
https://socratic.org
Apache License 2.0
2.12k stars 275 forks source link

Added Linting rules #83

Closed biyasbasak closed 7 years ago

biyasbasak commented 7 years ago

addresses #44

1) use const in every place it can be used 2) never use == 3) no trailing spaces at the end of lines 4) use object shorthand

evykassirer commented 7 years ago

thanks so much @biyasbasak, I'm really excited about this change

would you be up for also running the linter on the codebase and fixing all the places we don't follow these rules? (I know that might be a lot of grunt work, so we can get some other people on if you don't want to do it all)

biyasbasak commented 7 years ago

@evykassirer actually I did fix some parts of the codebase to follow the rules but I thought it would be better to ask before making the commit, now that you have brought it up, I would fix code in all the places and make the commit

evykassirer commented 7 years ago

sounds good! Asking first works for me - helps us make sure we're on the same page.

Thanks for making the fixes! Looking forward to seeing our code get better 🌟

biyasbasak commented 7 years ago

done but it would be great to add pre hooks to git for future linting.

In the file /mathsteps/lib/solveEquation/stepThrough.js in line 263 equationStatus.substeps.forEach(substep => logSteps); substep variable is never used but I left it the way it is

evykassirer commented 7 years ago

See #78 for githooks :D

The existing linter errors were fixed in that PR too :)

evykassirer commented 7 years ago

ahh this is fantastic, two linter PRs merged in one day 😍

thank you!