Improve Code Samples in Typescript Documentation
See original GitHub issueIn this part of the documentation: https://github.com/vuejs/vuejs.org/blob/master/src/v2/guide/typescript.md
it is totally unclear for a newcomer in what kind of file the code has to go. Setting up a new project with vue-cli choosing “with Typescript” and then adding the given code from the docu to a script tag (even with “type=‘ts’”) makes Vetur complain with
Types can only be used in s .ts file. (Vetur 8010)
It would be great if the docu could present a working example here. Would love to contribute, but am new to Typoscript.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Documentation - TypeScript for JavaScript Programmers
The main benefit of TypeScript is that it can highlight unexpected behavior in your code, lowering the chance of bugs. This tutorial provides...
Read more >Increase Code Quality with TypeScript | Blog - Crema
Reduce cognitive overhead; Increase code quality; Provide a single source ... TypeScript gives you better documentation, plain and simple.
Read more >GitHub - labs42io/clean-code-typescript
Enums can help you document the intent of the code. For example when we are concerned about values being different rather than the...
Read more >TypeScript Programming with Visual Studio Code
Next steps · TypeScript tutorial - Create a simple Hello World TypeScript in VS Code. · Editing TypeScript - Specific editing features for...
Read more >Generating Documentation for TypeScript Projects
Documentation for JavaScript projects has traditionally been generated via annotations inserted as code comments. While this gets the job ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s lang=“ts” but not type=“ts”. I’m not sure if we should include SFC guide in vuejs.org as it is vue-loader thing?
Fair enough. Pinging TS people @octref @znck @ktsn for halp.