Skip to content

Commit 306e6f0

Browse files
committed
Fixing bugs and linting errors
1 parent 892d2f6 commit 306e6f0

File tree

13 files changed

+128
-46
lines changed

13 files changed

+128
-46
lines changed

e2e/tests/auth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ test.describe("Auth", () => {
1515
await authPage.enterPassword(process.env.NOT_SO_SECRET_SECRET ?? "");
1616
await authPage.submit();
1717

18-
await expect(await authPage.hasLocalStorageSecret()).toBe(true);
18+
expect(await authPage.hasLocalStorageSecret()).toBe(true);
1919
});
2020

2121
test("shows error for wrong secret", async ({ authPage }) => {
2222
await authPage.enterPassword("wrong-secret");
2323
await authPage.submit();
2424

25-
await expect(await authPage.getErrorMessage()).toBe(
25+
expect(await authPage.getErrorMessage()).toBe(
2626
"😢 Sadly that is not correct.",
2727
);
2828
});

playwright.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { defineConfig, devices } from "@playwright/test";
55
* https://github.com/motdotla/dotenv
66
*/
77
import dotenv from "dotenv";
8-
import path from "node:path";
98
dotenv.config({ path: ".env" });
109

1110
/**

src/common/components/Input/Input.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const Wrapper = ({
1414
return (
1515
<form
1616
onSubmit={RHFHandleSubmit(
17-
handleSubmit || ((data, e) => e?.preventDefault()),
17+
handleSubmit || ((_data, e) => e?.preventDefault()),
1818
)}
1919
>
2020
<Input
@@ -37,7 +37,7 @@ describe("Input", () => {
3737

3838
it("should submit the correct data", async () => {
3939
const user = userEvent.setup();
40-
const handleSubmit = vitest.fn((data, e) => e.preventDefault());
40+
const handleSubmit = vitest.fn((_data, e) => e.preventDefault());
4141
render(<Wrapper handleSubmit={handleSubmit} />);
4242

4343
const input = screen.getByLabelText("Password");

src/common/components/TextInput/TagList/TagList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type {
44
SuggestionProps,
55
} from "@tiptap/suggestion";
66
import { forwardRef, useEffect, useImperativeHandle, useState } from "react";
7-
import type { Tag } from "../../../../interfaces/Tag";
87

98
export const NEW_TAG_PREFIX = 'New tag "';
109
export const getNewTagPhrase = (tag: string) =>

src/common/components/TextInput/TextInput.config.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import ListKeymap from "@tiptap/extension-list-keymap";
22
import Placeholder from "@tiptap/extension-placeholder";
3+
import Document from "@tiptap/extension-document";
4+
import Text from "@tiptap/extension-text";
5+
import Paragraph from "@tiptap/extension-paragraph";
36
import Mention from "@tiptap/extension-mention";
47
import StarterKit from "@tiptap/starter-kit";
58

@@ -10,6 +13,9 @@ import { stringToHue } from "../../../scripts/utils/stringUtils";
1013
import { tagService } from "../../../scripts/db/TagService";
1114

1215
export const extensions = [
16+
// Document,
17+
// Text,
18+
// Paragraph,
1319
StarterKit.configure({
1420
// for now disabling this as it's interfering with the "#" logic of the Mention
1521
// plugin when a user types "#" at the beginning of a line and presses enter.

src/common/components/TextInput/TextInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const TextInput = (props: TextInputProps) => {
2020
role: "textbox",
2121
class: "p-4 min-h-full block w-full bg-white border border-blue-300 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600",
2222
},
23-
handleKeyDown: (view, event) => {
23+
handleKeyDown: (_view, event) => {
2424
if (!onSubmit) {
2525
return false;
2626
}

src/container/SparkInput/SparkInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useRef, useState } from "react";
1+
import { useState } from "react";
22
import { sparkService } from "../../scripts/db/SparkService";
33
import { TextInput } from "../../common/components/TextInput/TextInput";
44
import { ArrowRightStartOnBox } from "../../assets/icons/ArrowRightStartOnBox";

src/scripts/db/SparkService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "../../interfaces/Spark";
88
import { extractTags, stringToHue } from "../utils/stringUtils";
99
import { tagService } from "./TagService";
10-
import type { InsertType } from "dexie";
1110

1211
export class SparkService {
1312
constructor(private db: AppDB) {}
@@ -69,7 +68,7 @@ export class SparkService {
6968

7069
public async CAREFUL_deleteAndImportSparks(sparks: PlainSpark[]) {
7170
await this.CAREFUL_deleteAllData();
72-
await sparks.map((spark) => {
71+
sparks.map((spark) => {
7372
this.db.sparks.add(spark);
7473
});
7574
}

src/scripts/db/TagService.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { InsertType } from "dexie";
2-
import type { PlainTag, Tag } from "../../interfaces/Tag";
1+
import type { PlainTag } from "../../interfaces/Tag";
32
import { stringToHue, toLowerCase } from "../utils/stringUtils";
43
import type AppDB from "./AppDB";
54
import { db } from "./AppDB";
@@ -49,7 +48,7 @@ export class TagService {
4948

5049
public async CAREFUL_deleteAndImportTags(tags: PlainTag[]) {
5150
await this.CAREFUL_deleteAllData();
52-
await tags.map((tag) => {
51+
tags.map((tag) => {
5352
this.db.tags.add(tag);
5453
});
5554
}

src/scripts/files/backupJSONWorker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Backup, BackupV6 } from "../../interfaces/Backup";
1+
import type { BackupV6 } from "../../interfaces/Backup";
22
import { sparkService } from "../db/SparkService";
33
import { tagService } from "../db/TagService";
44

0 commit comments

Comments
 (0)