Skip to content

Commit 4e5ee2a

Browse files
committed
added and edited test cases in jsx-indent.js invalid:
1 parent b01968c commit 4e5ee2a

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

tests/lib/rules/jsx-indent.js

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,8 @@ const Component = () => (
30493049
},
30503050
],
30513051
},
3052-
semver.satisfies(eslintVersion, '<= 5') ? {
3052+
// Would be nice to handle in one pass, but multipass works fine.
3053+
{
30533054
code: `
30543055
const IndexPage = () => (
30553056
<h1>
@@ -3058,12 +3059,12 @@ const Component = () => (
30583059
</h1>
30593060
);
30603061
`,
3061-
features: ['fragment'],
3062+
30623063
output: `
30633064
const IndexPage = () => (
30643065
<h1>
30653066
Hi people
3066-
<button/>
3067+
<button/>
30673068
</h1>
30683069
);
30693070
`,
@@ -3097,7 +3098,38 @@ const Component = () => (
30973098
},
30983099
},
30993100
],
3100-
}: [],
3101+
},
3102+
{
3103+
code: `
3104+
const IndexPage = () => (
3105+
<h1>
3106+
Hi people
3107+
<button/>
3108+
</h1>
3109+
);
3110+
`,
3111+
3112+
output: `
3113+
const IndexPage = () => (
3114+
<h1>
3115+
Hi people
3116+
<button/>
3117+
</h1>
3118+
);
3119+
`,
3120+
options:[2],
3121+
errors: [
3122+
{
3123+
messageId: 'wrongIndent',
3124+
data: {
3125+
needed: 12,
3126+
type: 'space',
3127+
characters: 'characters',
3128+
gotten: 8,
3129+
},
3130+
},
3131+
],
3132+
},
31013133
semver.satisfies(eslintVersion, '> 4') ? {
31023134
code: `
31033135
import React from 'react';

0 commit comments

Comments
 (0)