Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for nested config files #186

Closed
nschonni opened this issue May 15, 2019 · 5 comments
Closed

Support for nested config files #186

nschonni opened this issue May 15, 2019 · 5 comments
Labels

Comments

@nschonni
Copy link
Contributor

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.

  • .markdownlint.json
  • docs
    • new docs
    • old docs
      • .markdownlint.json (to turn off some rules)
@DavidAnson
Copy link
Owner

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 the config object.

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
Copy link
Owner

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
Copy link
Contributor Author

nschonni commented May 15, 2019

This isn’t the first time the question has come up.

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
Copy link
Owner

Sorry, I didn’t mean to suggest you didn’t look, just that you’re not the only one thinking about this. :) For example: igorshubovych/markdownlint-cli#53

For the scenario you describe above, I might explore using extends first because that lets you exclude unwanted rules in just one place. DRY, but for configuration.

@DavidAnson
Copy link
Owner

Closing this issue as it does not seem to be applicable to the library and is tracked in the CLI with the issue above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants