chore: avoid formatting 3rd-party license files#11867
Conversation
Not sure I follow, but this addresses the markdownlint ignore file not working properly and unintentionally formatting 3rd-party license text. I should've finished updating the PR description before posting in #11853, my bad! 😅 |
benelan
left a comment
There was a problem hiding this comment.
Nice! I have one suggestion but otherwise LGTM!
Not sure I follow, but this addresses the markdownlint ignore file not working properly and unintentionally formatting 3rd-party license text.
Woops that was my bad. I somehow misread the thread in #11853 as being about a formatting issue I noticed in the HTML table of contributors. I was just talking to myself in #11853 (comment), nothing to see here!
| export default { | ||
| config: { | ||
| $schema: | ||
| "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json", |
There was a problem hiding this comment.
The JSON Schema won't work in a JavaScript file, and since there aren't types, we won't get any completion like this. If there isn't a reason this needs to be mjs, can you change it to json?
{
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint-cli2/main/schema/markdownlint-cli2-config-schema.json",
"config": {
"first-line-heading": false,
"no-inline-html": false,
"line-length": false,
"code-block-style": {
"style": "fenced"
},
"code-fence-style": {
"style": "backtick"
},
"heading-style": {
"style": "atx"
},
"no-duplicate-heading": {
"siblings_only": true
},
"emphasis-style": {
"style": "asterisk"
},
"strong-style": {
"style": "asterisk"
},
"ul-style": {
"style": "dash"
}
},
"gitignore": true,
"ignores": ["**/THIRD-PARTY-LICENSES.md"]
}That way the options have completion and hover documentation.
There was a problem hiding this comment.
Great catch! I think I went with mjs early on when exploring options, in case I needed to extend from a base config. The schema came from the previous config. I'll make the change, thanks!
There was a problem hiding this comment.
I'll actually need to use jsonc since markdownlint-cli2 doesn't support the full range of options with json. I'll create a follow-up issue for including this extension in other linting configs/scripts.
Related Issue: N/A
Summary
Stems from #11853 (review)
This ensures that the
markdownlintignore list is used consistently across linting tasks.This was done by primarily switching from
markdownlint-clitomarkdownlint-cli2, which builds on the former and simplifies the setup.For context, the root
.markdownlintignorewasn't picked up bymarkdownlint-clibecause it must be present in thecwd. This was doable, but it meant duplicating the ignore file across packages.Notes
lint-stagedconfigs and uses.mjslint-stagedand NPM scripts--dotis the default.markdownlintignoreand--ignore-pathwas removed in favor of config options (ignoresandgitignore, respectively), which will be applied consistently.markdownlintrcto.markdownlint-cli2.mjs