-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
Enhancement: Custom error messages #23
Comments
Makes total sense. Will think about this more and look into it soon! Much appreciated. :) |
On the subject of custom rule errors, it would be useful if configurable rules stated the config in their error message. For example, I just got these CI errors on some doc updates for eslint:
I had to search build scripts to work out what params had been sent to the linter, for example how many spaces should be used for list indentation? It would save time if errors looked like this:
That will enable me, and others, to see at a glance what needs changing to fix an error. |
* Docs: Consistent example headings & text pt4 #5446 Final batch of es6 docs for this sweep! 1. Ensure each doc has "Examples" heading, and that each option-specific example pair also has a suitable heading. 2. Ensure text above examples is consistent as per #5446 This PR does not attempt to address issues other than those stated above; such issues will be dealt with on subsequent sweeps of the docs detailed in #6444.. * Docs: Fixed lint errors in doc docs/rules/sort-imports.md: 161: MD004 Unordered list style docs/rules/sort-imports.md: 162: MD004 Unordered list style docs/rules/sort-imports.md: 163: MD004 Unordered list style docs/rules/sort-imports.md: 164: MD004 Unordered list style docs/rules/sort-imports.md: 37: MD007 Unordered list indentation docs/rules/sort-imports.md: 37: MD010 Hard tabs docs/rules/sort-imports.md: 38: MD010 Hard tabs docs/rules/sort-imports.md: 39: MD010 Hard tabs docs/rules/sort-imports.md: 40: MD010 Hard tabs * Docs: List indentation should be 4, not 2 FYI: I've requested enhanced error reporting for markdown linter - e.g. to expose rule settings in error messages: DavidAnson/markdownlint#23 (comment) 171
This ended up being a bigger task than I expected, but I think it's a significant improvement, thanks for suggesting it! PS - I did not implement a guidance message because it seems like configuration/process that will be handled differently by various projects (documentation, output message, code comment, etc.). |
Rules
Currently rules have a static error message, it would be useful if they could generate context-sensitive errors, for example:
Styles
An optional top-level error message that gets output upon the first error for a given batch of documents.
This would be particularly useful in CI builds of open source projects to help guide contributors to the style guide or templates, etc.
The text was updated successfully, but these errors were encountered: