awatson1978 / starrynight

Scaffolding and Testing tool optimized for Meteor apps.
http://starrynight.meteorapp.com
53 stars 11 forks source link

Linting #61

Open martinhbramwell opened 9 years ago

martinhbramwell commented 9 years ago

Linting

Did you see Sashko's esLint suggestion? https://forums.meteor.com/t/eslint-configuration-for-official-mdg-style/271/5 He isn't the first I have seen recommend AirBnB's coding standard, so I think it makes sense to use it.

However, there are many little details to consider :

awatson1978 commented 9 years ago

Martin, this is fantastic stuff. In general, I'm on board with everything you're suggesting. It's stuff I've wanted to implement for awhile, but for lack of time, I've been concentrating on my area of specialty (healthcare, hipaa, fda) and hoping that somebody else would be able to eventually contribute some linting, logging, and other best practices. Suffice it to say that I'm in agreement with most all of it.

martinhbramwell commented 9 years ago

Thanks! It's really gratifying that you approve of what I've done.

  • Linting the boilerplate code is a must.

Good. As I get to know bits of it, I could submit linted versions from time to time. However, I would prefer to begin doing that after you have done two or three files. That exercise might lead you to adjust the rules, and then what I did would have to be redone. Can you find time for that :-p ?

  • I have no strong opinions on single vs double quotes.

I was going to suggest we follow the Meteor Style Guide. Hah! They don't refer to quote handling at all, and worse, they use both single and double in one 10 line code fragment.

  • StarryNight test coverage is rather limited right now. What tests there exist are implicit, rather than explicit.

I don't see myself tackling that anytime soon. Sorry.

  • will be interested to see some actual examples of the defensive programming techniques,

I'm not sure what you understood me to mean by that point. Those seven lint rules each refer to a known practice to avoid. The defence is simply having esLint catch you doing it, rather than some bizarre failure in the future.

  • Atom definately supports linting. With this eslint file, I'll get things configured.

Great! Like I said, I prefer to hold fire on any more work on this until you have settled down with a rule set you can live with.

  • I have family obligations later today, so will probably get to this stuff tomorrow.

Yeah, and I need to focus on my presentation for next month.

  • I want to pull the branch and run it before merging I to master. If I set up a develop branch, can you submit PRs to it?

Whatever you like better. I don't anticipate committing any more for a couple of weeks.

  • I think I'm on board with bunyan, but I'd like to set it up so there's not an extra installation step.

I understand the concern, but I am pretty much a Node n00B, so I can't help much. Installing Bunyan is only really necessary for piping output to a more normal looking log. The HUGE advantage of bunyan is to be able to stream JSON fornat logs into permanent storage. Which raises the question of Kadira. It seems to be the Meteor way of doing things. Should we look at that, maybe?

awatson1978 commented 9 years ago

No problem. Slow and steady wins the race. ;)

Linting and logging are fairly big contributions, in of themselves. I feel like I've tried a half-dozen linters and loggers over the years; but they've been very early releases, I didn't have a utility like starrynight I could roll them into, editor support was iffy, etc. That being said, I have a good feeling about the timing being right and all the pieces being in place to get this established in the pipeline.

So, yes, I'll find the time to settle on a linting ruleset (that will follow the AirBnB / Meteor Style Guide fairly closely), and will add some commands for linting and monitoring.

Anyhow, thank you again for prodding me to upgrade the linting and logging. They're much needed features.

And good luck with your presentation!