Skip to content

script-utils/linters/obsidianmd-rule-custom-message

Keeps obsidianmd/rule-custom-message from re-running a builtin rule this library’s own config already sets.

eslint-plugin-obsidianmd’s recommended config turns no-console and no-new-func off and re-runs each through obsidianmd/rule-custom-message, which fetches the builtin rule and reports its findings under its OWN rule id. So the severity a consumer writes on no-console is never consulted: 'no-console': 'off' is inert, and the error that remains names a rule the consumer never configured. This library sets both builtins itself, stricter, so in every consumer the wrapper added nothing but a second report of the same line.

Interface Description
StripOwnedRuleCustomMessageEntriesParams Parameters for stripOwnedRuleCustomMessageEntries.
Function Description
stripOwnedRuleCustomMessageEntries Removes from a config’s obsidianmd/rule-custom-message options every wrapped rule named in ownedRuleNames. An entry for a rule NOT in the set keeps running through the wrapper, so an entry upstream adds later is not silently dropped. When nothing is left the wrapper is turned off rather than run with an empty map.
Variable Description
RULE_CUSTOM_MESSAGE_RULE_NAME The rule id of the wrapper that re-reports builtin rules under its own name.