hackmdio / hackmdio/hackmd-io-issues

[Feature Request] Option to disable certain linter checks

Open
#243 0 comments 2 reactions 0 assignees View on GitHub
feature
Dominant language
No language data
Stars
40
Forks
9
PR merge metrics
No merged PRs in 30d

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:

![image](https://user-images.githubusercontent.com/621412/111309048-d2051500-8631-11eb-8fdd-589b51769367.png)

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

1. **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.

2. **Frontmatter linter settings**
Allow the user to specify specific linting rules to ignore in a note's frontmatter:
```yaml
---
title: my note
lint-ignore:
- MD003
- MD013
---
```

3. **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.:

![image](https://user-images.githubusercontent.com/621412/111317061-2f04c900-863a-11eb-9bc7-6d042a418dfe.png)

*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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.