airbnb / airbnb/javascript

Documentation conflicts with object-property-newline setting?

Ouverte
#2,007 5 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
pull request wanted
Langage dominant
JavaScript
Étoiles
148k
Forks
26.6k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

It seems like the documentation consistently promotes having a new line for each item in multiline lists, whether it be in a [function invocation](https://github.com/airbnb/javascript#functions--signature-invocation-indentation) or in [an array](https://github.com/airbnb/javascript#arrays--bracket-newline) (both of which mention bad examples of not having each item on a new line).

And even the [object examples](https://github.com/airbnb/javascript#objects--quoted-props) (although not referring to this specific rule) seem to favor this approach.

With that said, what is the reasoning behind [allowing object properties to all appear on the same line](https://github.com/airbnb/javascript/blob/17e0454672f784772c5f5ab052523a93229d9adf/packages/eslint-config-airbnb-base/rules/style.js#L406)?

It would seem more consistent to remove that option for `object-property-newline`. But at the very least, the reasoning and/or use case should probably be documented.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par packages/eslint-config-airbnb-base/rules/style.js, au niveau de la configuration object-property-newline, puis comparez son option avec les sections liées functions, arrays et object du guide de style. Déterminez si le guide de style doit expliquer l'option ou si la configuration doit être rendue cohérente, puis documentez le comportement retenu et sa justification.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
eslint, javascript
Domaine
documentation, tooling
Type d'issue
Documentation
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.