coc-markdownlint icon indicating copy to clipboard operation
coc-markdownlint copied to clipboard

Request: Add line length autofix

Open ManuelGarciaF opened this issue 4 years ago • 3 comments

It would be nice if autofix split lines to the corrrect length.

ManuelGarciaF avatar Jun 23 '20 15:06 ManuelGarciaF

Just for anyone looking into this thinking maybe they got something wrong with their configurations: this extension does not currently support automatically splitting lines to fix line length limits.

I’d be real happy to try and look into this, since I personally spent a few hours trying to get this result. @fannheyward any place you’d suggest looking into first? That’d be a big help

oxfist avatar Aug 07 '21 04:08 oxfist

@ManuelGarciaF my current workaround for this was to setup Prettier to work on Markdown files and then configure Prettier to run under ESLint by extending plugin:md/prettier in my .eslintrc.json. I haven’t checked if adding specific Markdown configs in my .prettierrc.json was completely necessary, but this is currently doing the line splitting when I save:

{
  "proseWrap": "always",
  "overrides": [
    {
      "files": ["*.md"],
      "parser": "markdown-eslint-parser",
      "rules": {
        "prettier/prettier": [
          "error",
          {
            "parser": "markdown"
          }
        ]
      }
    }
  ]
}

proseWrap does the actual trick, hope it works for you! 👍

oxfist avatar Aug 07 '21 17:08 oxfist

I used an advice from here. It works in vim without any extra dependencies.

skalinets avatar Apr 08 '22 14:04 skalinets