microsoft / microsoft/TypeScript
jsdoc: Picks up @errors comment inside a code snippet inside jsdoc as a tag
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Bug Report
🔎 Search Terms
jsdoc @errors comment as tag inside code snippet
🕗 Version & Regression Information
I noticed after upgrading from 4.9.4 to 5.1.3
⏯ Playground Link
As you can see, if you click on JSDoc part of tree, @errors is given its own tag, even thought it is inside
💻 Code
interface SomeThing {
/**
* An object containing zero or more aliases used to replace values in `import` statements. These aliases are automatically passed to Vite and TypeScript.
*
* ```js
* // @errors: hello
* /// file: svelte.config.js
* /// type: import('@sveltejs/kit').Config
* const config = {
* kit: {
* alias: {
* // this will match a file
* 'my-file': 'path/to/my-file.js',
*
* // this will match a directory and its contents
* // (`my-directory/x` resolves to `path/to/my-directory/x`)
* 'my-directory': 'path/to/my-directory',
*
* // an alias ending /* will only match
* // the contents of a directory, not the directory itself
* 'my-directory/*': 'path/to/my-directory/*'
* }
* }
* };
* ```
*
* > The built-in `$lib` alias is controlled by `config.kit.files.lib` as it is used for packaging.
*
* > You will need to run `npm run dev` to have SvelteKit automatically generate the required alias configuration in `jsconfig.json` or `tsconfig.json`.
* @default {}
*/
alias?: Record<string, string>;
}
🙁 Actual behavior
@errors in the code snippet was marked as a JSDoc tag
🙂 Expected behavior
@errors is inside a code snippet, should not be parsed as a JSDoc tag at all
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il problema utilizzando il link al playground fornito e l’esempio di interface/JSDoc nel report. Traccia il percorso di parsing di JSDoc per i blocchi di codice delimitati e verifica che @errors all’interno del blocco non venga emesso come tag, mentre il tag @default effettivo continui a essere riconosciuto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100