lasselupe33 / eslint-plugin-comment-length

MIT License
14 stars 3 forks source link

Format comments as Markdown? (bullets, numbered lists, code blocks) #13

Open karlhorky opened 1 month ago

karlhorky commented 1 month ago

Hi @lasselupe33 - first of all, thanks for your effort creating and maintaining this ESLint plugin! Great to have more energy being put into tooling that hard wraps comments 🙌

I have been using the Rewrap VS Code extension (GitHub, docs), which offers many wrapping features.

One that may be interesting for eslint-plugin-comment-length is the ability to treat comments as Markdown, and wrap / format accordingly:

The contents of comments are usually parsed as markdown, so you can use lists, code samples (which are untouched) etc:

example1

Note that:

  1. The content of the bulleted list items are wrapped, aligning the left edge of the text as Markdown formatters do
    1. This also applies to numbered lists
  2. The indented code block is not wrapped
    1. In addition to indentation, code blocks can also be created in Markdown by adding a line with ``` before and after (which I believe that eslint-plugin-comment-length already supports)
lasselupe33 commented 3 weeks ago

Hi @karlhorky, thanks for the kind words!

Good point, it seems that a Markdown formatter may make a lot of sense, and it would solve several cases that are currently handled through custom rules/formatters.

At the moment I do not have the resources to implement additional features into this plugin, but I will come back to this issue in the future as it does seem like a sound idea. :)