-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Minor JS consistency changes #31212
Minor JS consistency changes #31212
Conversation
delete dataAttributes[dataAttr] | ||
} | ||
}) | ||
Object.keys(dataAttributes).forEach(dataAttr => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the indent because we chain calls here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not another instance we break after Object.keys
in the whole codebase...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so maybe we should apply that to the other calls of Object.keys
, shorter line is always better for the reading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI:
Search "Object.keys" (11 hits in 7 files)
C:\Users\xmr\Desktop\bootstrap\build\build-plugins.js (1 hit)
Line 180: await Promise.all(Object.keys(bsPlugins).map(plugin => build(plugin)))
C:\Users\xmr\Desktop\bootstrap\js\src\dom\event-handler.js (5 hits)
Line 129: const uidEventList = Object.keys(events)
Line 212: Object.keys(storeElementEvent).forEach(handlerKey => {
Line 251: Object.keys(events).forEach(elementEvent => {
Line 257: Object.keys(storeElementEvent).forEach(keyHandlers => {
Line 304: Object.keys(args).forEach(key => {
C:\Users\xmr\Desktop\bootstrap\js\src\dom\manipulator.js (1 hit)
Line 50: Object.keys(attributes).forEach(key => {
C:\Users\xmr\Desktop\bootstrap\js\src\tooltip.js (1 hit)
Line 679: Object.keys(dataAttributes)
C:\Users\xmr\Desktop\bootstrap\js\src\util\index.js (1 hit)
Line 113: Object.keys(configTypes).forEach(property => {
C:\Users\xmr\Desktop\bootstrap\js\src\util\sanitizer.js (1 hit)
Line 103: const allowlistKeys = Object.keys(allowList)
C:\Users\xmr\Desktop\bootstrap\js\tests\browsers.js (1 hit)
Line 63: const browsersKeys = Object.keys(browsers)
So, it's basically only this instance and also we don't enforce it, which TBH is better since this is really just a trivial thing :)
No description provided.