Skip to content

Commit 3ab0e0b

Browse files
committed
Fixed autofix to proper order
Fixed autofix to proper order
1 parent 530c049 commit 3ab0e0b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/stencil-library/src/eslint-plugin/__tests__/no-label-slot-in-checkbox.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ruleTester.run("no-label-slot-in-checkbox", noLabelSlotInCheckbox, {
2121
{
2222
code: "<dnn-checkbox onClick={e => console.log(e)}><label>Label Text</label></dnn-checkbox>",
2323
errors: [{ messageId: "noLabelSlotInCheckbox" }],
24-
output: "<label>\nLabel Text\n<dnn-checkbox onClick={e => console.log(e)}></dnn-checkbox>\n</label>",
24+
output: "<label>\n<dnn-checkbox onClick={e => console.log(e)}></dnn-checkbox>\nLabel Text\n</label>",
2525
},
2626
],
2727
});

packages/stencil-library/src/eslint-plugin/src/rules/no-label-slot-in-checkbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const noLabelSlotInCheckbox: Rule.RuleModule = {
4646
const checkboxText = context.sourceCode.getText(node);
4747

4848
// Combine the label text and checkbox into a label wrapper with multiline formatting
49-
const fixedText = `<label>\n${labelText}\n${checkboxText}</dnn-checkbox>\n</label>`;
49+
const fixedText = `<label>\n${checkboxText}</dnn-checkbox>\n${labelText}\n</label>`;
5050

5151
return fixer.replaceText(parent, fixedText);
5252
}

0 commit comments

Comments
 (0)