question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve Code Samples in Typescript Documentation

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ktsncommented, Mar 4, 2020

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?

2reactions
phanancommented, Mar 3, 2020

Fair enough. Pinging TS people @octref @znck @ktsn for halp.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found