File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
8
8
### Fixed
9
9
* [ ` jsx-curly-brace-presence ` ] : avoid warning on curlies containing quote characters ([ #3214 ] [ ] @ljharb )
10
10
* [ ` jsx-indent ` ] : do not report on non-jsx-returning ternaries that contain null ([ #3222 ] [ ] @ljharb )
11
+ * [ ` jsx-indent ` ] : properly report on returned ternaries with jsx ([ #3222 ] [ ] @ljharb )
11
12
12
13
[ #3222 ] : https://github.com/yannickcr/eslint-plugin-react/issues/3222
13
14
[ #3214 ] : https://github.com/yannickcr/eslint-plugin-react/issues/3214
Original file line number Diff line number Diff line change @@ -415,7 +415,10 @@ module.exports = {
415
415
JSXText : handleLiteral ,
416
416
417
417
ReturnStatement ( node ) {
418
- if ( ! node . parent ) {
418
+ if (
419
+ ! node . parent
420
+ || ! jsxUtil . isJSX ( node . argument )
421
+ ) {
419
422
return ;
420
423
}
421
424
Original file line number Diff line number Diff line change @@ -1219,6 +1219,16 @@ const Component = () => (
1219
1219
` ,
1220
1220
options : [ 99 ] ,
1221
1221
} ,
1222
+ {
1223
+ code : `
1224
+ function test (foo) {
1225
+ return foo != null
1226
+ ? <div>foo</div>
1227
+ : <div>bar</div>
1228
+ }
1229
+ ` ,
1230
+ options : [ 2 ] ,
1231
+ } ,
1222
1232
] ) ,
1223
1233
1224
1234
invalid : parsers . all ( [ ] . concat (
You can’t perform that action at this time.
0 commit comments