coopernurse / node-pool

Generic resource pooling for node.js
2.38k stars 259 forks source link

eslint this stuff #110

Closed sandfox closed 8 years ago

sandfox commented 8 years ago

we should add some basic eslinting etc and think about running it for travis (maybe only as an advisory non failing output unless we ignore styling errors)

felixfbecker commented 8 years ago

:+1: I saw many conflicting styles, sometimes 2 spaces indent, sometimes 4 spaces, sometimes space after function, sometimes not etc.

sandfox commented 8 years ago

Do you have any opinions on eslint presets/configs etc? I've mostly used the default one eslint --init creates but I suspect we can probably do much better than that.

note to self - lets dig around some other popular projects and see what they do

sandfox commented 8 years ago

Came across this https://www.npmjs.com/package/eslint-config-es still need to give it a look and test but based on the readme it might be a contender

Maybe with this as well : https://www.npmjs.com/package/eslint-config-standard ?

felixfbecker commented 8 years ago

I would say use either eslint-recommended or standard. Standard is more strict, it forbids semicolons and doesnt allow empty lines in statements. Extend from one of these and redefine were you want. I have my own preferences, but Im always willing to adapt :)

sandfox commented 8 years ago

After yak shaving ESLint on another lib last night I propose we go with recommended and then add any rules which will help stop errors. I just don't care about styling enough and this is a small library, so I'm really just after static-analysis esque linting to help it be correct. I'd love to do this in typescript but it's a big jump in tooling and complexity for both contributors and publishing.

If I find some time today I'll try to do a PR and add some scripts for linting.

sandfox commented 8 years ago

@felipou I've done a quick PR #118, let me know what you think and any changes. (I changed my mind and went with standard in the end :-p

felipou commented 8 years ago

I'm all for consistent style! :) I rarely do any eslinting on my code, so I think I don't have much to contribute here, but if you need any help just let me know.

sandfox commented 8 years ago

derp, sorry @felipou, I meant to ping felix instead, autocomplete got the better of me!

felipou commented 8 years ago

Hahahaha, I imagined so, it felt kinda strange to be mentioned here! Don't worry, be happy! :)