From 53e0722d32e986b7288c6af61c60dab787e4b2c9 Mon Sep 17 00:00:00 2001 From: Chris Nakamura Date: Fri, 11 Feb 2022 08:06:45 -0600 Subject: [PATCH] [Docs] `jsx-key`: improve example Using an index for a key is a violation of the [no-array-index-key](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md) lint rule --- CHANGELOG.md | 2 ++ docs/rules/jsx-key.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54eef871b0..ff8aacd129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange * [Docs] [`forbid-foreign-prop-types`]: document `allowInPropTypes` option ([#1815][] @ljharb) * [Refactor] [`jsx-sort-default-props`]: remove unnecessary code ([#1817][] @ljharb) * [Docs] [`jsx-no-target-blank`]: fix syntax highlighting ([#3199][] @shamrin) +* [Docs] [`jsx-key`]: improve example ([#3202][] @chnakamura) +[#3202]: https://github.com/yannickcr/eslint-plugin-react/pull/3202 [#3199]: https://github.com/yannickcr/eslint-plugin-react/pull/3199 [#3198]: https://github.com/yannickcr/eslint-plugin-react/pull/3198 [#3195]: https://github.com/yannickcr/eslint-plugin-react/pull/3195 diff --git a/docs/rules/jsx-key.md b/docs/rules/jsx-key.md index 9becf034e2..6baed4c42c 100644 --- a/docs/rules/jsx-key.md +++ b/docs/rules/jsx-key.md @@ -22,7 +22,7 @@ Examples of **correct** code for this rule: ```jsx [, , ]; -data.map((x, i) => {x}); +data.map((x) => {x}); ```