Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yakov116 committed Feb 14, 2021
1 parent 64344f9 commit 7e3fcf7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions source/features/collapsible-content-button.tsx
Expand Up @@ -8,8 +8,8 @@ import * as textFieldEdit from 'text-field-edit';
import features from '.';
import smartBlockWrap from '../helpers/smart-block-wrap';

function addContentToDetails(event: delegate.Event<MouseEvent, HTMLButtonElement>): void {
const field = event.delegateTarget.form!.querySelector('textarea')!;
function addContentToDetails({delegateTarget}: delegate.Event<MouseEvent, HTMLButtonElement>): void {
const field = delegateTarget.form!.querySelector('textarea')!;
const selection = field.value.slice(field.selectionStart, field.selectionEnd);

// Don't indent <summary> because indentation will not be automatic on multi-line content
Expand Down
6 changes: 3 additions & 3 deletions source/features/conflict-marker.tsx
Expand Up @@ -15,10 +15,10 @@ interface PRConfig {
key: string;
}

function createQueryFragment(pr: PRConfig): string {
function createQueryFragment({key, user, repo, number}: PRConfig): string {
return `
${pr.key}: repository(owner: "${pr.user}", name: "${pr.repo}") {
pullRequest(number: ${pr.number}) {
${key}: repository(owner: "${user}", name: "${repo}") {
pullRequest(number: ${number}) {
mergeable
}
}
Expand Down
10 changes: 5 additions & 5 deletions source/features/embed-gist-inline.tsx
Expand Up @@ -5,14 +5,14 @@ import * as pageDetect from 'github-url-detection';

import features from '.';

const isGist = (link: HTMLAnchorElement): boolean =>
!link.pathname.includes('.') && // Exclude links to embed files
const isGist = ({pathname, hostname}: HTMLAnchorElement): boolean =>
!pathname.includes('.') && // Exclude links to embed files
(
(link.hostname.startsWith('gist.') && link.pathname.includes('/', 1)) || // Exclude user links
link.pathname.startsWith('gist/')
(hostname.startsWith('gist.') && pathname.includes('/', 1)) || // Exclude user links
pathname.startsWith('gist/')
);

const isOnlyChild = (link: HTMLAnchorElement): boolean => link.textContent!.trim() === link.parentNode!.textContent!.trim();
const isOnlyChild = ({textContent, parentNode}: HTMLAnchorElement): boolean => textContent!.trim() === parentNode!.textContent!.trim();

async function embedGist(link: HTMLAnchorElement): Promise<void> {
const info = <em> (loading)</em>;
Expand Down
4 changes: 2 additions & 2 deletions source/features/fit-textareas.tsx
Expand Up @@ -7,8 +7,8 @@ import * as pageDetect from 'github-url-detection';
import features from '.';
import onPrMergePanelOpen from '../github-events/on-pr-merge-panel-open';

function inputListener(event: Event): void {
fitTextarea(event.target as HTMLTextAreaElement);
function inputListener({target}: Event): void {
fitTextarea(target as HTMLTextAreaElement);
}

function watchTextarea(textarea: HTMLTextAreaElement): void {
Expand Down
4 changes: 2 additions & 2 deletions source/github-events/on-new-comments.ts
Expand Up @@ -30,8 +30,8 @@ function removeListeners(): void {
}

function getFragmentLoadHandler(callback: EventListener): delegate.EventHandler {
return (event: delegate.Event) => {
event.delegateTarget.addEventListener('load', callback);
return ({delegateTarget}) => {
delegateTarget.addEventListener('load', callback);
};
}

Expand Down

0 comments on commit 7e3fcf7

Please sign in to comment.