question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

linter keeps indenting list to 4 chars

See original GitHub issue

Hello.

Despite my config:

    "markdownlint.config": {
        "list-marker-space": {
            "ul_single": 1,
            "ol_single": 1,
            "ul_multi": 1,
            "ol_multi": 1
        }
    }

saying to indent all lists to 1 characters, the linter automatically reindent all list to 4 chars:

- a
- b
- c

is transformed to:

-    a
-    b
-    c

The linter complains: MD030/list-marker-space: Spaces after list markers [Expected: 1; Actual: 3] markdownlint(MD030)

Cannot find a way to disable this automatic realignment. Disabling the extension do stop the auto reindent.

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, Jun 15, 2019

I am unable to reproduce this behavior.

VS Code supports “format on save” for language extensions (that’s what vscode-formatting-toggle enables), but markdownlint is not a language extension. I’ve verified that “format on save” does not apply to the auto-fix code actions that markdownlint does offer, so that should not be relevant here.

Furthermore, markdownlint in the configuration you show above does not report any lint violations for the sample you show above - which means it won’t offer any auto-fix actions anyway. As you note, markdownlint doesn’t report a violation until after the edit is applied.

Furthermore, MD030 is not even one of the rules that markdownlint offers auto-fixes for!

Could you please try disabling all VS Code extensions, then enabling only markdownlint and confirm that it reports no lint issues for your scenario above? Then enable formatting and let me know if you see the problem? If so, please let me know your VS Code version and send a screenshot of the Extensions panel in VS Code.

Thanks!

PS - Here’s my test environment:

C:\T\Issue79>type .vscode\settings.json
{
    "markdownlint.config": {
        "list-marker-space": {
            "ul_single": 1,
            "ol_single": 1,
            "ul_multi": 1,
            "ol_multi": 1
        }
    },
    "editor.formatOnSave": true
}
C:\T\Issue79>type issue79.md
# Issue 79

- a
- b
- c

C:\T\Issue79>
0reactions
ringodotnlcommented, Mar 30, 2021

@andfinally I couldn’t find ‘disable languages’ but adding file .prettierignore in the root with content *.md seems to work fine as well.

Cheers, Ringo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eslint expected indentation of 1 tab but found 4 spaces error
It is my first time using a linter. I keep getting this linting error when using a tab as indentation: severity: 'Error' message:...
Read more >
Fix Numbered List Line Indentation On Microsoft Word
This tutorial will show you how to quickly fix that pesky indentation problem of too much space once you get to line number...
Read more >
The Black code style - Black 22.12.0 documentation
How Black wraps lines#. Black ignores previous formatting and applies uniform horizontal and vertical whitespace to your code. The rules for horizontal ...
Read more >
Configuration · Scalafmt - Scalameta
This parameter defines additional indentation used for the post-comma elements of an extends A, B or derives A, B sequences of a template....
Read more >
Linters | golangci-lint
Name Description Presets Since asasalint ⚙️ check for pass any as any in variadic func(...any) bugs 1.47.0 bidichk ⚙️ Checks for dangerous unicode character sequences...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found