Description
Is your feature request related to a problem? Please describe.
The linter complains that almost every one of my lines is too long (MD013). This is due, in part, to hackmd using hard breaks by default (which I love, btw).
CommonMark allows you to easily adhere to MD013 by allowing you to break a long paragraph using single line breaks and, when rendered, those lines will be joined into a single, contiguous paragraph. Unfortunately, because hackmd defaults to hard breaks, you can't write a long paragraph without violating MD013. It's impossible.
The result is an error for 99% of paragraphs, which completely clutters the gutter containing the errors:
This means I have to waste time inspecting 100x more errors weeding through all of the irrelevant MD013 cases trying to find the handful that actually matter.
Describe the solution you'd like
-
Disable MD013 when hard breaks are used
For each note, if hard breaks are enabled (whether through frontmatter or user settings), disable MD013. With hard breaks enabled, there is little to no reason to check for long lines since it becomes impossible to write paragraphs without using long lines. -
Frontmatter linter settings
Allow the user to specify specific linting rules to ignore in a note's frontmatter:
---
title: my note
lint-ignore:
- MD003
- MD013
---
- User settings
In the same way that users are able to set a default setting for hard breaks, users should be able to set a list of linting rules to ignore for all notes. e.g.:
example user settings for linting rules
Solution 1 will solve this individual issue, but I think that a combination of Solution 2 and Solution 3 would be ideal for this use case. That would allow greater control over all linting rules that matter to the individual and also allow more granular control for individual notes.
But the optimal solution is all three. Allowing users to specify rules that matter to them means there is 0 wasted time weeding through irrelevant rules, and Solution 1 just seems like the way it should naturally work. If one rule (hard breaks) essentially necessitates another rule (ignoring MD013), they should be linked together so that you needn't waste time redundantly adding lint-ignore: MD013
to every single note that uses hard breaks.
Final note:
if Solution 2 and Solution 3 are implemented, there should probably be a complementary lint-enable
frontmatter option added. That way, if the user globally ignores a specific rule, they can still enable it for individual notes when necessary.