no-git-conflict-marker
✅ Recommended
⭐ CommonMark
🌟 GFM
Disallow git conflict markers.
Rule Details
Git conflict markers are special text sequences that Git inserts into files when it can't automatically resolve conflicts during a merge operation. These markers include:
<<<<<<<
=======
>>>>>>>
While other programming languages would typically throw syntax errors when conflict markers are present, Markdown parsers silently treat these markers as part of the text content. This leads to several problems:
- Unintended rendering: Conflict markers will be rendered visibly in the final output, creating confusion for readers.
- Broken formatting: Conflict markers can break the structure of Markdown documents and cause unexpected rendering outcomes.
- Inconsistent content: Documents with conflict markers contain both versions of the conflicted section, which is rarely the intended outcome.
This rule identifies and reports any Git conflict markers in your Markdown files to ensure they are resolved before the content is published or shared.
Examples
❌ Incorrect
Examples of incorrect code for this rule:
<!-- eslint mark/no-git-conflict-marker: "error" -->
# My Document
<<<<<<< HEAD
This is my version of the content.
=======
This is someone else's version of the content.
>>>>>>> branch-name
## Next Section
✅ Correct
Examples of correct code for this rule:
<!-- eslint mark/no-git-conflict-marker: "error" -->
# My Document
This is the resolved content.
## Next Section
Options
'mark/no-git-conflict-marker': ['error', {
skipCode: true
}]
skipCode
Default:
true
true
allows any Git conflict markers in code blocks.
AST
This rule applies to the entire document, specifically to the Root
node.