Skip to content
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

Support for markdown in the rule's message report #1761

Closed
Newbie012 opened this issue Jan 7, 2024 · 1 comment
Closed

Support for markdown in the rule's message report #1761

Newbie012 opened this issue Jan 7, 2024 · 1 comment

Comments

@Newbie012
Copy link

Current Behavior:

While writing custom ESLint rules, I discovered that it's currently impossible to use markdown in the rule's message report. This means that any styled text or inline code cannot be properly formatted, reducing clarity and readability.

For instance, currently, a message report could look as follows:

context.report({
    node,
    message: 'Avoid using this in your code: const a = {};'
});

Expected Behavior:

The ESLint VScode extension should support Markdown in rule report messages to allow richer instruction and improved readability. This would enable rule authors to provide well-formatted, comprehensive instructions, including items like inline code, bullet points, etc.

Ideally, it would look like:

context.report({
    node,
    message: 'Avoid using `const a = {};` in your code.'
});

In this case, the rule message is more expressive and it leverages markdown formatting, delineating the code from the rest of the text for clarity.

@Newbie012 Newbie012 changed the title Support for Markdown in ESLint Rule's Message Report Support for Markdown in the Rule's Message Report Jan 7, 2024
@Newbie012 Newbie012 changed the title Support for Markdown in the Rule's Message Report Support for markdown in the rule's message report Jan 7, 2024
@dbaeumer
Copy link
Member

dbaeumer commented Jan 8, 2024

This is a limitation in VS Code itself (diagnostics can only be strings right now) and there is a feature request in VS Code to improve that. I will close the issue since things should work as soon as support gets added to VS Code.

See microsoft/vscode#54272

@dbaeumer dbaeumer closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants