Skip to content

Inconsistent behavior between rule ID (MD013) and rule name (line-length) in config overrides #401

@jotabe-net

Description

@jotabe-net

I'm encountering a confusing behavior when configuring markdownlint in VS Code using both workspace and user settings.

In my user settings, I had:

"markdownlint.config": {
  "line-length": {
    "line_length": 80,
    "code_blocks": false,
    "stern": false,
    "tables": false
  }
}

In my workspace settings, I tried to disable the rule using:

"markdownlint.config": {
  "MD013": false
}

Despite the workspace setting, the rule was still being applied. After investigation, I realized that, for overriding rules, "MD013" and "line-length" are treated as distinct keys, even though they refer to the same rule.

If I change the workspace to "MD013" or the global "line-length" to "MD013" they are correctly overridden.

I was encountering some other weird behavior, for ex. if i included this in workspace settings.json:
"markdownlint.configFile": ".markdownlint-cli2.jsonc",
the workspace settings did override the "MD013".

I think that making the long and short names equivalente for overriding would solve all the quirks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions