Closed simensol closed 1 year ago
You're mixing two things here. :) In the library, all rules default to enabled and that property can be used to default them all to disabled. It works for that purpose as you demonstrate. In the VS Code plug-in, the MD013 rule is disabled by default to avoid being distracting in documents that have many long lines. However, if you manually configure all rules to be enabled as you are doing, then MD013 is enabled as well and it will report issues as you see.
It makes perfectly sense! Thanks for explaining :)
If MD013
is disabled by default, an empty .markdownlint.jsonc
shouldn't report any MD013
issues, right? When I have this .markdownlint.jsonc
:
{
}
markdownlint raises MD013
and I have to set
{
"MD013": false
}
to make the linting errors disappear.
From what I can tell, reading the code on my phone, the extension is doing the expected thing by passing MD013:false
to CLI2 as the default. However, CLI2 behavior (by design) is that any .markdownlint.json
file replaces whatever configuration was present up to that point and so the empty configuration there takes over and all rules start enabled.
I don't think this is something I want to change because this notion of "custom default" is only used by the extension to avoid scaring new people away or making long-lined projects unfriendly. Once someone has created their own configuration file, the assumption is that they will use it to configure things however they like.
A project should lint consistently for users of the extension, CLI2, CLI, etc. and propagating this editor default would break that by toggling MD013 "randomly" for users.
Thanks for explaining—again it makes perfectly sense :) I guess I got confused by the "default rule configuration" sentence, and I didn't grasp (until now) that an empty .markdownlint.json
actually replaces any "default rule configuration".
No worries. There are other behaviors that make sense as well, but this is the behavior I ended up with. :)
According to the documentation:
However, if I create the following
.markdownlint.jsonc
file:markdownlint still complains about
MD013/line-length
. If I change the.markdownlint.jsonc
file to:the linting error disappears. It seems that the
"default": true
in.markdownlint.jsonc
is not respected?