Skip to content

Commit

Permalink
[Test] jsx-key: add a test case for optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanLee-LX committed Mar 29, 2020
1 parent 80f3826 commit bd434b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/lib/rules/jsx-key.js
Expand Up @@ -68,6 +68,9 @@ ruleTester.run('jsx-key', rule, {
}, {
code: '[1, 2 ,3].map(x => { return <App /> });',
errors: [{message: 'Missing "key" prop for element in iterator'}]
}, {
code: '[1, 2, 3]?.map(x => <App />)',
errors: [{message: 'Missing "key" prop for element in iterator'}]
}, {
code: '[1, 2, 3].map(x => <>{x}</>);',
parser: parsers.BABEL_ESLINT,
Expand Down

0 comments on commit bd434b4

Please sign in to comment.