MetaMask / MetaMask/eslint-config

Enforce no line length for JSDoc description blocks

Open
#283 1 comment 0 reactions 0 assignees View on GitHub
team-wallet-framework
Dominant language
JavaScript
Stars
12
Forks
21
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the repository's ESLint configuration and its existing rule tests, then check ESLint's custom-rule guidance for how JSDoc comments are parsed. Define how excessive line breaks differ from paragraph-separating breaks; done means the rule catches the reported wrapped JSDoc case without rejecting intentional paragraph breaks, with tests covering both behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.