Remove unused vars, enable in lint rule (#1088)

Instead of manually checking (e.g.
https://github.com/mozilla/fx-private-relay/pull/1082#discussion_r704475602),
we can just have the computer do it for us :)
This commit is contained in:
Vincent 2021-09-13 17:59:54 +02:00 коммит произвёл GitHub
Родитель ea5a63872f
Коммит c028f2d2dd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -34,7 +34,7 @@ module.exports = {
"linebreak-style": ["error", "unix"],
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-prototype-builtins": "off",
"no-unused-vars": ["warn", { vars: "all", args: "none", ignoreRestSiblings: false }],
"no-unused-vars": ["warn", { vars: "all", args: "all", ignoreRestSiblings: false }],
quotes: ["error", "double", { avoidEscape: true }],
semi: ["off", "always"],
},

Просмотреть файл

@ -178,7 +178,7 @@ function analyticsSurveyLogic() {
li.dataset.eventLabel = "promoter";
li.dataset.npsValue = 1;
}
li.addEventListener("click", (evt) => {
li.addEventListener("click", () => {
const eventData = li.dataset;
ga("send", "event",
eventData.eventCategory,
@ -222,7 +222,7 @@ function analyticsSurveyLogic() {
li.dataset.eventAction = "submitted";
li.dataset.eventLabel = optionEventLabels[optionBuildIndex];
li.addEventListener("click", setSurveyedCookie);
li.addEventListener("click", (evt) => {
li.addEventListener("click", () => {
const eventData = li.dataset;
ga("send", "event",
eventData.eventCategory,
@ -272,7 +272,7 @@ function analyticsSurveyLogic() {
li.dataset.eventLabel = optionEventLabels[optionBuildIndex];
li.dataset.eventValue = eventValue;
li.addEventListener("click", setSurveyedCookie);
li.addEventListener("click", (evt) => {
li.addEventListener("click", () => {
const eventData = li.dataset;
const gaFieldsObject = {
[countMetric]: 1,

Просмотреть файл

@ -142,7 +142,7 @@ function deleteAliasConfirmation(submitEvent) {
// Enable "Delete Anyway" button once the checkbox has been clicked.
const confirmDeleteModalActions = confirmDeleteModal.querySelectorAll("button");
const deleteAnywayBtn = confirmDeleteModalActions[1];
checkbox.addEventListener("change", (e) => {
checkbox.addEventListener("change", () => {
if (checkbox.checked) {
deleteAnywayBtn.disabled = false;
return;
@ -278,7 +278,7 @@ function watchForInstalledAddon() {
childList: true, // catches legacy addons modifying .relay-email-address-note els
};
const patrollerDuties = (mutations, mutationPatroller) => {
const patrollerDuties = (mutations) => {
for (const mutation of mutations) {
// handle legacy addon labeling
if (mutation.type === "childList" && mutation.target.classList.contains("relay-email-address-note")) {

Просмотреть файл

@ -120,7 +120,7 @@
document.removeEventListener("keydown", domainRegistration.modal.close, false);
},
formSubmit: async (e) => {
formSubmit: async () => {
const modalConfirmCheckbox = document.querySelector(".js-modal-domain-registration-confirmation-checkbox");
if (!modalConfirmCheckbox.checked) {

Просмотреть файл

@ -138,7 +138,7 @@ class FirefoxApps extends HTMLElement {
return;
};
this._closeBento = (event) => {
this._closeBento = () => {
this._active = false;
this.handleBentoFocusTrap();
window.removeEventListener("resize", this.handleBentoHeight);