diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..5b429c3 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "none", + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "endOfLine": "auto" +} diff --git a/package.json b/package.json index 6d1ea04..75a6c85 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "eslint . --fix --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "formatter:check": "npx prettier --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", + "formatter:fix": "npx prettier --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "preview": "vite preview" }, "dependencies": { diff --git a/src/App.tsx b/src/App.tsx index 6b2a50d..58f0c71 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -67,7 +67,7 @@ const App = () => { })} { const isAuthenticated = authState?.loggedIn === true return ( - + - Logo navigate('/')} /> + Logo navigate('/')} /> @@ -99,7 +99,7 @@ export const AppBar = () => { onClick={() => { navigate(appPublicRoutes.login) }} - variant='contained' + variant="contained" > Sign in @@ -113,7 +113,7 @@ export const AppBar = () => { handleClick={handleOpenUserMenu} /> { display: { md: 'none' } }} > - {username} + {username} { { return ( user-avatar { }} /> { if (res.status === 'rejected') { - failedPublishes.push( - { - relay: relays[index], - error: res.reason.message - } - ) + failedPublishes.push({ + relay: relays[index], + error: res.reason.message + }) } }) diff --git a/src/layouts/Main.tsx b/src/layouts/Main.tsx index 8d1bd81..b452354 100644 --- a/src/layouts/Main.tsx +++ b/src/layouts/Main.tsx @@ -59,13 +59,13 @@ export const MainLayout = () => { setIsLoading(false) }, [dispatch]) - if (isLoading) return + if (isLoading) return return ( <> - + { <> {isLoading && } - + Select encrypted zip file @@ -104,11 +104,11 @@ export const DecryptZip = () => { > {isDraggingOver && ( - Drop file here + Drop file here )} setSelectedFile(value)} InputProps={{ @@ -119,8 +119,8 @@ export const DecryptZip = () => { /> setEncryptionKey(e.target.value)} /> @@ -129,7 +129,7 @@ export const DecryptZip = () => { diff --git a/src/pages/landing/LandingPage.tsx b/src/pages/landing/LandingPage.tsx index 5a03ddb..9a24f04 100644 --- a/src/pages/landing/LandingPage.tsx +++ b/src/pages/landing/LandingPage.tsx @@ -57,7 +57,7 @@ export const LandingPage = () => { ? theme.palette.getContrastText(bodyBackgroundColor) : '' }} - variant='h4' + variant="h4" > What is Nostr? @@ -67,14 +67,14 @@ export const LandingPage = () => { ? theme.palette.getContrastText(bodyBackgroundColor) : '' }} - variant='body1' + variant="body1" > Nostr is a decentralised messaging protocol where YOU own your identity. To get started, you must have an existing{' '} Nostr account @@ -95,7 +95,7 @@ export const LandingPage = () => {