Skip to content

Commit e26ca9b

Browse files
committed
test: cover multiline jsx-sort-props line comment autofix
1 parent 05b25ec commit e26ca9b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,30 @@ ruleTester.run('jsx-sort-props', rule, {
11271127
},
11281128
],
11291129
} : [],
1130+
semver.satisfies(eslintPkg.version, '> 3') ? {
1131+
code: `
1132+
<div
1133+
onClick={() => console.log()} // Comment
1134+
className="flex"
1135+
>
1136+
<span>Problematic Component</span>
1137+
</div>
1138+
`,
1139+
output: `
1140+
<div
1141+
className="flex"
1142+
onClick={() => console.log()} // Comment
1143+
>
1144+
<span>Problematic Component</span>
1145+
</div>
1146+
`,
1147+
errors: [
1148+
{
1149+
messageId: 'sortPropsByAlpha',
1150+
line: 4,
1151+
},
1152+
],
1153+
} : [],
11301154
semver.satisfies(eslintPkg.version, '> 3') ? {
11311155
code: `
11321156
<div

0 commit comments

Comments
 (0)