Skip to content

Commit 896fe4b

Browse files
Moong0122ljharb
authored andcommitted
[Tests] jsx-indent-props : Apply indentation when used expression
Closes #1187.
1 parent b7b023f commit 896fe4b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
77

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

1313
[#2822]: https://github.com/yannickcr/eslint-plugin-react/issues/2822
14+
[#2820]: https://github.com/yannickcr/eslint-plugin-react/pull/2820
1415
[#2815]: https://github.com/yannickcr/eslint-plugin-react/pull/2815
1516
[#2808]: https://github.com/yannickcr/eslint-plugin-react/pull/2808
1617
[jsx-eslint/jsx-ast-utils#102]: https://github.com/jsx-eslint/jsx-ast-utils/pull/102

tests/lib/rules/jsx-indent-props.js

+22
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,28 @@ ruleTester.run('jsx-indent-props', rule, {
228228
{message: 'Expected indentation of 6 space characters but found 4.'},
229229
{message: 'Expected indentation of 6 space characters but found 4.'}
230230
]
231+
}, {
232+
code: [
233+
'{this.props.test',
234+
' ? <span',
235+
' className="value"',
236+
' some={{aaa}}',
237+
' />',
238+
' : null}'
239+
].join('\n'),
240+
output: [
241+
'{this.props.test',
242+
' ? <span',
243+
' className="value"',
244+
' some={{aaa}}',
245+
' />',
246+
' : null}'
247+
].join('\n'),
248+
options: [2],
249+
errors: [
250+
{message: 'Expected indentation of 6 space characters but found 4.'},
251+
{message: 'Expected indentation of 6 space characters but found 4.'}
252+
]
231253
}, {
232254
code: [
233255
'<App',

0 commit comments

Comments
 (0)