Add unicorn eslint rules#2724
Conversation
WalkthroughReplaces many DOM insertion/removal calls across the codebase: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🪛 Biome (2.1.2)js/formidable_styles.js[error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: Do not use the t variable name as a label The variable is declared here Creating a label with the same name as an in-scope variable leads to confusion. (lint/suspicious/noLabelVar) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) js/welcome-tour.js[error] 2-2: This case is falling through to the next case. Add a (lint/suspicious/noFallthroughSwitchClause) [error] 2-2: This case is falling through to the next case. Add a (lint/suspicious/noFallthroughSwitchClause) [error] 2-2: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 2-2: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 2-2: Do not use the t variable name as a label The variable is declared here Creating a label with the same name as an in-scope variable leads to confusion. (lint/suspicious/noLabelVar) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) js/formidable-web-components.js[error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) js/formidable-settings-components.js[error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 1-1: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) js/frm_testing_mode.js[error] 2-2: This case is falling through to the next case. Add a (lint/suspicious/noFallthroughSwitchClause) [error] 2-2: This variable is used before its declaration. The variable is declared here: (lint/correctness/noInvalidUseBeforeDeclaration) [error] 2-2: Do not use the e variable name as a label The variable is declared here Creating a label with the same name as an in-scope variable leads to confusion. (lint/suspicious/noLabelVar) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) [error] 2-2: Do not reassign a function declaration. Reassigned here. Use a local variable instead. (lint/suspicious/noFunctionAssign) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (22)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
js/admin/dom.js (1)
866-866: Consider completing the migration toappend()for consistency.This line still uses
appendChild()while the rest of the file has been migrated toappend(). For consistency with the PR's systematic modernization effort, consider updating this line as well.🔎 Proposed change for consistency
- node.childNodes.forEach( child => newNode.appendChild( cleanNode( child ) ) ); + node.childNodes.forEach( child => newNode.append( cleanNode( child ) ) );
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
.eslintrc.jsonis excluded by!**/*.jsonpackage-lock.jsonis excluded by!**/package-lock.json,!**/*.jsonpackage.jsonis excluded by!**/*.json
📒 Files selected for processing (18)
js/admin/applications.jsjs/admin/dom.jsjs/admin/embed.jsjs/admin/style.jsjs/formidable.jsjs/packages/floating-links/s11-floating-links.jsjs/plugin-search.jsjs/src/admin/addon-state.jsjs/src/admin/admin.jsjs/src/admin/styles.jsjs/src/admin/upgrade-popup.jsjs/src/form-templates/elements/applicationTemplatesElement.jsjs/src/settings-components/components/token-input/token-elements.jsjs/src/web-components/frm-tab-navigator-component/frm-tab-navigator-component.jsjs/src/web-components/frm-web-component.jsjs/src/welcome-tour/ui/spotlight.jssquare/js/action.jssquare/js/frontend.js
🧰 Additional context used
🧬 Code graph analysis (7)
js/packages/floating-links/s11-floating-links.js (5)
js/admin/applications.js (5)
frmDom(9-9)frmDom(10-10)frmDom(11-11)frmDom(12-12)frmDom(13-13)js/admin/embed.js (2)
frmDom(9-9)frmDom(10-10)js/admin/style.js (5)
frmDom(23-23)frmDom(24-24)frmDom(25-25)frmDom(26-26)frmDom(1162-1162)js/src/admin/addon-state.js (1)
frmDom(3-3)js/src/admin/admin.js (3)
frmDom(241-241)frmDom(242-242)frmDom(243-243)
square/js/frontend.js (2)
stripe/js/frmstrp.js (1)
thisForm(2-10)js/admin/legacy-views.js (1)
thisForm(5-5)
js/admin/style.js (2)
js/admin/applications.js (1)
card(265-271)js/src/admin/admin.js (1)
card(9511-9511)
js/src/admin/upgrade-popup.js (1)
js/src/admin/addon-state.js (1)
upgradeMessage(227-227)
js/src/form-templates/elements/applicationTemplatesElement.js (2)
js/admin/applications.js (1)
elements(25-30)js/admin/dom.js (1)
elements(233-233)
js/src/admin/addon-state.js (1)
js/src/admin/upgrade-popup.js (1)
addonStatus(34-34)
js/src/admin/admin.js (1)
js/admin/dom.js (7)
a(27-33)option(180-180)modal(12-109)modal(14-14)modal(607-607)element(239-239)element(593-593)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: PHP 8 tests in WP 6.9
- GitHub Check: PHP 7.4 tests in WP 6.9
- GitHub Check: Cypress
- GitHub Check: PHP 7.4 tests in WP 6.9
- GitHub Check: PHP 8 tests in WP 6.9
- GitHub Check: Cypress
- GitHub Check: Cypress
- GitHub Check: PHP 7.4 tests in WP 6.9
- GitHub Check: PHP 8 tests in WP 6.9
🔇 Additional comments (27)
square/js/action.js (2)
120-120: LGTM! Clean modernization.The change from
appendChildtoappendis correct and maintains identical functionality for single-node insertion.
171-171: LGTM! Consistent with the modernization effort.The
append()method correctly replacesappendChild()with no functional change.js/src/settings-components/components/token-input/token-elements.js (1)
73-73: LGTM! Correct modernization.The replacement of
appendChildwithappendis functionally equivalent and improves code consistency.square/js/frontend.js (1)
124-125: LGTM! Modernized DOM manipulation.Both
append()calls correctly replace the previousappendChild()pattern with no change in functionality.js/plugin-search.js (1)
38-39: LGTM! Clean refactor for element relocation.The modernized approach correctly removes the parent node and re-attaches
dismissLinkto a new container. The dismissLink reference remains valid throughout the operation.js/src/form-templates/elements/applicationTemplatesElement.js (1)
114-114: LGTM! Consistent modernization.The change to
append()is correct and aligns with the project-wide API modernization.js/src/welcome-tour/ui/spotlight.js (1)
27-27: LGTM! Modern DOM API usage.The modernization from
appendChild()toappend()is a clean improvement that aligns with current JavaScript standards.js/formidable.js (2)
1359-1359: LGTM! Cleaner removal syntax.The modernization from
parentNode.removeChild()toremove()is more concise and direct.
1885-1903: LGTM! Modern DOM API usage for form submission.The updates to use
append()for adding the antispam token and unique ID inputs are clean modernizations that maintain identical functionality.js/packages/floating-links/s11-floating-links.js (1)
78-78: LGTM! Consistent modernization across the component.All
appendChild()toappend()conversions throughout the floating links component construction are clean and maintain the existing DOM hierarchy and behavior.Also applies to: 119-119, 157-157, 192-196, 236-236
js/src/web-components/frm-web-component.js (1)
40-41: LGTM! Modern API in base component class.The conversion to
append()for adding styles and views in the web component render method is a clean modernization that benefits all derived components.js/src/admin/styles.js (3)
66-66: LGTM! Modern DOM API for style injection.The modernization to
append()for adding the inline style element to the document head is clean and maintains identical behavior.
136-136: LGTM! Modern API for hover element insertion.The conversion to
append()for adding the hover element maintains identical functionality while using the modern standard.
221-221: LGTM! Modern API for temporary element insertion.The modernization to
append()for the clipboard fallback's temporary input element is correct and maintains identical behavior.js/admin/applications.js (1)
71-71: LGTM: Clean modernization toappend().All
appendChild()→append()replacements are safe. The return values weren't being used, and all arguments are DOM nodes (not strings), so behavior is preserved.Also applies to: 75-75, 141-142, 190-190, 209-209, 250-250, 276-277, 307-307, 309-309, 312-312, 317-317, 366-366, 370-370
js/src/admin/upgrade-popup.js (1)
90-95: LGTM: Safe modernization.The
append()replacement is correct. The upsell image insertion works identically with the new API.js/src/admin/addon-state.js (1)
141-141: LGTM: Safe modernization.The
append()replacement preserves functionality. The return value wasn't being used.js/admin/style.js (2)
589-589: LGTM: Safe modernization.The
append()call correctly adds the hamburger menu to the card.
1127-1133: LGTM: Clean CSS reload implementation.Both changes are safe:
style.remove()cleanly replacesparentNode.removeChild(style)head.append(newStyle)replacesappendChild(newStyle)The load event listener ensures the old stylesheet is only removed after the new one loads, preventing a flash of unstyled content.
js/admin/embed.js (1)
151-151: LGTM: Comprehensive modernization.All
appendChild()→append()replacements are safe and correct:
- No return values were being used
- All arguments are DOM nodes (not strings)
- Insertion order and functionality preserved throughout modal construction, page dropdown, form creation, and embed examples
Also applies to: 155-155, 185-185, 197-197, 284-284, 289-289, 291-292, 351-351, 357-359, 361-361, 410-410, 431-431, 434-435, 496-496
js/admin/dom.js (4)
36-53: LGTM! Modal creation modernized correctly.The migration to
append()for constructing modal sections (top, content, footer) is clean and maintains the same functionality.
599-599: LGTM! Helper functions updated consistently.The modal helper and creation functions now use the modern
append()API correctly.Also applies to: 610-611
746-758: LGTM! Tag builder function updated correctly.The
tag()function now usesappend()for adding children. The explicit text node creation at line 749 is good practice for clarity, even thoughappend()can accept strings directly.
777-777: LGTM! Remaining DOM helpers updated consistently.The
svg(),success(), andredraw()functions all correctly use the modernappend()API.Also applies to: 799-799, 815-815
js/src/web-components/frm-tab-navigator-component/frm-tab-navigator-component.js (1)
24-26: Code change is correct; no IE11 compatibility concern for this project.The migration from
appendChild()toappend()is appropriate. The project uses web components (which themselves lack IE11 support without polyfills) and shows no IE11-specific configuration or polyfill setup, indicating IE11 is not a targeted browser. The modernappend()API is the correct choice for this codebase.js/src/admin/admin.js (2)
285-291: Node.remove() migrations look correct; just confirm browser support assumptionsAcross these blocks you’ve switched from
parent.removeChild(child)/jQuery(...).remove()tochild.remove()(or equivalent):
emptyhelper (Line 285–291)maybeDeleteAnEmptyFieldGroup(Line 1133–1138)maybeDeleteEmptyFieldGroups(Line 1245–1247)deleteEmptyDividerWrappers(Line 1282–1290)- Field‑group delete decoy (Line 4047–4051)
moveOpenModalsOutOfFieldOptions(Line 5171–5179)resetSingleOptcleanup of stray text nodes (Line 6059–6078)triggerSubmittemporary button cleanup (Line 7066–7071)afterFormSavetransient message removal (Line 7229–7233)trashTemplatecard removal (Line 9510–9515)In all cases:
- The target is a concrete DOM node (not a jQuery wrapper), so
.remove()is valid.- No call site was using the return value of
removeChild, so behavior and data flow are preserved.- Loop patterns that remove nodes (like
deleteEmptyDividerWrappers) already worked with removal; switching to.remove()doesn’t introduce new mutation issues.Only thing to double‑check is that your supported browser matrix (or any polyfills you ship) explicitly allows reliance on
Node.prototype.remove(IE11 would need a polyfill, but this code already used other modern constructs like optional chaining).Also applies to: 1133-1138, 1245-1247, 1282-1290, 4047-4051, 5171-5179, 6059-6078, 7066-7071, 7229-7233, 9510-9515
1393-1401: appendChild→append transitions are behavior‑preserving and consistent with Unicorn rulesThese hunks cover all the
appendChild→appendmoves (and related newappendsites):
- Field group controls setup (
updateFieldGroupControls,setFieldControlsHtml,getFieldControlsDropdown) (Line 1393–1401, 1420–1424, 1465–1472)- Calc‑field shortcode list (
popCalcFields) (Line 1666–1680)- Limit modal temp anchor (
showLimitModal) (Line 2248–2254)- Wrapping / re‑wrapping fields (
wrapFieldLi,wrapFieldLiInPlace) (Line 2735–2755, 2772–2777)- Field‑group duplication helper list item injection (Line 4114–4123)
- Field‑group layout popup construction (
getFieldGroupPopup, row‑layout helpers) (Line 4185–4207, 4272–4293, 4320–4323, 4349–4360, 4512–4564)- Field‑group message insertion (
maybeShowFieldGroupMessage) (Line 4842–4856)- Multiselect popup construction (
getFieldMultiselectPopup) (Line 4972–5009)- Option‑mapping hidden input insertion (
onOptionTextFocus) (Line 5375–5387)- Conditional‑logic option rebuilding (
adjustConditionalLogicOptionOrders) (Line 5536–5540)<select>option population (fillDropdownOpts, logic value select) (Line 6335–6351, 6631–6639)- Action duplication and creation (
copyFormAction,addFormAction) (Line 7472–7480, 7539–7555)moveFieldSettingsDocumentFragment assembly (Line 7776–7813)- Admin footer links relocation (
addAdminFooterLinks) (Line 10210–10219)Checks:
- None of these sites rely on the return value of
appendChild, so switching toappenddoesn’t break any chaining or assignments.- Where existing nodes are re‑parented (e.g., moving controls, modals, or list items),
appendstill moves the node (same asappendChild), so ordering and DOM structure stay intact.appendis only called on real DOM nodes /DocumentFragments (not jQuery objects), with single Node arguments, which matches the previous usage.As with
.remove(), this does assume your runtime targets browsers that supportNode.prototype.append(or that you polyfill it). Given the rest of the file already uses modern DOM APIs, this modernization is consistent; just confirm that build + browser support expectations are aligned.Also applies to: 1420-1424, 1465-1472, 1666-1680, 2248-2254, 2735-2755, 2772-2777, 4114-4123, 4185-4207, 4272-4293, 4320-4323, 4349-4360, 4512-4564, 4842-4856, 4972-5009, 5375-5387, 5536-5540, 6335-6351, 6631-6639, 7472-7480, 7539-7555, 7776-7813, 10210-10219
This is currently using a fairly outdated version as our version of ES Lint is outdated as well.
Rules applied so far
remove/appendoverremoveChild/appendChild.