From 687b8be98cbb7ae7765ce85f7dfa66850d206b4a Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 11 Oct 2022 02:07:46 +0000
Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
components/splash/dot-grid.js | 4 ++--
components/splash/use-animation.js | 2 +-
pages/api/checkout_sessions.js | 2 +-
pages/donate.js | 4 ++--
pages/press.js | 6 +++---
pages/sitemap.xml.js | 2 +-
tests/api/checkout_sessions.test.js | 2 +-
utils/rate-limit.js | 2 +-
8 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/components/splash/dot-grid.js b/components/splash/dot-grid.js
index 0f122e70..bdaf4a3b 100644
--- a/components/splash/dot-grid.js
+++ b/components/splash/dot-grid.js
@@ -51,11 +51,11 @@ const Dots = ({ playState, color }) => {
for (col = 0; col < ncols; col++) {
if (random() > 0.3) {
dots1.push(
-
+ ,
)
} else {
dots2.push(
-
+ ,
)
}
}
diff --git a/components/splash/use-animation.js b/components/splash/use-animation.js
index 77bd6234..9a8f3f71 100644
--- a/components/splash/use-animation.js
+++ b/components/splash/use-animation.js
@@ -16,7 +16,7 @@ const useAnimation = ({ duration = 4000, delay = 0 } = {}) => {
clearInterval(tick)
const interval = setInterval(
() => setRepeating((prev) => !prev),
- duration
+ duration,
)
setTick(interval)
}
diff --git a/pages/api/checkout_sessions.js b/pages/api/checkout_sessions.js
index e6d6b62f..64c0c56b 100644
--- a/pages/api/checkout_sessions.js
+++ b/pages/api/checkout_sessions.js
@@ -28,7 +28,7 @@ async function recaptchaHandler(response) {
'Content-Type': 'application/json',
},
referrerPolicy: 'no-referrer',
- }
+ },
)
const { success, 'error-codes': errorCodes } = await result.json()
diff --git a/pages/donate.js b/pages/donate.js
index 7fd6fa8a..43677f6c 100644
--- a/pages/donate.js
+++ b/pages/donate.js
@@ -109,7 +109,7 @@ const CustomAmount = ({ color, onClick }) => {
return !helpMessage
},
- [amount]
+ [amount],
)
return (
@@ -186,7 +186,7 @@ const Donate = () => {
setStatus('processing')
setTimeout(() => {
setStatus((prevStatus) =>
- prevStatus === 'processing' ? null : prevStatus
+ prevStatus === 'processing' ? null : prevStatus,
)
}, 1200)
diff --git a/pages/press.js b/pages/press.js
index 025febd9..80acf43c 100644
--- a/pages/press.js
+++ b/pages/press.js
@@ -67,7 +67,7 @@ const getColors = () => {
colorOrder.reduce((a, c) => {
a[c] = 0
return a
- }, {})
+ }, {}),
)
const recentColors = recentSources.reduce((colors, source, i) => {
@@ -96,7 +96,7 @@ const getColors = () => {
colors[source] ||= colorOrder[i % 4]
return colors
},
- { ...highlightColors, ...recentColors }
+ { ...highlightColors, ...recentColors },
)
}
@@ -126,7 +126,7 @@ const Press = () => {
const inYear = year[new Date(d.date.replace(/-/g, '/')).getFullYear()]
const inFormat = format[d.format]
return inYear && inFormat
- })
+ }),
)
}, [year, format])
diff --git a/pages/sitemap.xml.js b/pages/sitemap.xml.js
index 681174aa..4b7a90e6 100644
--- a/pages/sitemap.xml.js
+++ b/pages/sitemap.xml.js
@@ -56,7 +56,7 @@ export async function getServerSideProps({ res }) {
])
const [research, blog] = await Promise.all(
- requests.map((request) => request.json())
+ requests.map((request) => request.json()),
)
const sitemap = generateSiteMap(research.concat(blog))
diff --git a/tests/api/checkout_sessions.test.js b/tests/api/checkout_sessions.test.js
index 776585ce..267b9aa8 100644
--- a/tests/api/checkout_sessions.test.js
+++ b/tests/api/checkout_sessions.test.js
@@ -60,7 +60,7 @@ describe('api/checkout_sessions', () => {
expect(fetch).toHaveBeenCalledTimes(1)
expect(fetch).toHaveBeenCalledWith(
`https://www.google.com/recaptcha/api/siteverify?secret=${process.env.RECAPTCHA_SECRET_KEY}&response=recaptcha_response`,
- expect.anything()
+ expect.anything(),
)
})
diff --git a/utils/rate-limit.js b/utils/rate-limit.js
index b988eb3e..fc99447c 100644
--- a/utils/rate-limit.js
+++ b/utils/rate-limit.js
@@ -23,7 +23,7 @@ const rateLimit = (options) => {
res.setHeader('X-RateLimit-Limit', limit)
res.setHeader(
'X-RateLimit-Remaining',
- isRateLimited ? 0 : limit - currentUsage
+ isRateLimited ? 0 : limit - currentUsage,
)
return isRateLimited ? reject() : resolve()