Apply JavaScript rules to prevent shadowing
Using the same variable name makes the code more difficult to read.
We're also enabling the `no-param-reassing` rule since we accidentally
reassigned params in commit 824dd26d, and this rule will prevent us from
doing so in the future.
This commit is contained in:
@@ -40,6 +40,8 @@ rules:
|
||||
no-multiple-empty-lines:
|
||||
- error
|
||||
- max: 1
|
||||
no-param-reassign: error
|
||||
no-shadow: error
|
||||
no-spaced-func: error
|
||||
no-tabs: error
|
||||
no-trailing-spaces: error
|
||||
|
||||
@@ -59,9 +59,9 @@
|
||||
$(data.wrapper).find(".attachment-actions .action-remove").removeClass("small-3").addClass("small-12");
|
||||
destroyAttachmentLink = $(data.result.destroy_link);
|
||||
$(data.destroyAttachmentLinkContainer).html(destroyAttachmentLink);
|
||||
$(destroyAttachmentLink).on("click", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$(destroyAttachmentLink).on("click", function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
App.Documentable.doDeleteCachedAttachmentRequest(this.href, data);
|
||||
});
|
||||
if (input["lockUpload"]) {
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
App.Imageable.setPreview(data);
|
||||
destroyAttachmentLink = $(data.result.destroy_link);
|
||||
$(data.destroyAttachmentLinkContainer).html(destroyAttachmentLink);
|
||||
$(destroyAttachmentLink).on("click", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$(destroyAttachmentLink).on("click", function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
App.Imageable.doDeleteCachedAttachmentRequest(this.href, data);
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user