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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update eslint-plugin-react 7.1 => 7.2 #100

Closed
kanufy opened this issue Aug 14, 2017 · 5 comments · Fixed by #102
Closed

update eslint-plugin-react 7.1 => 7.2 #100

kanufy opened this issue Aug 14, 2017 · 5 comments · Fixed by #102
Labels

Comments

@kanufy
Copy link
Contributor

kanufy commented Aug 14, 2017

リリースノート
https://github.com/yannickcr/eslint-plugin-react/releases

rule追加いくつか

@kanufy kanufy added the A-rules label Aug 14, 2017
@kanufy
Copy link
Contributor Author

kanufy commented Aug 14, 2017

ざっとrule確認

new rules

  • no-unused-state docsがないミスのissueは概出
    • あってよさそうかな
    • warnくらいで
  • boolean-prop-naming
    • propの名前でboolean強要
    • オプション設定を正規表現とかでやりだすのもなって感じなのでいらなそう
  • no-typos
    • いらなそう...

add options

  • auto fix for jsx-sort-props
    • 特に影響はない
    • 設定も現状のままでよさそう 'react/jsx-sort-props': 0,
  • getters and setters groups to sort-comp
    • そこまで強い気持ちないしそのままでいいかなとおもっている(getters, settersはdefaultでは指定されてない)
    • もし入れるなら適切な場所はみんなで決めたさがある
  • noStrings option to jsx-no-literals
    • 結構強いなーとおもうのでここまでせんでもいいかなという印象
    • 現状のまま( 'react/jsx-no-literals': 1, )で良いんじゃなかろうか
  • inverse option for always/never to jsx-boolean-value
    • 例外的なのはプロダクト毎に設定すべきだしそのまま( 'react/jsx-boolean-value': [2, 'always'], )でいいかな

@kanufy
Copy link
Contributor Author

kanufy commented Aug 14, 2017

@nekoya こんな感じかなーと思うんですが、どうでしょう?

@nekoya
Copy link
Member

nekoya commented Aug 15, 2017

設定内容全般については、自分もそれでいいかなと思います。

boolean-prop-naming

propの名前でboolean強要

日本語でぉkという感じなので、少し補足すると

  • booleanの場合だけそんなに強く制約するのはいかがなものか
  • サンプルでいくとcanHogeとかshouldFooとかもエラーになってお節介すぎる
  • プロジェクト内で好きにする分には構わないが�、ここで採用するものではない

てことで採用しなくてよいと思います。

no-typos

「これLintの仕事なの?」というのが率直な印象なので、同じく不要かなと思う。

ただ、我々はそもそもReact.Componentをextendsしてクラス宣言せずに、常にstateless componentでやっているので、他の声も聞いてみたい気はする。

@himu62 どう?

@himu62
Copy link
Contributor

himu62 commented Aug 17, 2017

全体的に良さそうです
理由に関しても同意です〜

@kanufy
Copy link
Contributor Author

kanufy commented Aug 17, 2017

OK.

これもさくっとあげてしまおう。
あとはeslint本体だな...

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

Successfully merging a pull request may close this issue.

3 participants