graph-paper-org / app-template

Template for using Svelte and graph-paper with Storybook, Jest, ESLint, Prettier, CircleCI, and more already configured
Mozilla Public License 2.0
3 stars 5 forks source link

Add TypeScript support #113

Open openjck opened 4 years ago

openjck commented 4 years ago

Add optional TypeScript support. This should not interfere with JavaScript support. In other words, users should be able to write TypeScript files with .ts extensions or JavaScript files with .js extensions and either should just work without any additional configuration.

We should document this support without implying that TypeScript is required. For example, we might mention TypeScript support in the README but still use JavaScript for example code.

openjck commented 4 years ago

I made some progress on this. It's pretty straightforward, but getting Prettier and ESLint to play nicely with Svelte and TypeScript has been tricky. I don't think it's impossible (although not all tools are ready, e.g. eslint-plugin-svelte3), it'll just take some creativity.

https://github.com/openjck/app-template/tree/%25archive-issue-113-typescript-support-attempt-3

openjck commented 4 years ago

Another solution worth consideration is to at least partially merge this template with sveltejs/template. We have done a good job of configuring ESLint, Prettier, EditorConfig, and other tools. That work is fairly easy, but valuable. Then we could collaborate on getting all of the above working with TypeScript.

If nothing else, merging the two would make this template much smaller, requiring only a few things like customized ESLint rules, a Google Analytics setup, and a graph-paper import.

robhudson commented 3 years ago

The svelte/template has a script to enable typescript in the project. We should base this app template on that and add the extra libs and configuration on top of what's already existing there.