deathraygames / civ-clicker

Fork of the open source game CivClicker, by David Holley and Scott A. Colcord
http://deathraygames.com/play-online/civ-clicker/
GNU General Public License v3.0
56 stars 43 forks source link

All code should pass through a linter #43

Closed olleharstedt closed 2 years ago

olleharstedt commented 7 years ago

Don't know which linter is best right now for Javascript. Any ideas?

olleharstedt commented 7 years ago

Maybe ESLint? https://www.sitepoint.com/comparison-javascript-linting-tools/

olleharstedt commented 7 years ago

http://eslint.org/docs/user-guide/getting-started

olleharstedt commented 7 years ago

Flow from Facebook can also be used. It can detect bugs that a linter will not. It requires the line

/* @flow */

at the top of each file.

Anahkiasen commented 7 years ago

They're not entirely exclusive, Flow and ESLint go hand in hand although you can configure ESLint to also lint your codebase with Flow through this plugin.

From personal experience both are amazing tools, and Flow allows you to introduce static types to your codebase gradually (instead of all at once like with Typescript). I'd maybe recommend to start with ESlint using the "recommended" ruleset that comes with it, and go from there.

olleharstedt commented 7 years ago

Yes, I think that's a good idea, too.

Lukenickerson commented 2 years ago

I added in eslint as a dev dependency, and updated the linting rules to my favorite: airbnb-base with some modifications.