microsoft / microsoft/vscode-html-languageservice
Allow writing TypeScript in Script tags with @ts-check
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 284
- Forks
- 138
- Avg merge
- 19h 11m
- Merged PRs (30d)
- 5
Description
Be able to write TypeScript in Script Tags inside .html files. (I'm not asking for compilation support for .html files only allow the usage and check of TS inside .html files Script Tag)
When we do this: we get the error Type annotations can only be used in TypeScript files. when hovering over the Type.
<script>
let foo: number = 0;
foo = "hello";
</script>
//@ts-check works and gives me checks and squiggly lines but still gets not rid of the error above.
A Solution would be if this would work.
<script>
//@ts-check
import { mod } from "./this/should/give/autocomplete"
let foo: number = 0;
foo = "hello";
mod();
</script>
The ideal would be if //@ts-check allows the use of TypeScript inside Script Tags.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by tracing how the HTML language service handles script tags and the //@ts-check directive; done means TypeScript annotations, type diagnostics, imports, and autocomplete work inside HTML script tags without adding HTML compilation support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100