Skip to content

Commit 7c36070

Browse files
committed
[fix] resolve uncovered lines: modify some tests
1 parent 446dc74 commit 7c36070

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

docs/rules/jsx-closing-tag-location.md

-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Examples of **correct** code for this rule:
3535
<Hello>marklar</Hello>
3636
```
3737

38-
3938
## Rule Options
4039

4140
There is one way to configure this rule.
@@ -110,7 +109,6 @@ const App = <Bar>
110109
Foo
111110
</Bar>;
112111

113-
114112
```
115113

116114
## When Not To Use It

lib/rules/jsx-closing-tag-location.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,8 @@ module.exports = {
7070
}
7171

7272
function getIndentation(openingStartOfLine, opening) {
73-
switch (option) {
74-
case 'line-aligned':
75-
return openingStartOfLine.column + 1;
76-
case 'tag-aligned':
77-
return opening.loc.start.column + 1;
78-
default:
79-
return null;
80-
}
73+
if (option === 'line-aligned') return openingStartOfLine.column + 1;
74+
if (option === 'tag-aligned') return opening.loc.start.column + 1;
8175
}
8276

8377
function handleClosingElement(node) {

tests/lib/rules/jsx-closing-tag-location.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ruleTester.run('jsx-closing-tag-location', rule, {
3636
bar</App>
3737
}
3838
`,
39-
options: ['line-aligned'],
39+
options: [{ location: 'line-aligned' }],
4040
},
4141
{
4242
code: `
@@ -95,6 +95,14 @@ ruleTester.run('jsx-closing-tag-location', rule, {
9595
</App>
9696
`,
9797
},
98+
{
99+
code: `
100+
<App>
101+
foo
102+
</App>
103+
`,
104+
options: ['line-aligned'],
105+
},
98106
{
99107
code: `
100108
<App>foo</App>

0 commit comments

Comments
 (0)