3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ESLintのエラーをまとめてみた Part1

Posted at

今回発生したエラー

  • error Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
  • error Assignment to property of function parameter 'target' no-param-reassign
  • error Do not use Array index in keys react/no-array-index-key
  • error Prop type object is forbidden react/forbid-prop-types
  • error componentWillReceiveProps is deprecated since React 16.3.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops react/no-deprecated
  • error propTypes should be placed after trackPage react/sort-comp

Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank

  • 意味:rel="noopener noreferrer"を追加しましょう
  • Qiita:https://qiita.com/togana/items/e739e1ec943862a71757
  • やったこと: <a>の中にrel="noreferrer noopener"を追加
  • 効果:リファラー(ユーザーのサイト内での動き)情報を簡単に解析されないようにする。

Assignment to property of function parameter 'target' no-param-reassign

Do not use Array index in keys react/no-array-index-key

  • 意味:キーに配列要素を使わないでください
  • やったこと:キーの変更

Prop type object is forbidden react/forbid-prop-types

- 意味:objectを使わないでください
- やったこと:objectの変更

componentWillReceiveProps is deprecated since React 16.3.0, use UNSAFE_componentWillReceiveProps instead, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops react/no-deprecated

  • 意味:React16:30だと、 componentWillReceivePropsは廃止するから、UNSAFE_componentWillReceivePropsを使ってほしい。
  • やったこと:上記

propTypes should be placed after trackPage react/sort-comp

  • 意味:propTypstrackPageのあとに置いてください
  • やったこと:場所の入れ替え
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?