stdlib-js / stdlib-js/stdlib

[RFC]: add JSDoc lint rule to enforce whitespace before and after dash

Abierto
#13,662 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Accepted Help Wanted RFC Tools
Lenguaje dominante
JavaScript
Estrellas
6k
Forks
1.3k
Merge medio
1 d 3 h
PR fusionados (30 d)
611

Descripción

Currently, we do not catch when the dash separating a parameter name from a parameter description is bordered by more than one whitespace character. We should enforce only one whitespace character on either side of the dash. So the following is good:

```js
/**
* ...
*
* @param {number} x - input value
* @returns {number} output value
*/
```

and the following should be disallowed

```js
/**
*
* @param {number} x - input value
* @returns {number} output value
*/
```

In principle, we could have up to three different lint rules:

1. enforce number of whitespace characters before dash
2. enforce number of whitespace characters after dash
3. enforce a specific character (e.g., `-`) to be used to separate a parameter name from a description

We could also have another lint rule for enforcing that a dash should not separate a `@returns` annotation from its description. This should likely be its own RFC.

## Notes

Ref: https://github.com/stdlib-js/stdlib/pull/13654

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start by reviewing the existing JSDoc lint rules and the behavior discussed in stdlib-js/stdlib#13654. Clarify whether this RFC covers whitespace before and after the dash only or also the other proposed rules, then identify the corresponding rule tests and make them verify the accepted and rejected examples in the issue.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.