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

Minor JS consistency changes #31212

Merged
merged 9 commits into from
Jul 12, 2020
Merged

Minor JS consistency changes #31212

merged 9 commits into from
Jul 12, 2020

Conversation

XhmikosR
Copy link
Member

No description provided.

delete dataAttributes[dataAttr]
}
})
Object.keys(dataAttributes).forEach(dataAttr => {
Copy link
Member

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

Copy link
Member Author

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...

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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 :)

@XhmikosR XhmikosR marked this pull request as ready for review June 30, 2020 18:42
@XhmikosR XhmikosR requested a review from a team as a code owner June 30, 2020 18:42
@XhmikosR XhmikosR merged commit b345746 into main Jul 12, 2020
@XhmikosR XhmikosR deleted the main-xmr-js branch July 12, 2020 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants