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

[Tests] jsx-indent-props : Apply indentation when used expression #2820

Merged
merged 1 commit into from Oct 9, 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -7,10 +7,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel

### Fixed
* [`no-unused-prop-types`]: Silence false positive on `never` type in TS ([#2815][] @pcorpet)
* [`jsx-indent-props`]: Apply indentation when operator is used in front of the upper line ([#2808][] @Moong0122)
* [`jsx-indent-props`]: Apply indentation when operator is used in front of the upper line ([#2808][], [#2820][] @Moong0122)
* [Deps] update `jsx-ast-utils` ([#2822][] [jsx-eslint/jsx-ast-utils#102][] @ljharb)

[#2822]: https://github.com/yannickcr/eslint-plugin-react/issues/2822
[#2820]: https://github.com/yannickcr/eslint-plugin-react/pull/2820
[#2815]: https://github.com/yannickcr/eslint-plugin-react/pull/2815
[#2808]: https://github.com/yannickcr/eslint-plugin-react/pull/2808
[jsx-eslint/jsx-ast-utils#102]: https://github.com/jsx-eslint/jsx-ast-utils/pull/102
Expand Down
22 changes: 22 additions & 0 deletions tests/lib/rules/jsx-indent-props.js
Expand Up @@ -228,6 +228,28 @@ ruleTester.run('jsx-indent-props', rule, {
{message: 'Expected indentation of 6 space characters but found 4.'},
{message: 'Expected indentation of 6 space characters but found 4.'}
]
}, {
code: [
'{this.props.test',
' ? <span',
' className="value"',
' some={{aaa}}',
' />',
' : null}'
].join('\n'),
output: [
'{this.props.test',
' ? <span',
' className="value"',
' some={{aaa}}',
' />',
' : null}'
].join('\n'),
options: [2],
errors: [
{message: 'Expected indentation of 6 space characters but found 4.'},
{message: 'Expected indentation of 6 space characters but found 4.'}
]
}, {
code: [
'<App',
Expand Down