Skip to content

Commit fbf9a94

Browse files
committed
refactor(eslint): fix unicorn/prefer-dom-node-remove (refs SFKUI-6500)
1 parent 47fed31 commit fbf9a94

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ export default [
140140
name: "technical-debt",
141141
rules: {
142142
"unicorn/filename-case": "off",
143-
"unicorn/prefer-dom-node-remove": "off",
144143
"unicorn/prefer-dom-node-text-content": "off",
145144
"unicorn/prefer-export-from": "off",
146145
"unicorn/prefer-math-min-max": "off",

packages/logic/src/alert-screen-reader/alert-screen-reader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ export function alertScreenReader(
4747
/* eslint-disable-next-line @typescript-eslint/no-floating-promises -- technical debt */
4848
waitForScreenReader(() => {
4949
while (wrapper.firstChild) {
50-
wrapper.removeChild(wrapper.firstChild);
50+
wrapper.firstChild.remove();
5151
}
5252

5353
wrapper.append(msg);
5454

5555
setTimeout(() => {
5656
// Remove element if it is still in the DOM.
5757
if (msg.parentElement === wrapper) {
58-
wrapper.removeChild(msg);
58+
msg.remove();
5959
}
6060
}, REMOVE_TEXT_DELAY);
6161
});

packages/vue/src/components/FValidationGroup/FValidationGroup.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe("events", () => {
246246
validityMode: "ERROR",
247247
});
248248

249-
input1.element.parentElement?.removeChild(input1.element);
249+
input1.element.remove();
250250

251251
const input2 = wrapper.get<HTMLInputElement>("#input2");
252252
triggerComponentValidityEvent(input2.element, {

packages/vue/src/utils/mount-component/mount-component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ it("should mount component to container selector", () => {
5151
</body>
5252
`);
5353
app.unmount();
54-
document.body.removeChild(container);
54+
container.remove();
5555
});
5656

5757
it("should throw error if no component is given", () => {

packages/vue/src/utils/mount-component/mount-component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function mountComponent(
9090
app.unmount = () => {
9191
unmount.call(app);
9292
if (el.parentNode) {
93-
el.parentNode.removeChild(el);
93+
el.remove();
9494
}
9595
};
9696

0 commit comments

Comments
 (0)