Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce no line length for JSDoc description blocks #283

Open
mcmire opened this issue Apr 12, 2023 · 1 comment
Open

Enforce no line length for JSDoc description blocks #283

mcmire opened this issue Apr 12, 2023 · 1 comment

Comments

@mcmire
Copy link
Contributor

mcmire commented Apr 12, 2023

Some of us (馃馃徎) are used to wrapping code at 80 characters and apply this line wrapping to JSDocs as well.

Unfortunately the JSDoc interpreter part of the language server renders line breaks literally, and may cause params, properties, etc. to not get rendered appropriately.

For instance, notice how the @returns line is missing an em-dash:

Screenshot 2023-04-12 at 9 37 38 AM

This happens because @returns is wrapped at 80 characters. However, if we don't do that, then we get this:

Screenshot 2023-04-12 at 9 37 46 AM

It would be nice if we could figure out some way of enforcing no excessive line breaks in JSDocs. This would likely have to be a custom rule due to line breaks being necessary to separate paragraphs, etc.

@mcmire
Copy link
Contributor Author

mcmire commented Dec 3, 2023

Counterargument to adding this rule: VSCode's TypeScript integration does not seem to wrap JSDoc blocks in popovers. Wrapped descriptions, at the very least, are easier to read than unwrapped descriptions. Therefore while enforcing that JSDoc blocks are unwrapped would make them look consistent, it would also reduce readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant