igorshubovych / markdownlint-cli

MarkdownLint Command Line Interface
MIT License
843 stars 84 forks source link

Overrides field #53

Open cdfa opened 5 years ago

cdfa commented 5 years ago

I think it would be great to specify config overrides for certain files (like overrides in eslint and prettier). I don't think this should be implement in the markdownlint library, because it's easier to do this overriding manually when using the API, but it would be nice if the CLI would support it in some way.

DavidAnson commented 5 years ago

Relevant example: https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files

DavidAnson commented 5 years ago

@cdfa, in case you are not aware, when using the VS Code extension, it will allow a config file in subdirectories as well as the root of the project. That can be used to customize settings for an entire subdirectory of files. Would that work for your purposes?

cdfa commented 5 years ago

Sadly not, I need a different configuration for .mdx files (specifically: disabling the forbidden html tag rule)

DavidAnson commented 5 years ago

Would it work to run the CLI in two separate passes? The first for .md and the second for .mdx (with slightly different settings)?

cdfa commented 5 years ago

Yes, I have a mdx only config and passing that using the --config option, but I can't make it "inherit" the default .md config.

DavidAnson commented 5 years ago

To inherit rules, have you looked at extends? https://github.com/DavidAnson/markdownlint/blob/master/README.md#optionsconfig

cdfa commented 5 years ago

Ah, that makes my case possible. I still think it would be convenient to not have to pass the specific config for every extension, but this works. Thank you!

DavidAnson commented 5 years ago

Cool. I’ll leave this open here for the future, but glad you’re unblocked now!