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
If the configuration contains an unknown rule: Markdownlint must report that the rule isn't supported.
For example, ESLint reports the error: Definition for rule 'no-konsole' was not found.
7 years ago, I misspelled the commonds-show-output rule. And I've just realized it, thanks to a spellchecker that reported that the word commonds doesn't exist.
The text was updated successfully, but these errors were encountered:
This has come up before, though I can’t find the discussion. Basically, because custom rules (like the one you are using) exist, there is no definitive list of valid rules they could appear in configuration. There IS a schema for configuration files and I have instructions for how to use it generally as well as how to identify non-core rules here: https://github.com/DavidAnson/markdownlint/blob/main/schema/ValidatingConfiguration.md
But I do not think it is appropriate to throw an error just because a configured rule does not happen to be in use at the moment. That same configuration file could be used across multiple runs of the tool and some of those runs may include or exclude various rules. It’s not wrong to configure a rule that isn’t in use, though I understand why you would have liked to be alerted in this scenario.
I’m open to suggestions, but think that validating with a schema as above is a reasonable approach.
You could provide two schemas: the current markdownlint-config-schema.json and the new markdownlint-config-strict-schema.json which is the same schema, but with “additionalProperties”: false. And export a new type ConfigurationStrict which is type Configuration without [k: string]: unknown.
With this solution, I can detect my problem with the JSDoc /** @type {import("markdownlint").ConfigurationStrict} */ and TypeScript.
If the configuration contains an unknown rule: Markdownlint must report that the rule isn't supported.
For example, ESLint reports the error: Definition for rule 'no-konsole' was not found.
7 years ago, I misspelled the
commonds-show-output
rule. And I've just realized it, thanks to a spellchecker that reported that the word commonds doesn't exist.The text was updated successfully, but these errors were encountered: