Skip to content

Commit

Permalink
Upgrade eslint-plugin-mozilla and dangle commas. (mozilla-services#4822)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Sep 10, 2018
1 parent fdb144f commit f528c80
Show file tree
Hide file tree
Showing 79 changed files with 4,081 additions and 4,104 deletions.
6 changes: 3 additions & 3 deletions addon/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const prefObserver = {
// eslint-disable-next-line promise/catch-or-return
appStartupPromise = appStartupPromise.then(handleStartup);
}
}
},
};

const LibraryButton = {
Expand Down Expand Up @@ -110,7 +110,7 @@ function shutdown(data, reason) { // eslint-disable-line no-unused-vars
prefObserver.unregister();
const webExtension = LegacyExtensionsUtils.getEmbeddedExtensionFor({
id: ADDON_ID,
resourceURI: addonResourceURI
resourceURI: addonResourceURI,
});
// Immediately exit if Firefox is exiting, #3323
if (reason === APP_SHUTDOWN) {
Expand All @@ -136,7 +136,7 @@ function shouldDisable() {
function handleStartup() {
const webExtension = LegacyExtensionsUtils.getEmbeddedExtensionFor({
id: ADDON_ID,
resourceURI: addonResourceURI
resourceURI: addonResourceURI,
});

if (!shouldDisable() && !webExtension.started) {
Expand Down
58 changes: 29 additions & 29 deletions addon/webextension/background/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ this.analytics = (function() {
method: "POST",
mode: "cors",
headers: { "content-type": "application/json" },
credentials: "include"
credentials: "include",
};

function flushEvents() {
Expand Down Expand Up @@ -63,7 +63,7 @@ this.analytics = (function() {
timingCategory,
timingLabel,
timingVar,
timingValue
timingValue,
});
if (!timingsTimeoutHandle) {
timingsTimeoutHandle = setTimeout(() => {
Expand Down Expand Up @@ -115,7 +115,7 @@ this.analytics = (function() {
event: eventCategory,
action,
label,
options
options,
});
if (!eventsTimeoutHandle) {
eventsTimeoutHandle = setTimeout(() => {
Expand Down Expand Up @@ -173,111 +173,111 @@ this.analytics = (function() {
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" },
{ action: "internal", label: "unhide-onboarding-frame" }
]
{ action: "internal", label: "unhide-onboarding-frame" },
],
}, {
name: "context-menu",
start: { action: "start-shot", label: "context-menu" },
end: { action: "internal", label: "unhide-preselection-frame" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" },
{ action: "internal", label: "unhide-onboarding-frame" }
]
{ action: "internal", label: "unhide-onboarding-frame" },
],
}, {
name: "page-action-onboarding",
start: { action: "start-shot", label: "toolbar-button" },
end: { action: "internal", label: "unhide-onboarding-frame" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" },
{ action: "internal", label: "unhide-preselection-frame" }
]
{ action: "internal", label: "unhide-preselection-frame" },
],
}, {
name: "context-menu-onboarding",
start: { action: "start-shot", label: "context-menu" },
end: { action: "internal", label: "unhide-onboarding-frame" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" },
{ action: "internal", label: "unhide-preselection-frame" }
]
{ action: "internal", label: "unhide-preselection-frame" },
],
}, {
name: "capture-full-page",
start: { action: "capture-full-page" },
end: { action: "internal", label: "unhide-preview-frame" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" }
]
{ action: "internal", label: "document-hidden" },
],
}, {
name: "capture-visible",
start: { action: "capture-visible" },
end: { action: "internal", label: "unhide-preview-frame" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" }
]
{ action: "internal", label: "document-hidden" },
],
}, {
name: "make-selection",
start: { action: "make-selection" },
end: { action: "internal", label: "unhide-selection-frame" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" }
]
{ action: "internal", label: "document-hidden" },
],
}, {
name: "save-shot",
start: { action: "save-shot" },
end: { action: "internal", label: "open-shot-tab" },
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }]
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }],
}, {
name: "save-visible",
start: { action: "save-visible" },
end: { action: "internal", label: "open-shot-tab" },
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }]
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }],
}, {
name: "save-full-page",
start: { action: "save-full-page" },
end: { action: "internal", label: "open-shot-tab" },
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }]
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }],
}, {
name: "save-full-page-truncated",
start: { action: "save-full-page-truncated" },
end: { action: "internal", label: "open-shot-tab" },
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }]
cancel: [{ action: "cancel-shot" }, { action: "upload-failed" }],
}, {
name: "download-shot",
start: { action: "download-shot" },
end: { action: "internal", label: "deactivate" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" }
]
{ action: "internal", label: "document-hidden" },
],
}, {
name: "download-full-page",
start: { action: "download-full-page" },
end: { action: "internal", label: "deactivate" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" }
]
{ action: "internal", label: "document-hidden" },
],
}, {
name: "download-full-page-truncated",
start: { action: "download-full-page-truncated" },
end: { action: "internal", label: "deactivate" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" }
]
{ action: "internal", label: "document-hidden" },
],
}, {
name: "download-visible",
start: { action: "download-visible" },
end: { action: "internal", label: "deactivate" },
cancel: [
{ action: "cancel-shot" },
{ action: "internal", label: "document-hidden" }
]
{ action: "internal", label: "document-hidden" },
],
}];

// Match a filter (action and optional label) against an action and label.
Expand Down
8 changes: 4 additions & 4 deletions addon/webextension/background/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ this.auth = (function() {
const info = {
deviceId: `anon${makeUuid()}`,
secret: makeUuid(),
registered: false
registered: false,
};
return info;
}
Expand Down Expand Up @@ -70,7 +70,7 @@ this.auth = (function() {
req.send(JSON.stringify({
deviceId: registrationInfo.deviceId,
secret: registrationInfo.secret,
deviceInfo: JSON.stringify(deviceInfo())
deviceInfo: JSON.stringify(deviceInfo()),
}));
});
}
Expand Down Expand Up @@ -125,7 +125,7 @@ this.auth = (function() {
deviceId: registrationInfo.deviceId,
secret: registrationInfo.secret,
deviceInfo: JSON.stringify(deviceInfo()),
ownershipCheck
ownershipCheck,
}));
});
}
Expand Down Expand Up @@ -189,7 +189,7 @@ this.auth = (function() {
isOwner: result && result.isOwner,
deviceId: registrationInfo.deviceId,
accountId,
authHeaders
authHeaders,
};
});
}
Expand Down
2 changes: 1 addition & 1 deletion addon/webextension/background/deviceInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ this.deviceInfo = (function() {
// platformVersion: system.platformVersion,
userAgent: navigator.userAgent,
appVendor: appName,
appName
appName,
};
};

Expand Down
10 changes: 5 additions & 5 deletions addon/webextension/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ this.main = (function() {
return;
}
senderror.showError({
popupMessage: "UNSHOOTABLE_PAGE"
popupMessage: "UNSHOOTABLE_PAGE",
});
return;
}
Expand Down Expand Up @@ -200,7 +200,7 @@ this.main = (function() {
type: "basic",
iconUrl: "../icons/copied-notification.svg",
title: browser.i18n.getMessage("notificationLinkCopiedTitle"),
message: browser.i18n.getMessage("notificationLinkCopiedDetails", pasteSymbol)
message: browser.i18n.getMessage("notificationLinkCopiedDetails", pasteSymbol),
});
}
return null;
Expand Down Expand Up @@ -234,7 +234,7 @@ this.main = (function() {
type: "basic",
iconUrl: "../icons/copied-notification.svg",
title: browser.i18n.getMessage("notificationImageCopiedTitle"),
message: browser.i18n.getMessage("notificationImageCopiedDetails", pasteSymbol)
message: browser.i18n.getMessage("notificationImageCopiedDetails", pasteSymbol),
});
});
});
Expand All @@ -261,7 +261,7 @@ this.main = (function() {
return browser.downloads.download({
url,
incognito: windowInfo.incognito,
filename: info.filename
filename: info.filename,
}).catch((error) => {
// We are not logging error message when user cancels download
if (error && error.message && !error.message.includes("canceled")) {
Expand All @@ -286,7 +286,7 @@ this.main = (function() {
// Note, we only show the error but don't report it, as we know that we can't
// take shots of these pages:
senderror.showError({
popupMessage: "UNSHOOTABLE_PAGE"
popupMessage: "UNSHOOTABLE_PAGE",
});
});

Expand Down
14 changes: 7 additions & 7 deletions addon/webextension/background/selectorLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ this.selectorLoader = (function() {
"blobConverters.js",
"background/selectorLoader.js",
"selector/callBackground.js",
"selector/util.js"
"selector/util.js",
];

const selectorScripts = [
Expand All @@ -33,20 +33,20 @@ this.selectorLoader = (function() {
"selector/documentMetadata.js",
"selector/ui.js",
"selector/shooter.js",
"selector/uicontrol.js"
"selector/uicontrol.js",
];

// These are loaded on request (by the selector worker) to activate the onboarding:
const onboardingScripts = [
"build/onboardingCss.js",
"build/onboardingHtml.js",
"onboarding/slides.js"
"onboarding/slides.js",
];

exports.unloadIfLoaded = function(tabId) {
return browser.tabs.executeScript(tabId, {
code: "this.selectorLoader && this.selectorLoader.unloadModules()",
runAt: "document_start"
runAt: "document_start",
}).then(result => {
return result && result[0];
});
Expand All @@ -58,7 +58,7 @@ this.selectorLoader = (function() {
}
return browser.tabs.executeScript(tabId, {
code: "!!this.selectorLoader",
runAt: "document_start"
runAt: "document_start",
}).then(result => {
return result && result[0];
});
Expand Down Expand Up @@ -102,7 +102,7 @@ this.selectorLoader = (function() {
// scripts, but not the scripts in the underlying page. For more
// details, see https://mdn.io/WebExtensions/Content_scripts#Content_script_environment
code: `window.downloadOnly = ${downloadOnly}`,
runAt: "document_start"
runAt: "document_start",
});
});
});
Expand All @@ -116,7 +116,7 @@ this.selectorLoader = (function() {
lastPromise = lastPromise.then(() => {
return browser.tabs.executeScript(tabId, {
file,
runAt: "document_start"
runAt: "document_start",
}).catch((error) => {
log.error("error in script:", file, error);
error.scriptName = file;
Expand Down
Loading

0 comments on commit f528c80

Please sign in to comment.