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

View File

@@ -57,7 +57,6 @@
"devDependencies": {
"@faker-js/faker": "^7.6.0",
"@types/cookie": "^0.5.1",
"@types/ejs": "^3.1.2",
"@types/jsonwebtoken": "^9.0.2",
"@types/lodash": "^4.14.194",
"@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) => {
await sendUpdatePasswordRequest(data)
await sendUpdatePasswordRequest(data);
reset();
};

View File

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

View File

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

View File

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

View File

@@ -68,9 +68,8 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
const isLastComment = index === comments.length - 1;
/**
* Attach a ref to the last comment in the list. When it comes
* into view, the component will call setSize to load more
* comments.
* Attach a ref to the last comment in the list. When it comes into view, the
* component will call setSize to load more comments.
*/
return (
<div
@@ -89,17 +88,16 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
{
/**
* If there are more comments to load, show a loading component
* with a skeleton loader and a loading spinner.
* If there are more comments to load, show a loading component with a
* skeleton loader and a loading spinner.
*/
!!isLoadingMore && <LoadingComponent length={pageSize} />
}
{
/**
* If the user has scrolled to the end of the comments, show a
* button that will scroll them back to the top of the comments
* section.
* If the user has scrolled to the end of the comments, show a button that
* will scroll them back to the top of the comments section.
*/
!!isAtEnd && (
<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})`) => {
/**
* Initialize the matches state variable to false. This is updated whenever the
* viewport size changes (i.e. when the component is mounted and when the window is
* resized)
* Initialize the matches state variable to false. This is updated whenever the viewport
* size changes (i.e. when the component is mounted and when the window is resized)
*/
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`
* state variable whenever the viewport size changes.
* Add a resize event listener to the window object, and update the `matches` state
* variable whenever the viewport size changes.
*/
const listener = () => setMatches(media.matches);
window.addEventListener('resize', listener);