mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #186] Support for nested config files #161
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#161
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nschonni on GitHub (May 15, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/186
Maybe this I've just been setting it up wrong, but I don't think this currently works (or maybe it's a CLI/VS Code issue). Similar to ESLint, sometimes subfolders need a separate set of rules from the root configuration.
@DavidAnson commented on GitHub (May 15, 2019):
The VS Code extension chooses the “nearest” version of
.markdownlint.json. The CLI uses a single version, either what you specify as an argument or from the current directory. The Node package uses whatever you pass in theconfigobject.Because it’s configured once and scripted, my suggestion is to make multiple passes with the CLI, ignoring directories and passing different configurations as needed to treat each set of files like you want.
Or open an issue on the CLI to match the VS Code behavior. This isn’t the first time the question has come up.
@DavidAnson commented on GitHub (May 15, 2019):
To be clear, I do not think this is the responsibility of the Node package – it just does what you tell it and is there to be used by other tools for richer scenarios like this one.
@nschonni commented on GitHub (May 15, 2019):
I took a quick search first, but didn't find anything 😊
I'm finding this come up on the MicrosoftDocs repos, because they sometimes have "legacy" docs in nested folders (or just weird subsections) they don't really want touched. I'm trying to figure out how a plain
markdownlint "**/*.md"and VS Code editing experience should work in your view.EX: Should the nested configs override a root config, or should they merge/extend? I can see both ways can be preferable to different users.
@DavidAnson commented on GitHub (May 15, 2019):
Sorry, I didn’t mean to suggest you didn’t look, just that you’re not the only one thinking about this. :) For example: https://github.com/igorshubovych/markdownlint-cli/issues/53
For the scenario you describe above, I might explore using
extendsfirst because that lets you exclude unwanted rules in just one place. DRY, but for configuration.@DavidAnson commented on GitHub (Jun 2, 2019):
Closing this issue as it does not seem to be applicable to the library and is tracked in the CLI with the issue above.