eslint-plugin-jsdoc icon indicating copy to clipboard operation
eslint-plugin-jsdoc copied to clipboard

Automatic Line Breaks

Open Zamiell opened this issue 2 years ago • 2 comments

Prettier automatically breaks up long lines of code. This is fantastic, and saves developers tremendous amounts of time. Anyone who has used Prettier for a while knows how much of a drain it is to do this manually.

However, Prettier doesn't currently break up long lines on JSDoc comments.

For example, the following JSDoc comment:

image

Should be instead formatted like this:

image

If this plugin could perform this transformation for me automatically when I save the file, it would save me an enormous amount of time.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Zamiell avatar Mar 11 '22 17:03 Zamiell

I made this rule here: https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-plugin-isaacscript/docs/rules/format-jsdoc-comments.md

Zamiell avatar Oct 04 '22 23:10 Zamiell

Excellent! Feel free to submit your tool to awesome-jsdoc and awesome-eslint and/or submit as a PR to eslint-plugin-jsdoc. If not the latter, feel free to close the issue. Thanks for sharing!

brettz9 avatar Oct 06 '22 02:10 brettz9

It's probably not a good fit for JSDoc since it uses the same code to auto format line comments too.

Zamiell avatar Oct 17 '22 20:10 Zamiell

Ok, FWIW, I've listed your tool at https://github.com/brettz9/awesome-jsdoc

brettz9 avatar Oct 17 '22 23:10 brettz9