Skip to content

Commit

Permalink
Disable promise-function-async rule instead
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Aug 29, 2019
1 parent f79822e commit 2036c3e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"extends": "xo-typescript",
"rules": {
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
Expand Down
2 changes: 1 addition & 1 deletion source/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'webext-dynamic-content-scripts';
import addDomainPermissionToggle from 'webext-domain-permission-toggle';
import './options-storage';

browser.runtime.onMessage.addListener(async (message, {tab}) => {
browser.runtime.onMessage.addListener((message, {tab}) => {
if (message && Array.isArray(message.openUrls)) {
for (const [i, url] of (message.openUrls as string[]).entries()) {
browser.tabs.create({
Expand Down
2 changes: 1 addition & 1 deletion source/features/forked-to.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function save(forks: string[]): Promise<void> {
return cache.set(getCacheKey(), forks, 10);
}

async function saveAllForks(): Promise<void> {
function saveAllForks(): void {
const forks = select
.all('details-dialog[src*="/fork"] .octicon-repo-forked')
.map(({nextSibling}) => nextSibling!.textContent!.trim());
Expand Down
2 changes: 1 addition & 1 deletion source/features/show-names.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ features.add({
features.isDashboard
],
load: features.onDomReady,
init: async () => onNewsfeedLoad(init)
init: () => onNewsfeedLoad(init)
});

features.add({
Expand Down
4 changes: 2 additions & 2 deletions source/libs/features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ const add = async (definition: FeatureDetails): Promise<void> => {
return result;
};

onAjaxedPages(async () => run(details));
onAjaxedPages(() => run(details));
} else if (load instanceof Promise) {
await load;
run(details);
} else {
load(async () => run(details));
load(() => run(details));
}
};

Expand Down
1 change: 1 addition & 0 deletions source/libs/on-new-comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const observed = new WeakSet();

const run = debounce(() => {
// Safely run all callbacks
// eslint-disable-next-line @typescript-eslint/require-await
handlers.forEach(async cb => cb());
}, {wait: 200});

Expand Down

0 comments on commit 2036c3e

Please sign in to comment.