diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e5d07e8a8..fac36a0f3d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,11 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
## Unreleased
+### Fixed
+* [`no-array-index-key`]: consider flatMap ([#3530][] @k-yle)
+
+[#3530]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3530
+
## [7.32.2] - 2023.01.28
### Fixed
diff --git a/docs/rules/no-array-index-key.md b/docs/rules/no-array-index-key.md
index f9481156a2..37f2652d93 100644
--- a/docs/rules/no-array-index-key.md
+++ b/docs/rules/no-array-index-key.md
@@ -45,6 +45,10 @@ things.findIndex((thing, index) => {
otherThings.push();
});
+things.flatMap((thing, index) => (
+
+));
+
things.reduce((collection, thing, index) => (
collection.concat()
), []);
diff --git a/lib/rules/no-array-index-key.js b/lib/rules/no-array-index-key.js
index 0e641b58fb..08ecd7a6a9 100644
--- a/lib/rules/no-array-index-key.js
+++ b/lib/rules/no-array-index-key.js
@@ -65,6 +65,7 @@ module.exports = {
filter: 1,
find: 1,
findIndex: 1,
+ flatMap: 1,
forEach: 1,
map: 1,
reduce: 2,
diff --git a/tests/lib/rules/no-array-index-key.js b/tests/lib/rules/no-array-index-key.js
index e765d001ab..dc5364f47c 100644
--- a/tests/lib/rules/no-array-index-key.js
+++ b/tests/lib/rules/no-array-index-key.js
@@ -93,6 +93,9 @@ ruleTester.run('no-array-index-key', rule, {
{
code: 'foo.map((bar, i) => )',
},
+ {
+ code: 'foo.flatMap((a) => )',
+ },
{
code: 'foo.reduce((a, b) => a.concat(), [])',
},
@@ -226,6 +229,10 @@ ruleTester.run('no-array-index-key', rule, {
code: 'foo.reduce((a, b, i) => a.concat(), [])',
errors: [{ messageId: 'noArrayIndex' }],
},
+ {
+ code: 'foo.flatMap((a, i) => )',
+ errors: [{ messageId: 'noArrayIndex' }],
+ },
{
code: 'foo.reduceRight((a, b, i) => a.concat(), [])',
errors: [{ messageId: 'noArrayIndex' }],