microsoft / microsoft/TypeScript
jsdoc: Picks up @errors comment inside a code snippet inside jsdoc as a tag
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem mithilfe des bereitgestellten Playground-Links und des Interface/JSDoc-Beispiels im Bericht. Verfolge den JSDoc-Parsing-Pfad für Codeblöcke mit Fence-Begrenzung und überprüfe, dass @errors innerhalb des Blocks nicht als Tag ausgegeben wird, während das tatsächliche @default-Tag weiterhin erkannt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100