Skip to content

Commit

Permalink
Ignore some non-important ESLint errors
Browse files Browse the repository at this point in the history
I know what I am doing™
  • Loading branch information
yorkxin committed Aug 30, 2024
1 parent 077c3c6 commit ffaa532
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ async function createMenus() {
],
});

// eslint-disable-next-line no-restricted-syntax
for await (const format of singleLinkFormats) {
await browser.contextMenus.update(`current-tab-custom-format-${format.slot}`, {
contexts: [
Expand Down Expand Up @@ -167,6 +168,7 @@ async function createMenus() {
contexts: ['tab'],
});

// eslint-disable-next-line no-restricted-syntax
for await (const format of multipleLinksFormats) {
browser.contextMenus.create({
id: `all-tabs-custom-format-${format.slot}`,
Expand Down Expand Up @@ -196,6 +198,7 @@ async function createMenus() {
contexts: ['tab'],
});

// eslint-disable-next-line no-restricted-syntax
for await (const format of multipleLinksFormats) {
browser.contextMenus.create({
id: `highlighted-tabs-custom-format-${format.slot}`,
Expand Down Expand Up @@ -392,6 +395,7 @@ async function handleExportTabs({
});
const crGroups = await getTabGroups(windowId);
const groups = crGroups.map((group) => new TabGroup(group.title, group.id, group.color));
// eslint-disable-next-line max-len
const tabs = crTabs.map((tab) => new Tab(markdownInstance.escapeLinkText(tab.title), tab.url, tab.groupId || TabGroup.NonGroupId));
const tabLists = new TabListGrouper(groups).collectTabsByGroup(tabs);
if (format === 'custom-format') {
Expand Down Expand Up @@ -430,6 +434,7 @@ function parseCustomFormatCommand(command) {
}

async function handleCustomFormatCurrentPage(slot, tab) {
// eslint-disable-next-line no-use-before-define
return handleExportLink({
format: 'custom-format',
customFormatSlot: slot,
Expand All @@ -445,6 +450,7 @@ async function handleCustomFormatLink(slot, menuInfo) {
// TODO: use linkText when Chrome supports it on stable.
const linkText = menuInfo.selectionText || menuInfo.linkText;

// eslint-disable-next-line no-use-before-define
return handleExportLink({
format: 'custom-format',
customFormatSlot: slot,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/custom-format.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Mustache from '../vendor/mustache.mjs';
import Markdown from './markdown.js';

// disable HTML escape
// eslint-disable-next-line func-names
Mustache.escape = function (text) { return text; };

/** @typedef {import('./tabs.js').TabList} TabList */
Expand Down

0 comments on commit ffaa532

Please sign in to comment.