[GH-ISSUE #343] Configuration : Unable to disable rules by their ID #294

Closed
opened 2026-03-03 01:25:28 +03:00 by kerem · 4 comments
Owner

Originally created by @mat-m on GitHub (Oct 17, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/343

Hello,

With vscode-markdownlint 0.37.1, and markdownlint-cli2 0.0.10, I cannot disable a rule by its ID, but only by its alias.

This is NOT OK:

{ "default": true,
  "MD025" : false
}

although this does:

{ "default": true,
  "single-title" : false
}

Is it a bug or a feature, like IDs are reserved for rules configuration ?

Originally created by @mat-m on GitHub (Oct 17, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/343 Hello, With vscode-markdownlint 0.37.1, and markdownlint-cli2 0.0.10, I cannot disable a rule by its ID, but only by its alias. This is NOT OK: ```json { "default": true, "MD025" : false } ``` although this does: ```json { "default": true, "single-title" : false } ``` Is it a bug or a feature, like IDs are reserved for rules configuration ?
kerem 2026-03-03 01:25:28 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Oct 18, 2020):

This is not expected and there are various tests that exist to make sure this works. Could you please give more information about your scenario? Is there another configuration file that is enabling that rule by name? If so, then it may not work to later disable it by number. but the simple scenario of disabling by number should definitely work.

<!-- gh-comment-id:711104111 --> @DavidAnson commented on GitHub (Oct 18, 2020): This is not expected and there are various tests that exist to make sure this works. Could you please give more information about your scenario? Is there another configuration file that is enabling that rule by name? If so, then it may not work to later disable it by number. but the simple scenario of disabling by number should definitely work.
Author
Owner

@mat-m commented on GitHub (Oct 18, 2020):

Hello,

You can try with my use case:

  • Clone https://github.com/thoughtbot/rcm.git
  • Create .markdownlint.json with contents above
  • Run markdownlint-cli2 on CONTRIBUTING.md (Contributing and Governance are both level 1)
  • Enable markdwonlint in vscode

Let me know your results

<!-- gh-comment-id:711170802 --> @mat-m commented on GitHub (Oct 18, 2020): Hello, You can try with my use case: * Clone `https://github.com/thoughtbot/rcm.git` * Create `.markdownlint.json` with contents above * Run markdownlint-cli2 on `CONTRIBUTING.md` (Contributing and Governance are both level 1) * Enable markdwonlint in vscode Let me know your results
Author
Owner

@DavidAnson commented on GitHub (Oct 18, 2020):

I see the expected behavior which is that disabling the rule by either MD025 or single-title successfully disables the rule.

pi@pi:~/mdl-343/rcm $ git remote -v
origin	https://github.com/thoughtbot/rcm.git (fetch)
origin	https://github.com/thoughtbot/rcm.git (push)
pi@pi:~/mdl-343/rcm $ git rev-parse HEAD
68fe31588ef3d31623cd0da42b410eac8a003ecb
pi@pi:~/mdl-343/rcm $ npm list --depth 0
/home/pi/mdl-343/rcm
└── markdownlint-cli2@0.0.10

pi@pi:~/mdl-343/rcm $ ./node_modules/.bin/markdownlint-cli2 CONTRIBUTING.md 
Finding: CONTRIBUTING.md
Linting: 1 file(s)
Summary: 9 error(s)
CONTRIBUTING.md:44:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]
CONTRIBUTING.md:45:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]
CONTRIBUTING.md:47:1 MD029/ol-prefix Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/2/3]
CONTRIBUTING.md:49:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 4; Style: 1/2/3]
CONTRIBUTING.md:50:1 MD029/ol-prefix Ordered list item prefix [Expected: 3; Actual: 5; Style: 1/2/3]
CONTRIBUTING.md:51:1 MD029/ol-prefix Ordered list item prefix [Expected: 4; Actual: 6; Style: 1/2/3]
CONTRIBUTING.md:65:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ make check"]
CONTRIBUTING.md:69:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ env TESTS=test/lsrc-dotfiles..."]
CONTRIBUTING.md:80 MD025/single-title/single-h1 Multiple top level headings in the same document [Context: "Governance"]
pi@pi:~/mdl-343/rcm $ nano .markdownlint.json
pi@pi:~/mdl-343/rcm $ cat .markdownlint.json 
{ "default": true,
  "single-title" : false
}
pi@pi:~/mdl-343/rcm $ ./node_modules/.bin/markdownlint-cli2 CONTRIBUTING.md 
Finding: CONTRIBUTING.md
Linting: 1 file(s)
Summary: 8 error(s)
CONTRIBUTING.md:44:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]
CONTRIBUTING.md:45:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]
CONTRIBUTING.md:47:1 MD029/ol-prefix Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/2/3]
CONTRIBUTING.md:49:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 4; Style: 1/2/3]
CONTRIBUTING.md:50:1 MD029/ol-prefix Ordered list item prefix [Expected: 3; Actual: 5; Style: 1/2/3]
CONTRIBUTING.md:51:1 MD029/ol-prefix Ordered list item prefix [Expected: 4; Actual: 6; Style: 1/2/3]
CONTRIBUTING.md:65:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ make check"]
CONTRIBUTING.md:69:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ env TESTS=test/lsrc-dotfiles..."]
pi@pi:~/mdl-343/rcm $ nano .markdownlint.json 
pi@pi:~/mdl-343/rcm $ cat .markdownlint.json 
{ "default": true,
  "MD025" : false
}
pi@pi:~/mdl-343/rcm $ ./node_modules/.bin/markdownlint-cli2 CONTRIBUTING.md 
Finding: CONTRIBUTING.md
Linting: 1 file(s)
Summary: 8 error(s)
CONTRIBUTING.md:44:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]
CONTRIBUTING.md:45:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2]
CONTRIBUTING.md:47:1 MD029/ol-prefix Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/2/3]
CONTRIBUTING.md:49:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 4; Style: 1/2/3]
CONTRIBUTING.md:50:1 MD029/ol-prefix Ordered list item prefix [Expected: 3; Actual: 5; Style: 1/2/3]
CONTRIBUTING.md:51:1 MD029/ol-prefix Ordered list item prefix [Expected: 4; Actual: 6; Style: 1/2/3]
CONTRIBUTING.md:65:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ make check"]
CONTRIBUTING.md:69:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ env TESTS=test/lsrc-dotfiles..."]
pi@pi:~/mdl-343/rcm $ code .

