Skip to content

Commit

Permalink
[Tests] jsx-indent-props : Apply indentation when used expression
Browse files Browse the repository at this point in the history
Closes #1187.
  • Loading branch information
Moong0122 authored and ljharb committed Oct 4, 2020
1 parent b7b023f commit 896fe4b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
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

0 comments on commit 896fe4b

Please sign in to comment.