babichjacob / sapper-typescript-graphql-template

A template that includes Sapper for Svelte, TypeScript preprocessing, and a GraphQL server through TypeGraphQL
MIT License
84 stars 14 forks source link

Add lang="typescript" to templates #5

Closed benmccann closed 4 years ago

benmccann commented 4 years ago

For now you'd have to use a forked version of Sapper to make it work, so not sure if you'd want to do it yet or wait until the PRs in the main repo get merged. Could at least start testing it out in a branch though maybe

babichjacob commented 4 years ago

Looks like the only place this hasn't happened yet is index.svelte which I just recently fixed in the derivative but forgot to do again here. Maybe I can fix that right after dinner in ~20 minutes. Thank you.

benmccann commented 4 years ago

Oh cool. I actually hadn't opened the other files and didn't realize they were already updated :-)

I wonder if it'd be better to just set "noUnusedLocals": false and remove most of the // @ts-ignore

babichjacob commented 4 years ago

It's claimed svelte-preprocess won't support that https://github.com/sveltejs/svelte-preprocess#typescript

Edit: It doesn't in the override / merge options, but it does in the global tsconfig.json file.

babichjacob commented 4 years ago

Actually, I think it would be a better idea to globally disable that and leave it to ESLint.

babichjacob commented 4 years ago

Probably closed by cc679ebdc05202032c78972ca560bdead0fe150e

benmccann commented 4 years ago

Just FYI, I think that the only reason the templates in this repo are able to be written in TypeScript is that they don't have preload functions. I have a PR pending in the Sapper repo that will fix an issue there to allow you to write preload functions in TypeScript-based Svelte templates.

You can probably still go ahead and use TypeScript in the templates since you don't have preload functions, but I thought I'd give you a heads up in case you run into any issues trying to add a preload

babichjacob commented 4 years ago

Thank you for reminding me. I remember historically having to write context="module" parts of the script in regular JS, but I don't know if any changes since then have allowed TS there yet.

babichjacob commented 4 years ago

closed by #11 (sapper 0.28) 😄