Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[closes] jsx-one-expression-per-line fix option inserts blank lines #2799

Merged
merged 1 commit into from Sep 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -21,7 +21,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
* [`jsx-handler-names`]: false positive when handler name begins with number ([#1689][] @jsphstls)
* [`prop-types`]: Detect JSX returned by sequential expression ([#2801][] @mikol)

### Changed
* [Tests] [`jsx-one-expression-per-line`]: add passing tests ([#2799][] @TaLeaMonet)

[#2801]: https://github.com/yannickcr/eslint-plugin-react/pull/2801
[#2799]: https://github.com/yannickcr/eslint-plugin-react/pull/2799
[#2796]: https://github.com/yannickcr/eslint-plugin-react/pull/2796
[#2791]: https://github.com/yannickcr/eslint-plugin-react/pull/2791
[#2789]: https://github.com/yannickcr/eslint-plugin-react/pull/2789
Expand Down
23 changes: 23 additions & 0 deletions tests/lib/rules/jsx-one-expression-per-line.js
Expand Up @@ -1029,5 +1029,28 @@ ruleTester.run('jsx-one-expression-per-line', rule, {
errors: [{message: '`Foo` must be placed on a new line'}],
parser: parsers.BABEL_ESLINT,
parserOptions
}, {
code: [
'<div>',
'<MyComponent>a</MyComponent>',
'<MyOther>{a}</MyOther>',
'</div>'
].join('\n'),
output: [
'<div>',
'<MyComponent>',
'a',
'</MyComponent>',
'<MyOther>',
'{a}',
'</MyOther>',
'</div>'
].join('\n'),
errors: [
{message: '`a` must be placed on a new line'},
{message: '`{a}` must be placed on a new line'}
],
parser: parsers.BABEL_ESLINT,
parserOptions
}]
});