Skip to content

Commit

Permalink
chore: Update eslint to enforce quotes and fix the existing linting e…
Browse files Browse the repository at this point in the history
…rrors (#355)
  • Loading branch information
fregante authored Jan 18, 2022
1 parent 2d75968 commit 31ed31a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions test/fixtures/detect-existing-browser-api-object/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

0 comments on commit 31ed31a

Please sign in to comment.