Skip to content

Commit 14303da

Browse files
committed
chore: added biome
1 parent 6e689b0 commit 14303da

File tree

7 files changed

+132
-33
lines changed

7 files changed

+132
-33
lines changed

biome.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"linter": {
7+
"enabled": false
8+
},
9+
"formatter": {
10+
"indentStyle": "space",
11+
"lineWidth": 80
12+
}
13+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"postinstall": "wxt prepare"
1616
},
1717
"devDependencies": {
18+
"@biomejs/biome": "1.8.3",
1819
"@changesets/cli": "^2.27.7",
1920
"@tailwindcss/typography": "^0.5.14",
2021
"@tsconfig/svelte": "^5.0.4",

pnpm-lock.yaml

+91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/entrypoints/gregmat.content/vocab-mountain.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async function showKeybinds() {
7575
if (shown) return;
7676

7777
const container = document.querySelector(
78-
".flex.w-full.flex-row.flex-wrap.justify-center.space-x-6.mt-6.gap-y-2.gap-x-2"
78+
".flex.w-full.flex-row.flex-wrap.justify-center.space-x-6.mt-6.gap-y-2.gap-x-2",
7979
);
8080

8181
if (!container || container.childNodes.length < 6) return;
@@ -117,7 +117,7 @@ async function addStats() {
117117
await waitForElement("button[tabindex='-1']");
118118

119119
const parent = document.querySelector(
120-
".w-full.flex.flex-col.justify-start.items-center.space-y-2"
120+
".w-full.flex.flex-col.justify-start.items-center.space-y-2",
121121
);
122122

123123
if (!parent) return;
@@ -131,14 +131,14 @@ async function addStats() {
131131
"text-lg",
132132
"dark:text-gray-50",
133133
"text-center",
134-
"mb-6"
134+
"mb-6",
135135
);
136136
summary.setAttribute("id", "buddy-stats");
137137
parent.prepend(summary);
138138
}
139139

140140
const day = document.querySelector(
141-
"h3[class='font-semibold text-lg dark:text-gray-50']"
141+
"h3[class='font-semibold text-lg dark:text-gray-50']",
142142
);
143143

144144
if (!day) return;
@@ -210,8 +210,8 @@ function getVocabStatsText(correct: number, total: number) {
210210
return `<h3 class="font-semibold underline mb-2">Stats</h3>
211211
<ul>
212212
<li>Accuracy: ${correct}/${total} | <span class="font-semibold ml-1" style="color: ${color};">${percentage.toFixed(
213-
2
214-
)}%</span></li>
213+
2,
214+
)}%</span></li>
215215
</ul>
216216
`;
217217
}

src/entrypoints/popup/main.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import './app.css';
2-
import App from './App.svelte';
1+
import "./app.css";
2+
import App from "./App.svelte";
33

44
const app = new App({
5-
target: document.getElementById('app')!,
5+
target: document.getElementById("app")!,
66
});
77

88
export default app;

src/entrypoints/prepswift.content/index.ts

+17-23
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function main() {
3131
calculate_time(container, summary);
3232

3333
const observer = new MutationObserver(() =>
34-
calculate_time(container, summary)
34+
calculate_time(container, summary),
3535
);
3636

3737
document
@@ -43,7 +43,7 @@ async function main() {
4343

4444
async function calculate_time(
4545
container: Element,
46-
summary: HTMLParagraphElement
46+
summary: HTMLParagraphElement,
4747
) {
4848
let rootTotalCount = 0,
4949
rootDoneCount = 0,
@@ -53,28 +53,28 @@ async function calculate_time(
5353
await waitForElement(".video-duration-badge");
5454

5555
Array.from(container.children).forEach((div) => {
56-
let title = div.querySelector("h2");
56+
const title = div.querySelector("h2");
5757

5858
if (!title) return;
5959

60-
let all = div.querySelectorAll(".video-duration-badge");
61-
let done = div.querySelectorAll(".video-duration-badge.text-purple-400");
62-
let allTimestamps = div.querySelectorAll(".video-duration-badge");
63-
let doneTimestamps = div.querySelectorAll(
64-
".video-duration-badge.text-purple-400"
60+
const all = div.querySelectorAll(".video-duration-badge");
61+
const done = div.querySelectorAll(".video-duration-badge.text-purple-400");
62+
const allTimestamps = div.querySelectorAll(".video-duration-badge");
63+
const doneTimestamps = div.querySelectorAll(
64+
".video-duration-badge.text-purple-400",
6565
);
6666

6767
let totalSecs = 0,
6868
doneSecs = 0;
6969

7070
allTimestamps.forEach((a) => {
71-
let s = (a.textContent ?? ":").split(":");
72-
totalSecs += parseInt(s[0]) * 60 + parseInt(s[1]);
71+
const s = (a.textContent ?? ":").split(":");
72+
totalSecs += Number.parseInt(s[0]) * 60 + Number.parseInt(s[1]);
7373
});
7474

7575
doneTimestamps.forEach((a) => {
76-
let s = (a.textContent ?? ":").split(":");
77-
doneSecs += parseInt(s[0]) * 60 + parseInt(s[1]);
76+
const s = (a.textContent ?? ":").split(":");
77+
doneSecs += Number.parseInt(s[0]) * 60 + Number.parseInt(s[1]);
7878
});
7979

8080
rootTotalSecs += totalSecs;
@@ -103,21 +103,15 @@ function getText(
103103
doneCount: number,
104104
totalCount: number,
105105
doneSecs: number,
106-
totalSecs: number
106+
totalSecs: number,
107107
): string {
108-
if (doneCount == totalCount) {
108+
if (doneCount === totalCount) {
109109
return "Done!";
110110
}
111111

112-
if (doneCount == 0) {
113-
return `Lectures: ${totalCount} | Mins: ${(totalSecs / 60).toFixed(
114-
2
115-
)} | Hours: ${(totalSecs / 3600).toFixed(2)}`;
112+
if (doneCount === 0) {
113+
return `Lectures: ${totalCount} | Mins: ${(totalSecs / 60).toFixed(2)} | Hours: ${(totalSecs / 3600).toFixed(2)}`;
116114
}
117115

118-
return `Lectures: ${doneCount}/${totalCount} | Mins: ${(
119-
doneSecs / 60
120-
).toFixed(2)}/${(totalSecs / 60).toFixed(2)} | Hours: ${(
121-
doneSecs / 3600
122-
).toFixed(2)}/${(totalSecs / 3600).toFixed(2)}`;
116+
return `Lectures: ${doneCount}/${totalCount} | Mins: ${(doneSecs / 60).toFixed(2)}/${(totalSecs / 60).toFixed(2)}| Hours: ${(doneSecs / 3600).toFixed(2)}/${(totalSecs / 3600).toFixed(2)}`;
123117
}

src/utils/storage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const vimeoPlaybackRate = storage.defineItem<number>(
22
"local:vimeoPlaybackRate",
3-
{ fallback: 1 }
3+
{ fallback: 1 },
44
);
55

66
export const seenBanners = storage.defineItem<string[]>("local:seenBanners", {

0 commit comments

Comments
 (0)