Skip to content

jsdoc: Picks up @errors comment inside a code snippet inside jsdoc as a tag #54709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PuruVJ opened this issue Jun 19, 2023 · 0 comments
Open
Labels
Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone

Comments

@PuruVJ
Copy link

PuruVJ commented Jun 19, 2023

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

https://ts-ast-viewer.com/#code/JYOwLgpgTgZghgYwgAgMoHsC2EAqALUAc2QG8AoASAoHoAqWyi5W5AQRGXQCMArCBMMgTpwcUEWQAvaOk5RkmdFBRwANsDgBnCJuQBXbQBNkYWcoAOqxCgBuavTuShkAA2CZzSsC+SawcSGxwTQA6ZHwdFXUtRzhlZDg9U0wA4AQ1VQBPZHMtIxNZADVgSASQYxxM8whUBChgczAQxmYWlhcOnk025GpqZAABaCglTQAuZDwIVVV0Hr7+mGBVCAnNG2nIEOEQJcIQrvm+kyrVpw8vAAoAcgH1zYgu6gBrEuuAShCAYRE9np2-EJfsBiABeUg9ZDIV5gCbkKjMKFItQacYQhEsJFI45gAi6ADuy1UCgCCDwCWQSxWkKxyGumEyAFoqRBrhNrrlcdRTNQGczlhADpprgAaNo0rE4vHIQkzElgMkUwzAZQCJTZODlJxgXQ7SDBCXY-qXFx85Wq0xQTLUAAePmUmnQqg2ulMrk5eG56F5TPN-Et1rt70NUPpvpV-vVbLpHq9PsZfrVVtF4oxtKhx01CWiugg5QkdBlRM4ICy8rJId6-VxKD1eZ1nBgSojScyIuQIHQghryETAe12lUMErYYTLYDdGjHICnp5ZvH6snhoAvjTV2nlwBuHodFyppgsAB84SmyC4emWYEZzhcABJ1FwfCitE5dSIwCMZhBjFxsi4dnsIQwiELKhA+T66CUr76PkMBKDkiDPHAhBEM0GI9MeACa6B6EWcogBA34FMgUB6BwLggOYmAkWRvYQDYPhungcAbGgGyqJAADSUGJMkqTpDM2SEHm0ABCgPbKAAjheyjGM+b67CCehQKkIhOORXQASCQoiD48EuDqWn7F0uloQegyGBA8B6BxpDrge1CMPJAD8EwAEr8EohgADx+PUICEO2flEIe27LkAA

As you can see, if you click on JSDoc part of tree, @errors is given its own tag, even thought it is inside

CleanShot 2023-06-20 at 00 02 00@2x

πŸ’» 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

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases labels Jun 19, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Projects
None yet
Development

No branches or pull requests

2 participants