airbnb / airbnb/javascript

Documentation conflicts with object-property-newline setting?

オープン
#2,007 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る
pull request wanted
主要言語
JavaScript
スター
148k
フォーク
26.6k
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

packages/eslint-config-airbnb-base/rules/style.js の object-property-newline 設定から始め、続いてそのオプションを style guide の関連する functions、arrays、object セクションと比較します。style guide でこのオプションを説明すべきか、それとも設定を一貫させるべきかを判断し、選択した動作とその理由を文書化します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
eslint, javascript
領域
documentation, tooling
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。