[Code shows the same 8 errors above; MD025 is not reported. Extension version 0.37.1]

Please have another look at your configuration. I'd guess maybe a typo crept in somewhere and it wasn't really MD025?

<!-- gh-comment-id:711421842 --> @DavidAnson commented on GitHub (Oct 18, 2020): I see the expected behavior which is that disabling the rule by either `MD025` or `single-title` successfully disables the rule. ```bash pi@pi:~/mdl-343/rcm $ git remote -v origin https://github.com/thoughtbot/rcm.git (fetch) origin https://github.com/thoughtbot/rcm.git (push) pi@pi:~/mdl-343/rcm $ git rev-parse HEAD 68fe31588ef3d31623cd0da42b410eac8a003ecb pi@pi:~/mdl-343/rcm $ npm list --depth 0 /home/pi/mdl-343/rcm └── markdownlint-cli2@0.0.10 pi@pi:~/mdl-343/rcm $ ./node_modules/.bin/markdownlint-cli2 CONTRIBUTING.md Finding: CONTRIBUTING.md Linting: 1 file(s) Summary: 9 error(s) CONTRIBUTING.md:44:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2] CONTRIBUTING.md:45:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2] CONTRIBUTING.md:47:1 MD029/ol-prefix Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/2/3] CONTRIBUTING.md:49:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 4; Style: 1/2/3] CONTRIBUTING.md:50:1 MD029/ol-prefix Ordered list item prefix [Expected: 3; Actual: 5; Style: 1/2/3] CONTRIBUTING.md:51:1 MD029/ol-prefix Ordered list item prefix [Expected: 4; Actual: 6; Style: 1/2/3] CONTRIBUTING.md:65:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ make check"] CONTRIBUTING.md:69:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ env TESTS=test/lsrc-dotfiles..."] CONTRIBUTING.md:80 MD025/single-title/single-h1 Multiple top level headings in the same document [Context: "Governance"] pi@pi:~/mdl-343/rcm $ nano .markdownlint.json pi@pi:~/mdl-343/rcm $ cat .markdownlint.json { "default": true, "single-title" : false } pi@pi:~/mdl-343/rcm $ ./node_modules/.bin/markdownlint-cli2 CONTRIBUTING.md Finding: CONTRIBUTING.md Linting: 1 file(s) Summary: 8 error(s) CONTRIBUTING.md:44:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2] CONTRIBUTING.md:45:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2] CONTRIBUTING.md:47:1 MD029/ol-prefix Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/2/3] CONTRIBUTING.md:49:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 4; Style: 1/2/3] CONTRIBUTING.md:50:1 MD029/ol-prefix Ordered list item prefix [Expected: 3; Actual: 5; Style: 1/2/3] CONTRIBUTING.md:51:1 MD029/ol-prefix Ordered list item prefix [Expected: 4; Actual: 6; Style: 1/2/3] CONTRIBUTING.md:65:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ make check"] CONTRIBUTING.md:69:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ env TESTS=test/lsrc-dotfiles..."] pi@pi:~/mdl-343/rcm $ nano .markdownlint.json pi@pi:~/mdl-343/rcm $ cat .markdownlint.json { "default": true, "MD025" : false } pi@pi:~/mdl-343/rcm $ ./node_modules/.bin/markdownlint-cli2 CONTRIBUTING.md Finding: CONTRIBUTING.md Linting: 1 file(s) Summary: 8 error(s) CONTRIBUTING.md:44:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2] CONTRIBUTING.md:45:1 MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 2] CONTRIBUTING.md:47:1 MD029/ol-prefix Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/2/3] CONTRIBUTING.md:49:1 MD029/ol-prefix Ordered list item prefix [Expected: 2; Actual: 4; Style: 1/2/3] CONTRIBUTING.md:50:1 MD029/ol-prefix Ordered list item prefix [Expected: 3; Actual: 5; Style: 1/2/3] CONTRIBUTING.md:51:1 MD029/ol-prefix Ordered list item prefix [Expected: 4; Actual: 6; Style: 1/2/3] CONTRIBUTING.md:65:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ make check"] CONTRIBUTING.md:69:5 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ env TESTS=test/lsrc-dotfiles..."] pi@pi:~/mdl-343/rcm $ code . ``` [Code shows the same 8 errors above; MD025 is not reported. Extension version `0.37.1`] Please have another look at your configuration. I'd guess maybe a typo crept in somewhere and it wasn't really `MD025`?
Author
Owner

@mat-m commented on GitHub (Oct 21, 2020):

Can't reproduce today neither.

Should have been a non-visible char or something, since pasting in this thread gave the right values.

As in the song, "It's only mystery, and I like it"

<!-- gh-comment-id:713906157 --> @mat-m commented on GitHub (Oct 21, 2020): Can't reproduce today neither. Should have been a non-visible char or something, since pasting in this thread gave the right values. As in the song, "It's only mystery, and I like it"
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#294
No description provided.