diff --git a/frontend/.husky/post-commit b/frontend/.husky/post-commit new file mode 100644 index 0000000000..1fc985a62c --- /dev/null +++ b/frontend/.husky/post-commit @@ -0,0 +1,2 @@ +# .husky/post-commit +git update-index --again diff --git a/frontend/.husky/pre-commit b/frontend/.husky/pre-commit new file mode 100644 index 0000000000..66b0f0b08f --- /dev/null +++ b/frontend/.husky/pre-commit @@ -0,0 +1,3 @@ +# .husky/pre-commit +npx --no-install lint-staged +lint-staged diff --git a/frontend/.huskyrc.js b/frontend/.huskyrc.js deleted file mode 100644 index a726cc283f..0000000000 --- a/frontend/.huskyrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - hooks: { - 'pre-commit': 'lint-staged', - 'post-commit': 'git update-index --again', - }, -}; diff --git a/frontend/app/common/fetcher.test.ts b/frontend/app/common/fetcher.test.ts index ef7626bccb..3035837eb6 100644 --- a/frontend/app/common/fetcher.test.ts +++ b/frontend/app/common/fetcher.test.ts @@ -108,14 +108,11 @@ describe('fetcher', () => { // Check if `activeJwtToken` saved and clean mockFetch({ headers, status: 401 }); - await apiFetcher - .get(apiUri) - .then(() => { + await expect( + apiFetcher.get(apiUri).then(() => { throw Error('apiFether shoud throw error on 401 responce'); }) - .catch((e) => { - expect(e.message).toBe('Not authorized.'); - }); + ).rejects.toEqual(new Error('Not authorized.')); expect(window.fetch).toHaveBeenCalledWith(apiUrl, { method: 'get', diff --git a/frontend/app/components/auth-panel/auth-panel.tsx b/frontend/app/components/auth-panel/auth-panel.tsx index 5000454926..3970ec13f3 100644 --- a/frontend/app/components/auth-panel/auth-panel.tsx +++ b/frontend/app/components/auth-panel/auth-panel.tsx @@ -197,7 +197,7 @@ export class AuthPanel extends Component { onBlur={this.onSortBlur} > {sortArray.map((sort) => ( - ))} diff --git a/frontend/app/components/auth/components/oauth.tsx b/frontend/app/components/auth/components/oauth.tsx index 6752ae9fa7..7b46a02acd 100644 --- a/frontend/app/components/auth/components/oauth.tsx +++ b/frontend/app/components/auth/components/oauth.tsx @@ -45,7 +45,7 @@ export default function OAuthProviders({ providers }: Props) { const { name, icon } = getProviderData(p, theme); return ( -
  • +
  • = ({ u theme={theme} > {items.map(([href, label]) => ( - + {label} diff --git a/frontend/app/components/comment-form/text-expander.tsx b/frontend/app/components/comment-form/text-expander.tsx index b11a683b19..ac9718fb7a 100644 --- a/frontend/app/components/comment-form/text-expander.tsx +++ b/frontend/app/components/comment-form/text-expander.tsx @@ -19,18 +19,17 @@ function SuggestionList({ items, theme }: { items: Array; theme: Theme }) return (
      - {items.map(({ key, emoji }: Emoji) => { - return ( -
    • - {emoji} {key} -
    • - ); - })} + {items.map(({ key, emoji }: Emoji) => ( +
    • + {emoji} {key} +
    • + ))}
    ); } diff --git a/frontend/app/components/comment/comment.tsx b/frontend/app/components/comment/comment.tsx index 8b303d39ed..106a6a0663 100644 --- a/frontend/app/components/comment/comment.tsx +++ b/frontend/app/components/comment/comment.tsx @@ -507,7 +507,9 @@ class Comment extends Component { {blockingDurations.map((block) => ( - + ))} @@ -791,6 +793,7 @@ class Comment extends Component { (editable || isEditing) && props.view === 'main' && [ , !isAdmin && (