From 31ed31a6e025bcf032c95d5976a06d20d319c8cb Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Wed, 19 Jan 2022 04:10:34 +0800 Subject: [PATCH] chore: Update eslint to enforce quotes and fix the existing linting errors (#355) --- .eslintrc | 2 +- .../detect-existing-browser-api-object/content.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.eslintrc b/.eslintrc index def1144..08b2811 100644 --- a/.eslintrc +++ b/.eslintrc @@ -415,7 +415,7 @@ "quote-props": 0, // Double quotes should be used. - "quotes": [1, "double", {"avoidEscape": true, "allowTemplateLiterals": true}], + "quotes": [2, "double", {"avoidEscape": true, "allowTemplateLiterals": true}], // Require use of the second argument for parseInt(). "radix": 2, diff --git a/test/fixtures/detect-existing-browser-api-object/content.js b/test/fixtures/detect-existing-browser-api-object/content.js index 016459f..53763d9 100644 --- a/test/fixtures/detect-existing-browser-api-object/content.js +++ b/test/fixtures/detect-existing-browser-api-object/content.js @@ -37,18 +37,18 @@ test("browser api object in background page", async (t) => { test("error types", async (t) => { if (navigator.userAgent.includes("Firefox/")) { try { - await browser.storage.sync.set({a: 'a'}); - t.fail('It should throw when attempting to call storage.sync with a temporary addon ID'); + await browser.storage.sync.set({a: "a"}); + t.fail("It should throw when attempting to call storage.sync with a temporary addon ID"); } catch (error) { - t.equal(error.message, 'The storage API will not work with a temporary addon ID. Please add an explicit addon ID to your manifest. For more information see https://mzl.la/3lPk1aE.'); + t.equal(error.message, "The storage API will not work with a temporary addon ID. Please add an explicit addon ID to your manifest. For more information see https://mzl.la/3lPk1aE."); t.ok(error instanceof Error); } } else { await new Promise(resolve => { - chrome.storage.local.set({a: 'a'.repeat(10000000)}, resolve); + chrome.storage.local.set({a: "a".repeat(10000000)}, resolve); }); - t.ok(chrome.runtime.lastError, 'It should throw when attempting to set an object over quota'); - t.equal(chrome.runtime.lastError.message, 'QUOTA_BYTES quota exceeded'); + t.ok(chrome.runtime.lastError, "It should throw when attempting to set an object over quota"); + t.equal(chrome.runtime.lastError.message, "QUOTA_BYTES quota exceeded"); t.notOk(chrome.runtime.lastError instanceof Error); } });