diff --git a/packages/web/.eslintrc.js b/packages/web/.eslintrc.js index f5d0336..d00a78a 100644 --- a/packages/web/.eslintrc.js +++ b/packages/web/.eslintrc.js @@ -3,5 +3,9 @@ module.exports = { parserOptions: { project: './tsconfig.json', }, - rules: {}, + rules: { + '@typescript-eslint/no-floating-promises': 'off', + 'jsx-a11y/no-autofocus': 'off', + 'jsx-a11y/media-has-caption': 'off', + }, }; diff --git a/packages/web/src/apollo.ts b/packages/web/src/apollo.ts index 931011c..5faa233 100644 --- a/packages/web/src/apollo.ts +++ b/packages/web/src/apollo.ts @@ -14,9 +14,9 @@ let globalClient: ApolloClient | undefined; const errorLink = onError(({ graphQLErrors, networkError }) => { if (graphQLErrors) { - graphQLErrors.forEach(({ message, locations, path }) => - console.log(`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`) - ); + for (const { message, locations, path } of graphQLErrors) { + console.log(`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`); + } } if (networkError) { console.log(`[Network error]: ${networkError.message}`); diff --git a/packages/web/src/components/dropdown/dropdown-tab.tsx b/packages/web/src/components/dropdown/dropdown-tab.tsx index 1670619..386c62f 100644 --- a/packages/web/src/components/dropdown/dropdown-tab.tsx +++ b/packages/web/src/components/dropdown/dropdown-tab.tsx @@ -1,3 +1,5 @@ +/* eslint-disable jsx-a11y/no-static-element-interactions */ +/* eslint-disable jsx-a11y/click-events-have-key-events */ import { Menu } from '@headlessui/react'; import clsx from 'clsx'; import type { FC, ReactNode } from 'react'; diff --git a/packages/web/src/components/embed/variants/embed-image.tsx b/packages/web/src/components/embed/variants/embed-image.tsx index 3cb8feb..88b8a6f 100644 --- a/packages/web/src/components/embed/variants/embed-image.tsx +++ b/packages/web/src/components/embed/variants/embed-image.tsx @@ -39,9 +39,11 @@ EmbedImage.embeddable = (data: Embeddable) => { case 'image/svg+xml': case 'image/webp': case 'image/bmp': - case 'image/tiff': + case 'image/tiff': { return true; - default: + } + default: { return false; + } } }; diff --git a/packages/web/src/components/embed/variants/embed-video.tsx b/packages/web/src/components/embed/variants/embed-video.tsx index 4cec133..ced7422 100644 --- a/packages/web/src/components/embed/variants/embed-video.tsx +++ b/packages/web/src/components/embed/variants/embed-video.tsx @@ -23,9 +23,11 @@ EmbedVideo.embeddable = (data: Embeddable) => { switch (data.type) { case 'video/mp4': case 'video/webm': - case 'video/ogg': + case 'video/ogg': { return true; - default: + } + default: { return false; + } } }; diff --git a/packages/web/src/containers/file-list/file-list.tsx b/packages/web/src/containers/file-list/file-list.tsx index c24ef5a..688233e 100644 --- a/packages/web/src/containers/file-list/file-list.tsx +++ b/packages/web/src/containers/file-list/file-list.tsx @@ -52,21 +52,17 @@ export const FileList: FC = () => { {!source.data && } {filter === 'files' && (
- {files.data?.user.files.edges.map(({ node }) => ( - - ))} + {files.data?.user.files.edges.map(({ node }) => )}
)} {filter === 'pastes' && (
- {pastes.data?.user.pastes.edges.map(({ node }) => ( - - ))} + {pastes.data?.user.pastes.edges.map(({ node }) => )}
)} {!source.loading && !hasContent && ( - You haven't uploaded anything yet. Once you upload something, it will appear here. + You haven't uploaded anything yet. Once you upload something, it will appear here. )} diff --git a/packages/web/src/generated/graphql.tsx b/packages/web/src/generated/graphql.tsx index 41bcdd3..8caf8d6 100644 --- a/packages/web/src/generated/graphql.tsx +++ b/packages/web/src/generated/graphql.tsx @@ -1,5 +1,6 @@ import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; + export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; diff --git a/packages/web/src/helpers/encrypt.helper.ts b/packages/web/src/helpers/encrypt.helper.ts index 841ce90..f66f57a 100644 --- a/packages/web/src/helpers/encrypt.helper.ts +++ b/packages/web/src/helpers/encrypt.helper.ts @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/prefer-code-point */ const ENCRYPTION_ALGORITHM = 'AES-GCM'; const ENCRYPTION_LENGTH = 256; @@ -36,7 +37,7 @@ export async function encryptContent(content: string): Promise length: ENCRYPTION_LENGTH, }, true, - ['encrypt', 'decrypt'] + ['encrypt', 'decrypt'], ); const encryptedContent = await crypto.subtle.encrypt( @@ -45,7 +46,7 @@ export async function encryptContent(content: string): Promise iv, }, key, - new TextEncoder().encode(content) + new TextEncoder().encode(content), ); const ivString = arrayBufferToBase64(iv); @@ -68,7 +69,7 @@ export async function decryptContent(data: EncryptionResult): Promise { name: ENCRYPTION_ALGORITHM, }, true, - ['encrypt', 'decrypt'] + ['encrypt', 'decrypt'], ); const decryptedContent = await crypto.subtle.decrypt( @@ -77,7 +78,7 @@ export async function decryptContent(data: EncryptionResult): Promise { iv: base64ToArrayBuffer(iv), }, key, - base64ToArrayBuffer(encryptedContent) + base64ToArrayBuffer(encryptedContent), ); return new TextDecoder().decode(decryptedContent); diff --git a/packages/web/src/pages/dashboard/mfa.tsx b/packages/web/src/pages/dashboard/mfa.tsx index a169f19..386d6a7 100644 --- a/packages/web/src/pages/dashboard/mfa.tsx +++ b/packages/web/src/pages/dashboard/mfa.tsx @@ -120,7 +120,7 @@ export default function Generate() { such as Google Authenticator and Authy.

- If you can't scan the QR code, you can enter the code{' '} + If you can't scan the QR code, you can enter the code{' '} {result.generateOTP.secret} manually.

@@ -148,7 +148,7 @@ export default function Generate() { disabled={currentStep === 0} className={clsx( `text-gray-400 flex items-center gap-1 hover:underline`, - currentStep === 0 && 'opacity-0 pointer-events-none' + currentStep === 0 && 'opacity-0 pointer-events-none', )} > Back diff --git a/packages/web/src/pages/file/[fileId].tsx b/packages/web/src/pages/file/[fileId].tsx index 389e459..a543a6c 100644 --- a/packages/web/src/pages/file/[fileId].tsx +++ b/packages/web/src/pages/file/[fileId].tsx @@ -22,13 +22,13 @@ const FileOption: FC<{ children: ReactNode; className?: string; onClick: () => v }) => { const classes = clsx( 'flex items-center gap-2 shrink-0 transition-colors duration-100 hover:text-gray-300', - className + className, ); return ( - + ); }; diff --git a/packages/web/src/pages/paste/index.tsx b/packages/web/src/pages/paste/index.tsx index 8344d7c..e182b14 100644 --- a/packages/web/src/pages/paste/index.tsx +++ b/packages/web/src/pages/paste/index.tsx @@ -157,15 +157,15 @@ export default function Paste() { placeholder="Markdown, code or plain text" />
-
- { setFile(null); }} > Cancel - + );