stencil-community / stencil-app-starter

Minimal starter project for building web components with Stencil
https://github.com/ionic-team/stencil
MIT License
320 stars 102 forks source link

add tslint, prettier, lint-staged for complete "tooling package" #16

Open Hotell opened 7 years ago

Hotell commented 7 years ago

It would be nice to follow best practices from js and ts programming paradigm, which could be enforced by providing tslint.

also united formatting and automatically handling all in pre commit hooks via lint-staged is very good idea and DX IMHO

I can submit all of these via PR if you're ok with that :)

adamdbradley commented 7 years ago

Yeah this is a great question and something we've been debating how to best do it. Basically we love tslint, and personally use it, but we don't want to place every and all 3rd party tools inside of our build process. Instead we'd like to make it easy to add in whatever you want (default would be tslint for sure). The real challenge is the watch process, and making it easy to have rebuilds kick off 3rd party code.

Webpack would do this via plugins, which is certainly a possibility, but our big goal is to not generate, or at least reduce any custom configs. So we'd love to come up with an easy way to hook into the watch/rebuild process, but want to make sure it's clean and simple, and any 3rd party tooling can hook into it without us having to add it to the system.

So open ended question: What's the best way to meet the above goals?

Hotell commented 7 years ago

What I meant is not incorporating all mentioned tooling within stencil server, rather creating separate npm-scripts tags within this project -> prettier + tslint with applied fixes would be triggered from within precommit hook powered by lint-staged/husky.

From my experience it is rather distracting seeing lint/formatting errors during writing code