You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(function () { ... })(window) doesn't return a function so it breaks.
We've solved this on Digital Marketplace by adding a semicolon after the Show/Hide content module block but having a project-specific fix for this isn't ideal.
The text was updated successfully, but these errors were encountered:
#334 (that @tvararu referenced) lints every JS file with Standard. This fixes this issue. Looking at the original example, both show-hide-content
and stick-at-top-when-scrolling start with the same ;(function (global) {.
The Show/Hide content module was written with the standardJS style of semicolon use. All our other GOVUK modules use the JSLint style and combining the two can cause errors.
For example, if you have the Show/Hide content module followed by the Stick-at-top-when-scrolling module, you get this:
End of Show/Hide content module:
Start of Stick-at-top-when-scrolling module:
...which causes this error:
I think the parser is seeing only line breaks between
})(window)
and(function (global) {
so assumes you mean:(function () { ... })(window)
doesn't return a function so it breaks.We've solved this on Digital Marketplace by adding a semicolon after the Show/Hide content module block but having a project-specific fix for this isn't ideal.
The text was updated successfully, but these errors were encountered: