-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce markdown lint * Add extension to devcontainer.json * Organize rule configuration * try introducing CI step * Configure formatter * Just add similar to eslint * update config * Fix: MD001/heading-increment/header-increment Heading levels should only increment by one level at a time * fix: MD030/list-marker-space Spaces after list markers * fix: MD040/fenced-code-language Fenced code blocks should have a language specified * Fix: MD051/link-fragments Link fragments should be valid * Create rules to enforce eventualy * Fix: no-emphasis-as-heading/no-emphasis-as-header Emphasis used instead of a heading * fix: MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines * Disable stylistic rule * Add TODO * Add note in config * fix: GH002/no-generic-link-text Avoid using generic link text like or : * update config * Add exceptions for Link for generic text * Update to @joshblack suggestion * Update CONTRIBUTING.md
- Loading branch information
Showing
33 changed files
with
751 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const githubMarkdownOpinions = require('@github/markdownlint-github') | ||
|
||
// Rules we want to turn on but currently have too many violations | ||
const rulesToEnforce = { | ||
'fenced-code-language': false, | ||
'no-duplicate-header': false, // Fix https://github.com/primer/doctocat/issues/527, then set this rule to `siblings_only: true` | ||
} | ||
// Rules we don't care to enforce (usually stylistic) | ||
const rulesToNotEnforce = { | ||
'line-length': false, | ||
'blanks-around-headings': false, | ||
'blanks-around-lists': false, | ||
'no-trailing-spaces': false, | ||
'no-multiple-blanks': false, | ||
'no-trailing-punctuation': false, | ||
'single-trailing-newline': false, | ||
'ul-indent': false, | ||
'no-hard-tabs': false, | ||
'first-line-heading': false, | ||
'no-space-in-emphasis': false, | ||
'blanks-around-fences': false, | ||
} | ||
|
||
const defaultOverrides = { | ||
'no-generic-link-text': {exceptions: ['link']}, // We don't want it to flag links that link to `Link` component. | ||
} | ||
|
||
const options = githubMarkdownOpinions.init({...rulesToNotEnforce, ...rulesToEnforce, ...defaultOverrides}) | ||
module.exports = { | ||
config: options, | ||
customRules: ['@github/markdownlint-github'], | ||
outputFormatters: [ | ||
['markdownlint-cli2-formatter-pretty', {appendLink: true}], // ensures the error message includes a link to the rule documentation | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.