You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
changed the title
Support for Markdown in the Rule's Message Report
Support for markdown in the rule's message report
Jan 7, 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.
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:
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:
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.
The text was updated successfully, but these errors were encountered: