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

Allow extension to override location of CLI2 options file (--config) #366

Open
monkey-knuckles opened this issue Jan 27, 2025 · 3 comments

Comments

@monkey-knuckles
Copy link

I very nearly have set up my workflow exactly how it needs to be. I thought markdownlint-cli2 was working correctly. And when run manually and on the pipeline it does work.

My .markdownlint-cli2.jsonc is located in .config from the root directory of my project.

VSC does not seem to be picking up the config file when it is stored in the .config folder.

I have this in my settings.json.

"markdownlint.config": {
  "extends": ".config/.markdownlint-cli2.jsonc"
}

This does not seem to make a difference. I'm sure have had this working in the past. What confuses things even more is that If I set up a blank project with only a 'test.md' and nothing else, it will pick up some errors.

For example, it will show MD051 but not MD013. But even without a config file it should be reporting rule MD013 has ben violated 80 character max limit. And when it uses my config it should report MD013 120-character limit.

But either way it should be reporting MD013 out of the box. I'm sure I had this working in the past. I'm using the latest versions on a clean VM.

Thanks again for your time.

@monkey-knuckles
Copy link
Author

I'm thinking I should have posted this under the plugin page as I don't it doesn't appear to be a markdown-lint-cli2 problem but more to do with the IDE.

@DavidAnson DavidAnson transferred this issue from DavidAnson/markdownlint-cli2 Jan 27, 2025
@DavidAnson
Copy link
Owner

The technique you are using to change the location of the configuration file only works for .markdownlint.* and not .markdownlint-cli2.*. This is for historical reasons because that setting predates CLI2 entirely (and also because the setting you are using is within a config object). I would prefer to have as few extension settings as possible, but I can’t come up with a strong argument against this one, so I will look at adding this soon.

@DavidAnson DavidAnson changed the title Alternate location Allow extension to override location of CLI2 options file (--config) Jan 27, 2025
@monkey-knuckles
Copy link
Author

Thanks. I need to use cli2 because of the custom rules, but on the other hand, I need the standard version so I can use the config file inside VSC. As it is now I have to keep a copy of the settings in my settings.json.

At least I'm not going mad. Thanks, man

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

No branches or pull requests

2 participants