Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added underscore as dependency to section_changer.js #35697

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
*/
hqDefine("app_manager/js/section_changer", [
'jquery',
'underscore',
], function (
$
$,
_,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the comma here cause issues? Aka is there a reason we didn't have it there before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ES5 doesn't allow trailing commas for parameters lists in function calls, that was added in ES6. It's not a problem in browsers, which have moved on from ES5, but for code using requirejs, it'll break deploy (because uglify will fail to parse the file). HQ has been using ES5 in linting rules forever for this reason.

#35651 updated HQ to lint using ES6, now that almost all of our code is off of requirejs. The new lint config expects trailing commas in function calls.

So it should have been there before, I just haven't gotten in the habit yet...that might also be more evidence that I did this file by hand before scripting, since spot checking the related PRs, they have trailing commas for the hqDefine callback arguments.

) {
// Determine key for localStorage
// page is something like "module-view"
Expand Down