diff --git a/package.json b/package.json
index de110e04..f15b71c0 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,7 @@
"eslint-plugin-react-hooks": "4.6.0",
"husky": "8.0.3",
"lint-staged": "14.0.1",
- "prettier": "2.8.8",
+ "prettier": "3.0.3",
"ts-node": "10.9.1",
"typescript": "5.2.2",
"web-ext": "7.8.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 152b8335..c7287e36 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -95,8 +95,8 @@ devDependencies:
specifier: 14.0.1
version: 14.0.1
prettier:
- specifier: 2.8.8
- version: 2.8.8
+ specifier: 3.0.3
+ version: 3.0.3
ts-node:
specifier: 10.9.1
version: 10.9.1(@types/node@18.18.1)(typescript@5.2.2)
@@ -5398,9 +5398,9 @@ packages:
engines: {node: '>= 0.8.0'}
dev: true
- /prettier@2.8.8:
- resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
- engines: {node: '>=10.13.0'}
+ /prettier@3.0.3:
+ resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==}
+ engines: {node: '>=14'}
hasBin: true
dev: true
diff --git a/src/components/ActionBar.tsx b/src/components/ActionBar.tsx
index 18ad4131..466aa82d 100644
--- a/src/components/ActionBar.tsx
+++ b/src/components/ActionBar.tsx
@@ -49,7 +49,7 @@ export default function ActionBar({
aria-label="Toggle color mode"
icon={useColorModeValue(
,
-
+ ,
)}
onClick={onColorModeClick}
/>
diff --git a/src/components/Card.tsx b/src/components/Card.tsx
index 42a9de6c..01316c10 100644
--- a/src/components/Card.tsx
+++ b/src/components/Card.tsx
@@ -29,7 +29,7 @@ export function Card({ linkData, isInEditMode, onClick }: CardProps) {
isDragEventInProgress: !!monitor.getItem(),
}),
}),
- [id]
+ [id],
);
const conditionalButtonProps = isDragEventInProgress
diff --git a/src/components/Cell.tsx b/src/components/Cell.tsx
index efa5d40e..8be94579 100644
--- a/src/components/Cell.tsx
+++ b/src/components/Cell.tsx
@@ -37,10 +37,10 @@ export default function Cell({
() =>
(!isEmpty &&
links.find(
- (link) => link && getStorageKeyForLink(link) === linkKeys[index]
+ (link) => link && getStorageKeyForLink(link) === linkKeys[index],
)) ||
null,
- [isEmpty, index, links, linkKeys]
+ [isEmpty, index, links, linkKeys],
);
const onClick = React.useCallback(
@@ -53,7 +53,7 @@ export default function Cell({
navigateCurrentTab(link.url);
}
},
- [link?.url]
+ [link?.url],
);
const onKeyDown = React.useCallback(
(event: KeyboardEvent) => {
@@ -67,7 +67,7 @@ export default function Cell({
}
}
},
- [index, isEmpty, isInEditMode, onClick, openUpdateLinkModal]
+ [index, isEmpty, isInEditMode, onClick, openUpdateLinkModal],
);
React.useEffect(() => {
document.addEventListener("keydown", onKeyDown);
@@ -84,7 +84,7 @@ export default function Cell({
onClick={onClick}
/>
),
- [isInEditMode, link, onClick]
+ [isInEditMode, link, onClick],
);
const reorderLinks = useLinkStore((state) => state.reorderLinks);
@@ -104,7 +104,7 @@ export default function Cell({
isOver: monitor.isOver(),
}),
}),
- [index, linkKeys]
+ [index, linkKeys],
);
React.useEffect(() => {
@@ -121,7 +121,7 @@ export default function Cell({
event.preventDefault();
deleteLink(index);
},
- [deleteLink, index]
+ [deleteLink, index],
);
const isLastCellWithCard = index === links.length - 1;
diff --git a/src/components/LinkEditModal.tsx b/src/components/LinkEditModal.tsx
index 3f826a08..6ccbaecc 100644
--- a/src/components/LinkEditModal.tsx
+++ b/src/components/LinkEditModal.tsx
@@ -54,7 +54,7 @@ export default function LinkEditModal({
onClose,
}: LinkEditModalProps) {
const [formValues, setFormValues] = React.useState(
- getFormValuesForLink(link)
+ getFormValuesForLink(link),
);
const onKeyDown = React.useCallback>(
@@ -64,7 +64,7 @@ export default function LinkEditModal({
onClose();
}
},
- [isOpen, onClose]
+ [isOpen, onClose],
);
const populateFormWithTab = React.useCallback(async () => {
@@ -96,7 +96,7 @@ export default function LinkEditModal({
const nameError = name ? "" : "Please enter a name for the link";
setFormValues({ ...formValues, name, nameError });
},
- [formValues, setFormValues]
+ [formValues, setFormValues],
);
const handleLinkUrlChange = React.useCallback<
@@ -108,7 +108,7 @@ export default function LinkEditModal({
const urlError = url ? "" : "Please enter a URL for the link";
setFormValues({ ...formValues, url, urlError });
},
- [formValues, setFormValues]
+ [formValues, setFormValues],
);
const handleImageUrlChange = React.useCallback<
@@ -132,7 +132,7 @@ export default function LinkEditModal({
imageUrlError,
});
},
- [formValues, setFormValues]
+ [formValues, setFormValues],
);
const addLink = useLinkStore((state) => state.addLink);
@@ -153,7 +153,7 @@ export default function LinkEditModal({
: addLink(payload);
onClose();
},
- [addLink, formValues, link, onClose, updateLink]
+ [addLink, formValues, link, onClose, updateLink],
);
return (
diff --git a/src/components/Page.tsx b/src/components/Page.tsx
index 27d9c1ad..0c4ee572 100644
--- a/src/components/Page.tsx
+++ b/src/components/Page.tsx
@@ -28,7 +28,7 @@ export default function Page() {
onLinkEditModalOpen();
}
},
- [onLinkEditModalOpen, toggleEditMode]
+ [onLinkEditModalOpen, toggleEditMode],
);
React.useEffect(() => {
document.addEventListener("keydown", onKeyDown);
diff --git a/src/hooks/useInitializeState.tsx b/src/hooks/useInitializeState.tsx
index 3edebe90..f5c893c3 100644
--- a/src/hooks/useInitializeState.tsx
+++ b/src/hooks/useInitializeState.tsx
@@ -28,7 +28,7 @@ export function useInitializeState() {
if (nextLinkId && linkKeys?.length) {
const storedLinks = parseStoredLinks(
- await browser.storage.local.get(linkKeys)
+ await browser.storage.local.get(linkKeys),
);
const links =
(storedLinks && linkKeys.map((key) => storedLinks[key])) ?? [];
diff --git a/src/lib/links/delete-link.ts b/src/lib/links/delete-link.ts
index 3aece633..3b9c74d4 100644
--- a/src/lib/links/delete-link.ts
+++ b/src/lib/links/delete-link.ts
@@ -3,13 +3,13 @@ import { LinkState } from "@models/link-state";
export function deleteLink(
prevState: LinkState,
- linkKeyIndex: number
+ linkKeyIndex: number,
): LinkState {
const newLinkKeys = [...prevState.linkKeys];
const [deletedLinkKey] = newLinkKeys.splice(linkKeyIndex, 1);
const newLinks = prevState.links.filter(
- (link) => deletedLinkKey !== getStorageKeyForLink(link)
+ (link) => deletedLinkKey !== getStorageKeyForLink(link),
);
setStoredLinksAndKeys(newLinks, newLinkKeys);
diff --git a/src/lib/links/reorder-links.ts b/src/lib/links/reorder-links.ts
index aab952c1..022af23f 100644
--- a/src/lib/links/reorder-links.ts
+++ b/src/lib/links/reorder-links.ts
@@ -11,14 +11,14 @@ export type ReorderLinksData = {
*/
export function reorderLinks(
prevState: LinkState,
- data: ReorderLinksData
+ data: ReorderLinksData,
): LinkState {
const { sourceId } = data;
let { newLinkKeyIndex } = data;
const newLinkKeys = [...prevState.linkKeys];
const oldLinkKeyIndex = newLinkKeys.findIndex(
- (key) => getLinkIdForStorageKey(key) === sourceId
+ (key) => getLinkIdForStorageKey(key) === sourceId,
);
// If dropped in an empty cell, put the card at the end of the array
diff --git a/src/lib/links/update-link.ts b/src/lib/links/update-link.ts
index a2b863db..f69a8993 100644
--- a/src/lib/links/update-link.ts
+++ b/src/lib/links/update-link.ts
@@ -10,7 +10,7 @@ export type UpdateLinkData = {
export function updateLink(
prevState: LinkState,
- data: UpdateLinkData
+ data: UpdateLinkData,
): LinkState {
const { id, name, url, imageUrl } = data;
diff --git a/src/lib/webextension.ts b/src/lib/webextension.ts
index 10e53cfd..9230fbde 100644
--- a/src/lib/webextension.ts
+++ b/src/lib/webextension.ts
@@ -8,7 +8,7 @@ export function setStoredColorMode(colorMode: ColorMode): void {
export function setStoredLinksAndKeys(
links: LinkData[],
- linkKeys: string[]
+ linkKeys: string[],
): void {
setStoredLinkKeys(linkKeys);
setStoredLinks(links);
diff --git a/src/public/index.tsx b/src/public/index.tsx
index 6317f893..c2dd569a 100644
--- a/src/public/index.tsx
+++ b/src/public/index.tsx
@@ -13,5 +13,5 @@ createRoot(domNode).render(
-
+ ,
);
diff --git a/tests/shortcuts.spec.ts b/tests/shortcuts.spec.ts
index d656dbc8..07ba9b0f 100644
--- a/tests/shortcuts.spec.ts
+++ b/tests/shortcuts.spec.ts
@@ -53,7 +53,7 @@ test("can escape new link modal", async ({ page }) => {
await page.keyboard.down("n");
await page.keyboard.down("Escape");
await expect(
- page.getByRole("button", { name: "Create new link" })
+ page.getByRole("button", { name: "Create new link" }),
).toBeVisible();
});
@@ -61,6 +61,6 @@ test("can escape edit link modal", async ({ page }) => {
await page.keyboard.down("e");
await page.keyboard.down("Escape");
await expect(
- page.getByRole("button", { name: "Create new link" })
+ page.getByRole("button", { name: "Create new link" }),
).toBeVisible();
});
diff --git a/tests/smoke.spec.ts b/tests/smoke.spec.ts
index acf9a520..827c6641 100644
--- a/tests/smoke.spec.ts
+++ b/tests/smoke.spec.ts
@@ -2,6 +2,6 @@ import { test, expect } from "@fixtures/extension";
test("new link button is visible", async ({ page }) => {
await expect(
- page.getByRole("button", { name: "Create new link" })
+ page.getByRole("button", { name: "Create new link" }),
).toBeVisible();
});