solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

TypeScript starter should have `"strict": true` by default

Open DaniGuardiola opened this issue 3 years ago • 3 comments

I just lost a bit of time fixing uncaught type errors because I had assumed strict was enabled in tsconfig. Feels like it should be the default (this is the case for the other meta-frameworks I've used). Happy to send a PR if the maintainers agree :)

DaniGuardiola avatar Oct 27 '22 13:10 DaniGuardiola

yeah I agree we should enable! Though it might not work properly yet because of you have to make our internals strict: true since we ship with the typescript.

nksaraf avatar Oct 30 '22 04:10 nksaraf

@nksaraf right, yeah I guess there'll be some work to do to either fix or ignore issues in the internals :+1:

DaniGuardiola avatar Nov 04 '22 15:11 DaniGuardiola

@nksaraf As a general rule, there should be no coupling between the tsconfig strictness of a library and the strictness of the code that uses that library. The solution is simple: the package.json "main" entry should not point to uncompiled TypeScript code, but should instead point to a compiled "dist" directory that contains both .js and .d.ts files. Setting things up this way, the TypeScript compiler is no longer required to compile the library code, and the app can be a strict or as non-strict as it wants, independently of the library's compilation options. This is how I have set up my own library builds and it works fairly well.

viridia avatar Dec 03 '22 20:12 viridia

Duplicate of #140

ryansolid avatar Dec 21 '22 21:12 ryansolid