format: format codebase to prettier schema

This commit is contained in:
Aaron William Po
2023-05-28 20:05:49 -04:00
parent f4e6a307f2
commit 2b026b7e5f
8 changed files with 43 additions and 39 deletions

26
package-lock.json generated
View File

@@ -31,7 +31,6 @@
"multer-storage-cloudinary": "^4.0.0", "multer-storage-cloudinary": "^4.0.0",
"next": "^13.3.4", "next": "^13.3.4",
"next-connect": "^1.0.0-next.3", "next-connect": "^1.0.0-next.3",
"onchange": "^7.1.0",
"passport": "^0.6.0", "passport": "^0.6.0",
"passport-local": "^1.0.0", "passport-local": "^1.0.0",
"pino": "^8.12.0", "pino": "^8.12.0",
@@ -74,6 +73,7 @@
"eslint-config-next": "^13.3.4", "eslint-config-next": "^13.3.4",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-react": "^7.32.2", "eslint-plugin-react": "^7.32.2",
"onchange": "^7.1.0",
"postcss": "^8.4.23", "postcss": "^8.4.23",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"prettier-plugin-jsdoc": "^0.4.2", "prettier-plugin-jsdoc": "^0.4.2",
@@ -206,12 +206,14 @@
"node_modules/@blakeembrey/deque": { "node_modules/@blakeembrey/deque": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/@blakeembrey/deque/-/deque-1.0.5.tgz", "resolved": "https://registry.npmjs.org/@blakeembrey/deque/-/deque-1.0.5.tgz",
"integrity": "sha512-6xnwtvp9DY1EINIKdTfvfeAtCYw4OqBZJhtiqkT3ivjnEfa25VQ3TsKvaFfKm8MyGIEfE95qLe+bNEt3nB0Ylg==" "integrity": "sha512-6xnwtvp9DY1EINIKdTfvfeAtCYw4OqBZJhtiqkT3ivjnEfa25VQ3TsKvaFfKm8MyGIEfE95qLe+bNEt3nB0Ylg==",
"dev": true
}, },
"node_modules/@blakeembrey/template": { "node_modules/@blakeembrey/template": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@blakeembrey/template/-/template-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@blakeembrey/template/-/template-1.1.0.tgz",
"integrity": "sha512-iZf+UWfL+DogJVpd/xMQyP6X6McYd6ArdYoPMiv/zlOTzeXXfQbYxBNJJBF6tThvsjLMbA8tLjkCdm9RWMFCCw==" "integrity": "sha512-iZf+UWfL+DogJVpd/xMQyP6X6McYd6ArdYoPMiv/zlOTzeXXfQbYxBNJJBF6tThvsjLMbA8tLjkCdm9RWMFCCw==",
"dev": true
}, },
"node_modules/@cspotcode/source-map-support": { "node_modules/@cspotcode/source-map-support": {
"version": "0.8.1", "version": "0.8.1",
@@ -8303,6 +8305,7 @@
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/onchange/-/onchange-7.1.0.tgz", "resolved": "https://registry.npmjs.org/onchange/-/onchange-7.1.0.tgz",
"integrity": "sha512-ZJcqsPiWUAUpvmnJri5TPBooqJOPmC0ttN65juhN15Q8xA+Nbg3BaxBHXQ45EistKKlKElb0edmbPWnKSBkvMg==", "integrity": "sha512-ZJcqsPiWUAUpvmnJri5TPBooqJOPmC0ttN65juhN15Q8xA+Nbg3BaxBHXQ45EistKKlKElb0edmbPWnKSBkvMg==",
"dev": true,
"dependencies": { "dependencies": {
"@blakeembrey/deque": "^1.0.5", "@blakeembrey/deque": "^1.0.5",
"@blakeembrey/template": "^1.0.0", "@blakeembrey/template": "^1.0.0",
@@ -8319,7 +8322,8 @@
"node_modules/onchange/node_modules/arg": { "node_modules/onchange/node_modules/arg": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
}, },
"node_modules/onetime": { "node_modules/onetime": {
"version": "5.1.2", "version": "5.1.2",
@@ -10778,6 +10782,7 @@
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
"dev": true,
"bin": { "bin": {
"tree-kill": "cli.js" "tree-kill": "cli.js"
} }
@@ -11713,12 +11718,14 @@
"@blakeembrey/deque": { "@blakeembrey/deque": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/@blakeembrey/deque/-/deque-1.0.5.tgz", "resolved": "https://registry.npmjs.org/@blakeembrey/deque/-/deque-1.0.5.tgz",
"integrity": "sha512-6xnwtvp9DY1EINIKdTfvfeAtCYw4OqBZJhtiqkT3ivjnEfa25VQ3TsKvaFfKm8MyGIEfE95qLe+bNEt3nB0Ylg==" "integrity": "sha512-6xnwtvp9DY1EINIKdTfvfeAtCYw4OqBZJhtiqkT3ivjnEfa25VQ3TsKvaFfKm8MyGIEfE95qLe+bNEt3nB0Ylg==",
"dev": true
}, },
"@blakeembrey/template": { "@blakeembrey/template": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@blakeembrey/template/-/template-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@blakeembrey/template/-/template-1.1.0.tgz",
"integrity": "sha512-iZf+UWfL+DogJVpd/xMQyP6X6McYd6ArdYoPMiv/zlOTzeXXfQbYxBNJJBF6tThvsjLMbA8tLjkCdm9RWMFCCw==" "integrity": "sha512-iZf+UWfL+DogJVpd/xMQyP6X6McYd6ArdYoPMiv/zlOTzeXXfQbYxBNJJBF6tThvsjLMbA8tLjkCdm9RWMFCCw==",
"dev": true
}, },
"@cspotcode/source-map-support": { "@cspotcode/source-map-support": {
"version": "0.8.1", "version": "0.8.1",
@@ -17510,6 +17517,7 @@
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/onchange/-/onchange-7.1.0.tgz", "resolved": "https://registry.npmjs.org/onchange/-/onchange-7.1.0.tgz",
"integrity": "sha512-ZJcqsPiWUAUpvmnJri5TPBooqJOPmC0ttN65juhN15Q8xA+Nbg3BaxBHXQ45EistKKlKElb0edmbPWnKSBkvMg==", "integrity": "sha512-ZJcqsPiWUAUpvmnJri5TPBooqJOPmC0ttN65juhN15Q8xA+Nbg3BaxBHXQ45EistKKlKElb0edmbPWnKSBkvMg==",
"dev": true,
"requires": { "requires": {
"@blakeembrey/deque": "^1.0.5", "@blakeembrey/deque": "^1.0.5",
"@blakeembrey/template": "^1.0.0", "@blakeembrey/template": "^1.0.0",
@@ -17523,7 +17531,8 @@
"arg": { "arg": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
} }
} }
}, },
@@ -19256,7 +19265,8 @@
"tree-kill": { "tree-kill": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==" "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
"dev": true
}, },
"tree-node-cli": { "tree-node-cli": {
"version": "1.6.0", "version": "1.6.0",

View File

@@ -57,7 +57,6 @@
"devDependencies": { "devDependencies": {
"@faker-js/faker": "^7.6.0", "@faker-js/faker": "^7.6.0",
"@types/cookie": "^0.5.1", "@types/cookie": "^0.5.1",
"@types/ejs": "^3.1.2",
"@types/jsonwebtoken": "^9.0.2", "@types/jsonwebtoken": "^9.0.2",
"@types/lodash": "^4.14.194", "@types/lodash": "^4.14.194",
"@types/mapbox__mapbox-sdk": "^0.13.4", "@types/mapbox__mapbox-sdk": "^0.13.4",

View File

@@ -19,7 +19,7 @@ const Security: FunctionComponent = () => {
}); });
const onSubmit: SubmitHandler<z.infer<typeof UpdatePasswordSchema>> = async (data) => { const onSubmit: SubmitHandler<z.infer<typeof UpdatePasswordSchema>> = async (data) => {
await sendUpdatePasswordRequest(data) await sendUpdatePasswordRequest(data);
reset(); reset();
}; };

View File

@@ -67,8 +67,8 @@ const BeerPostCommentsSection: FC<BeerPostCommentsSectionProps> = ({ beerPost })
{ {
/** /**
* If the comments are loading, show a loading component. Otherwise, show * If the comments are loading, show a loading component. Otherwise, show the
* the comments. * comments.
*/ */
isLoading ? ( isLoading ? (
<div className="card bg-base-300 pb-6"> <div className="card bg-base-300 pb-6">

View File

@@ -19,8 +19,8 @@ const BeerRecommendationsSection: FC<{
const { ref: penultimateBeerPostRef } = useInView({ const { ref: penultimateBeerPostRef } = useInView({
/** /**
* When the last beer post comes into view, call setSize from * When the last beer post comes into view, call setSize from useBeerPostsByBrewery to
* useBeerPostsByBrewery to load more beer posts. * load more beer posts.
*/ */
onChange: (visible) => { onChange: (visible) => {
if (!visible || isAtEnd) return; if (!visible || isAtEnd) return;
@@ -46,9 +46,8 @@ const BeerRecommendationsSection: FC<{
const isPenultimateBeerPost = index === beerPosts.length - 2; const isPenultimateBeerPost = index === beerPosts.length - 2;
/** /**
* Attach a ref to the second last beer post in the list. * Attach a ref to the second last beer post in the list. When it comes
* When it comes into view, the component will call * into view, the component will call setSize to load more beer posts.
* setSize to load more beer posts.
*/ */
return ( return (
@@ -86,8 +85,8 @@ const BeerRecommendationsSection: FC<{
{ {
/** /**
* If there are more beer posts to load, show a loading component * If there are more beer posts to load, show a loading component with a
* with a skeleton loader and a loading spinner. * skeleton loader and a loading spinner.
*/ */
!!isLoadingMore && !isAtEnd && ( !!isLoadingMore && !isAtEnd && (
<BeerRecommendationLoadingComponent length={PAGE_SIZE} /> <BeerRecommendationLoadingComponent length={PAGE_SIZE} />

View File

@@ -22,8 +22,8 @@ const BreweryBeersSection: FC<BreweryCommentsSectionProps> = ({ breweryPost }) =
}); });
const { ref: penultimateBeerPostRef } = useInView({ const { ref: penultimateBeerPostRef } = useInView({
/** /**
* When the last beer post comes into view, call setSize from * When the last beer post comes into view, call setSize from useBeerPostsByBrewery to
* useBeerPostsByBrewery to load more beer posts. * load more beer posts.
*/ */
onChange: (visible) => { onChange: (visible) => {
if (!visible || isAtEnd) return; if (!visible || isAtEnd) return;
@@ -60,9 +60,8 @@ const BreweryBeersSection: FC<BreweryCommentsSectionProps> = ({ breweryPost }) =
const isPenultimateBeerPost = index === beerPosts.length - 2; const isPenultimateBeerPost = index === beerPosts.length - 2;
/** /**
* Attach a ref to the second last beer post in the list. * Attach a ref to the second last beer post in the list. When it comes
* When it comes into view, the component will call * into view, the component will call setSize to load more beer posts.
* setSize to load more beer posts.
*/ */
return ( return (
@@ -91,8 +90,8 @@ const BreweryBeersSection: FC<BreweryCommentsSectionProps> = ({ breweryPost }) =
{ {
/** /**
* If there are more beer posts to load, show a loading component * If there are more beer posts to load, show a loading component with a
* with a skeleton loader and a loading spinner. * skeleton loader and a loading spinner.
*/ */
!!isLoadingMore && !isAtEnd && ( !!isLoadingMore && !isAtEnd && (
<BeerRecommendationLoadingComponent length={PAGE_SIZE} /> <BeerRecommendationLoadingComponent length={PAGE_SIZE} />

View File

@@ -68,9 +68,8 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
const isLastComment = index === comments.length - 1; const isLastComment = index === comments.length - 1;
/** /**
* Attach a ref to the last comment in the list. When it comes * Attach a ref to the last comment in the list. When it comes into view, the
* into view, the component will call setSize to load more * component will call setSize to load more comments.
* comments.
*/ */
return ( return (
<div <div
@@ -89,17 +88,16 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
{ {
/** /**
* If there are more comments to load, show a loading component * If there are more comments to load, show a loading component with a
* with a skeleton loader and a loading spinner. * skeleton loader and a loading spinner.
*/ */
!!isLoadingMore && <LoadingComponent length={pageSize} /> !!isLoadingMore && <LoadingComponent length={pageSize} />
} }
{ {
/** /**
* If the user has scrolled to the end of the comments, show a * If the user has scrolled to the end of the comments, show a button that
* button that will scroll them back to the top of the comments * will scroll them back to the top of the comments section.
* section.
*/ */
!!isAtEnd && ( !!isAtEnd && (
<div className="flex h-20 items-center justify-center text-center"> <div className="flex h-20 items-center justify-center text-center">

View File

@@ -18,9 +18,8 @@ import { useState, useEffect } from 'react';
*/ */
const useMediaQuery = (query: `(${string})`) => { const useMediaQuery = (query: `(${string})`) => {
/** /**
* Initialize the matches state variable to false. This is updated whenever the * Initialize the matches state variable to false. This is updated whenever the viewport
* viewport size changes (i.e. when the component is mounted and when the window is * size changes (i.e. when the component is mounted and when the window is resized)
* resized)
*/ */
const [matches, setMatches] = useState(false); const [matches, setMatches] = useState(false);
@@ -35,8 +34,8 @@ const useMediaQuery = (query: `(${string})`) => {
} }
/** /**
* Add a resize event listener to the window object, and update the `matches` * Add a resize event listener to the window object, and update the `matches` state
* state variable whenever the viewport size changes. * variable whenever the viewport size changes.
*/ */
const listener = () => setMatches(media.matches); const listener = () => setMatches(media.matches);
window.addEventListener('resize', listener); window.addEventListener('resize', listener);