Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Fix linting issues (#1404)

Leendert de Borstad4546d040db
diff --git a/apps/browser-extension/src/entrypoints/popup/App.tsx b/apps/browser-extension/src/entrypoints/popup/App.tsx
index 969ffcbfa..de99a294c 100644
--- a/apps/browser-extension/src/entrypoints/popup/App.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/App.tsx
@@ -22,11 +22,11 @@ import CredentialsList from '@/entrypoints/popup/pages/credentials/CredentialsLi
import ItemAddEdit from '@/entrypoints/popup/pages/credentials/ItemAddEdit';
import ItemDetails from '@/entrypoints/popup/pages/credentials/ItemDetails';
import ItemTypeSelector from '@/entrypoints/popup/pages/credentials/ItemTypeSelector';
-import ItemsList from '@/entrypoints/popup/pages/items/ItemsList';
-import RecentlyDeleted from '@/entrypoints/popup/pages/items/RecentlyDeleted';
import EmailDetails from '@/entrypoints/popup/pages/emails/EmailDetails';
import EmailsList from '@/entrypoints/popup/pages/emails/EmailsList';
import Index from '@/entrypoints/popup/pages/Index';
+import ItemsList from '@/entrypoints/popup/pages/items/ItemsList';
+import RecentlyDeleted from '@/entrypoints/popup/pages/items/RecentlyDeleted';
import PasskeyAuthenticate from '@/entrypoints/popup/pages/passkeys/PasskeyAuthenticate';
import PasskeyCreate from '@/entrypoints/popup/pages/passkeys/PasskeyCreate';
import Reinitialize from '@/entrypoints/popup/pages/Reinitialize';
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Credentials/Details/FieldHistoryModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Credentials/Details/FieldHistoryModal.tsx
index 6064bbcbe..999cde866 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Credentials/Details/FieldHistoryModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Credentials/Details/FieldHistoryModal.tsx
@@ -59,6 +59,9 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({
return null;
}
+ /**
+ * Toggle the visibility of a field value in the history modal.
+ */
const toggleValueVisibility = (historyId: string): void => {
setVisibleValues(prev => {
const newSet = new Set(prev);
@@ -71,6 +74,9 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({
});
};
+ /**
+ * Copy a field value to the clipboard.
+ */
const copyToClipboard = async (value: string): Promise<void> => {
try {
await navigator.clipboard.writeText(value);
@@ -79,6 +85,9 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({
}
};
+ /**
+ * Format a date string to a human readable format.
+ */
const formatDate = (dateString: string): string => {
try {
const date = new Date(dateString);
@@ -94,6 +103,9 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({
}
};
+ /**
+ * Parse a value snapshot into an array of values.
+ */
const parseValueSnapshot = (snapshot: string): string[] => {
try {
return JSON.parse(snapshot);
@@ -141,8 +153,10 @@ const FieldHistoryModal: React.FC<FieldHistoryModalProps> = ({
<div className="space-y-3">
{history.map((record) => {
const values = parseValueSnapshot(record.ValueSnapshot);
- // For hidden fields, check if this record is explicitly set to visible
- // For non-hidden fields, always show values (no toggle needed)
+ /**
+ * For hidden fields, check if this record is explicitly set to visible
+ * For non-hidden fields, always show values (no toggle needed)
+ */
const isVisible = shouldMaskByDefault ? visibleValues.has(record.Id) : true;
return (
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderModal.tsx
index ca79d29cd..cbc87c19b 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Folders/FolderModal.tsx
@@ -31,7 +31,10 @@ const FolderModal: React.FC<FolderModalProps> = ({
}
}, [isOpen, initialName]);
- const handleSubmit = async (e: React.FormEvent) => {
+ /**
+ * Handle the form submission.
+ */
+ const handleSubmit = async (e: React.FormEvent): Promise<void> => {
e.preventDefault();
const trimmedName = folderName.trim();
@@ -54,7 +57,10 @@ const FolderModal: React.FC<FolderModalProps> = ({
}
};
- const handleKeyDown = (e: React.KeyboardEvent) => {
+ /**
+ * Handle the escape key press.
+ */
+ const handleKeyDown = (e: React.KeyboardEvent): void => {
if (e.key === 'Escape') {
onClose();
}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Forms/EditableFieldLabel.tsx b/apps/browser-extension/src/entrypoints/popup/components/Forms/EditableFieldLabel.tsx
index 6546c800e..6771360de 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Forms/EditableFieldLabel.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Forms/EditableFieldLabel.tsx
@@ -20,19 +20,28 @@ const EditableFieldLabel: React.FC<EditableFieldLabelProps> = ({
const [isEditing, setIsEditing] = useState(false);
const [editValue, setEditValue] = useState(label);
- const handleSave = () => {
+ /**
+ * Handle the save action.
+ */
+ const handleSave = (): void => {
if (editValue.trim()) {
onLabelChange(editValue.trim());
setIsEditing(false);
}
};
- const handleCancel = () => {
+ /**
+ * Handle the cancel action.
+ */
+ const handleCancel = (): void => {
setEditValue(label);
setIsEditing(false);
};
- const handleKeyDown = (e: React.KeyboardEvent) => {
+ /**
+ * Handle the key down event.
+ */
+ const handleKeyDown = (e: React.KeyboardEvent): void => {
if (e.key === 'Enter') {
handleSave();
} else if (e.key === 'Escape') {
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx
index 391d9ec5c..72f4e1e26 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Items/ItemCard.tsx
@@ -2,8 +2,8 @@ import React from 'react';
import { useNavigate } from 'react-router-dom';
import type { Item } from '@/utils/dist/shared/models/vault';
-import SqliteClient from '@/utils/SqliteClient';
import { FieldKey } from '@/utils/dist/shared/models/vault';
+import SqliteClient from '@/utils/SqliteClient';
type ItemCardProps = {
item: Item;