-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
AMD/CommonJS/Globals #12909 #13772
AMD/CommonJS/Globals #12909 #13772
Conversation
You can just disable the warning for that code block... |
i dont think we need the strict rule because we follow a template with all our plugins. the top of them is copy pasted and completely consistent across the board. i also had to disable i went back and forth with |
could be convinced of the validity of |
but also kinda meh about it |
So you basically want to revert every change everyone else made... Oh well, I guess I'll stop bothering with the JS part anymore. No worries. |
I don't think we should remove any rules that ensure consistency across the JavaScript because of an adorable function name. I mean it is cute, but IMHO not worth it. |
Yeah, let's avoid the gratuitously opaque/weird function name. |
I haven't used AMD/CommonJS before, so I have no idea. |
@mdo: it is reverting the changes I made in the other PR, which had like 3/4 reverted already. No worries, I don't mind, I'll leave others bother with JS. |
@@ -7,7 +7,11 @@ | |||
* ======================================================================== */ | |||
|
|||
|
|||
+function ($) { | |||
(function ( o_o) { |
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 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 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.
ಠ_ಠ
just turning off strict mode and requireCamelCaseOrUpperCaseIdentifiers which aren't hard to miss things. We obviously always camel case our identifiers (except in this case, but it's very intentional) and strict mode isn't something i'm worried about us missing in a plugin. |
You could have just added /* jshint strict: false */ to the body of the factory function. |
That's true for us, but having undocumented/unenforced rules about our coding style makes contributing harder. If somebody were to submit a PR and use an identifier that's not in camelCase, the style check that should report such problems passes and the error can't be resolved until somebody from the team points this out to the contributor. Not that fatal, as PRs are properly reviewed by us before they're merged, but given that the tool we use for code style checking has this feature, I think it's counter-intuitive not to use it. Even more so, as we're removing this because of an "gratuitously opaque/weird" function name. Anyways, just my 2¢. |
This also introduced regression of #10038. |
@hnrch02 File new issue please. |
@cvrebert I'm preparing a PR right now. |
Will hopefully revert this reversion and land a fully-working version of UMD in v3.3.0. Revert "some changes from #13801 - add strict mode back and ==" This reverts commit 2b302f6. Revert "Fix regression of #10038 introduced by #13772" This reverts commit e9d6756. Revert "MD/CommonJS/Globals #12909" This reverts commit 1c6fa90. Revert "address #13811" This reverts commit f347d7d. Conflicts: js/carousel.js js/collapse.js js/dropdown.js js/modal.js js/tab.js js/tooltip.js
the following jshint tests are failing:
I dont want to add "use strict" to this factory method. If that means removing the js hint rule for that, im fine with that.
Not sure where to add our define/require exports… @cvrebert any idea?