-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript errors #218
Comments
From another perspective, components in There are a bunch of layer cake users who don't use typescript and so I would be worried that it would make these starter components less approachable for them if we included a bunch of type annotations that they're not used to seeing. At the same time, users who want those annotations aren't blocked on adding types to satisfy their linters etc. If there's a middle ground I'm missing, though, feel free to start a PR with what you think is the best way to handle. Overall, wrestling with typescript isn't that appealing to me personally but if there are improvements that are easy to do then let's take a look. |
Fully agreed! I see the benefits, but it can be quite painful, especially since there are so many ways write things. Hopefully we can find a middle ground, I think it's helpful for checking where and if things break during updates. |
I appreciate the help and enthusiasm – also helpful for me to learn things I otherwise wouldn't! |
Dropping this cheatsheet in here for reference: https://alexharri.com/blog/jsdoc-as-an-alternative-typescript-syntax @rgieseke I thought the PR for the axes was a good first step. Are you interested in adding any more? I can slowly make my way through, as well. |
I definitely am interested in adding more! I'll try to keep you posted when I start on something so we don't have duplicated efforts. |
Great! What may be easiest to avoid duplicate work is to issue PRs on smaller batches of files and merge them into a branch called edit: I made |
One thing that @aslak01 brought to my attention is to not use uppercase |
I was just doing some reading and it appears that this does not apply to JSDoc: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#legacy-type-synonyms For legacy reasons, |
What a twist! Thanks for the research! |
I still think it's preferable to rewrite them to the lowercase variants to be clear. Even if using the capitalised variants don't cause the problems they do in regular TS, I think using the capitalised variant will contribute to unnecessary confusion. |
I agree and will make a PR for that! |
See discussion in mhkeller#218 While 'Number' is a valid JSDoc type synonym the lower-case variant is used to avoid confusion.
See discussion in mhkeller#218 While 'String' is a valid JSDoc type synonym the lower-case variant is used to avoid confusion.
See discussion in mhkeller#218 While 'Boolean' is a valid JSDoc type synonym the lower-case variant is used to avoid confusion.
Again following up after #211 (and #191), there are a bunch of Typescript errors when running
npm run check
.As discussed previously (e.g. #49, #56, #117) it's tricky to get everything typed up properly with Layer Cake providing many generic layers. Still it would help if there were fewer (or no) error messages, especially when including a Layer Cake component in a Typescript based project (so ensure stuff in
src/_components
is error free if possible).I'm very happy to help with cleaning things up but would be good to get your current thoughts on this, @mhkeller, if you have any.
I already tried experimenting a bit with this, but things get messy easily (e.g. more errors if one starts typing in one place.) I could also try starting with smaller PRs which are probably easier to discuss than general big picture questions.
The text was updated successfully, but these errors were encountered: