Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint: Enforce quotes #355

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
});