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

tsconfig improvements #15

Closed Hotell closed 6 years ago

Hotell commented 6 years ago

there are few redundancies within tsconfig.

Also I suggest adding strict:true

I can send PR if you're ok with that :)

jgw96 commented 6 years ago

Hey! We would love a PR! Feel free to ping me here when you get it posted and ill review asap. Thanks!

jgw96 commented 6 years ago

Hey @Hotell , thanks a ton for the PR! We just discussed this internally and for now, we would like to not enable strict mode by default. We think that for beginners, the very strict type checking that strict mode enables will be too much overhead. Whats your thoughts on that?

Hotell commented 6 years ago

hey @jgw96 ! yw!

so I agree and kinda disagree as well :D

writing TS without strict is like writing most of the time without that safety seat belt TS provides for you.

If you don't want to provide strict, at least let's come to an agreement by enabling strictNullChecking

WDYT ?

arjunyel commented 6 years ago

@jgw96 @adamdbradley Hi all, thanks for the excellent work on this starter :D I just found this issue after I submitted a pull request for the ionic-pwa-toolkit turning on strict mode.

I strongly think strict should be on by default. First as @Hotell said Typescript starts projects now with it turned on by default. Second I actually think it helps beginners a ton because it helps them understand where they aren't accounting for things like nulls, some of which a beginner would never expect. As someone who recently was a Typescript beginner, Strict mode helped me catch a ton of bugs that would have been very hard for me to understand if I hit them at run time.

If a user hates it they can opt out but I think Strict is a very safe default. If any work needs to be done to convert the code base I'm happy to do it :) Thanks for your time!

jgw96 commented 6 years ago

Hello all! In the latest releases of Stencil we have added functionality to allow Stencil to read your tsconfig so you can turn on settings like strict mode optionally. At this time turning on strict mode by default is not something we want to do as it goes against our goal of making things as simple as possible out of the box. Because of this, I am going to close this issue for now. Thanks for using Stencil!