hackmdio / hackmdio/hackmd-io-issues

[Feature Request] Option to disable certain linter checks

Offen
#243 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
feature
Vorherrschende Sprache
Keine Sprachdaten
Sterne
40
Forks
9
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Es sind keine Implementierungsdateien oder Tests angegeben. Beginne damit, die bestehende Einstellung für harte Zeilenumbrüche zu finden und die Linter-Konfiguration zu beachten, und ermittle anschließend, wie frontmatter und benutzerbezogene Ignore-/Enable-Regeln miteinander interagieren sollten; als erledigt gilt die Aufgabe, wenn die angeforderten Geltungsbereiche und das Verhalten von MD013 durch Tests abgedeckt sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
markdown, yaml
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.