Skip to content

Commit 08eda7a

Browse files
TaLeaMonetljharb
authored andcommitted
[Tests] jsx-one-expression-per-line: add passing tests.
Closes #1835.
1 parent 74c4eed commit 08eda7a

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
2121
* [`jsx-handler-names`]: false positive when handler name begins with number ([#1689][] @jsphstls)
2222
* [`prop-types`]: Detect JSX returned by sequential expression ([#2801][] @mikol)
2323

24+
### Changed
25+
* [Tests] [`jsx-one-expression-per-line`]: add passing tests ([#2799][] @TaLeaMonet)
26+
2427
[#2801]: https://github.com/yannickcr/eslint-plugin-react/pull/2801
28+
[#2799]: https://github.com/yannickcr/eslint-plugin-react/pull/2799
2529
[#2796]: https://github.com/yannickcr/eslint-plugin-react/pull/2796
2630
[#2791]: https://github.com/yannickcr/eslint-plugin-react/pull/2791
2731
[#2789]: https://github.com/yannickcr/eslint-plugin-react/pull/2789

tests/lib/rules/jsx-one-expression-per-line.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,5 +1029,28 @@ ruleTester.run('jsx-one-expression-per-line', rule, {
10291029
errors: [{message: '`Foo` must be placed on a new line'}],
10301030
parser: parsers.BABEL_ESLINT,
10311031
parserOptions
1032+
}, {
1033+
code: [
1034+
'<div>',
1035+
'<MyComponent>a</MyComponent>',
1036+
'<MyOther>{a}</MyOther>',
1037+
'</div>'
1038+
].join('\n'),
1039+
output: [
1040+
'<div>',
1041+
'<MyComponent>',
1042+
'a',
1043+
'</MyComponent>',
1044+
'<MyOther>',
1045+
'{a}',
1046+
'</MyOther>',
1047+
'</div>'
1048+
].join('\n'),
1049+
errors: [
1050+
{message: '`a` must be placed on a new line'},
1051+
{message: '`{a}` must be placed on a new line'}
1052+
],
1053+
parser: parsers.BABEL_ESLINT,
1054+
parserOptions
10321055
}]
10331056
});

0 commit comments

Comments
 (0)