Skip to content

Commit f37a175

Browse files
committed
chore: fix lint issues
1 parent a01d3f9 commit f37a175

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

src/data/RouterEvents.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ function makeStore(): Readable<RouterEvent> {
1818
return derived(page, ($page) => {
1919
return { navigating: false, target_url: $page.url };
2020
});
21-
} else {
22-
// On client.
23-
let current = new URL(location.href);
21+
}
2422

25-
// Return store that responds to navigation events.
26-
// The `navigating` store immediately "pushes" `null`.
27-
// This in turn causes this derived store to immediately "push" the current URL.
28-
return derived(navigating, ($nav) => {
29-
let navigating = false;
30-
// $nav is null when navigation finishes.
31-
if ($nav != null && $nav.to != null) {
32-
current = $nav.to.url;
33-
navigating = true;
34-
}
23+
// On client.
24+
let current = new URL(location.href);
3525

36-
return { navigating, target_url: current };
37-
});
38-
}
26+
// Return store that responds to navigation events.
27+
// The `navigating` store immediately "pushes" `null`.
28+
// This in turn causes this derived store to immediately "push" the current URL.
29+
return derived(navigating, ($nav) => {
30+
let navigating = false;
31+
// $nav is null when navigation finishes.
32+
if ($nav != null && $nav.to != null) {
33+
current = $nav.to.url;
34+
navigating = true;
35+
}
36+
37+
return { navigating, target_url: current };
38+
});
3939
}
4040

4141
// Do not subscribe to it outside of components!

src/data/api/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import type {
99
DonationPlatform,
1010
CryptoWallet,
1111
Social,
12-
About,
13-
CompatiblePackage
12+
About
1413
} from '$lib/types';
1514

1615
export type ContributorsData = { contributables: Contributable[] };
@@ -41,20 +40,21 @@ async function patches(): Promise<PatchesData> {
4140
const json = await get_json('v4/patches/list');
4241
const packagesWithCount: { [key: string]: number } = {};
4342

44-
json.forEach((patch) => {
45-
if (!patch.compatiblePackages) return;
43+
for (const patch of json) {
44+
if (!patch.compatiblePackages) continue;
4645

4746
patch.compatiblePackages = Object.keys(patch.compatiblePackages).map((name) => ({
4847
name,
4948
versions: patch.compatiblePackages[name]
5049
}));
51-
});
50+
}
5251

5352
// gets packages and patch count
54-
for (let i = 0; i < json.length; i++) {
55-
json[i].compatiblePackages?.forEach((pkg: CompatiblePackage) => {
53+
for (const { compatiblePackages } of json) {
54+
if (!compatiblePackages) continue;
55+
for (const pkg of compatiblePackages) {
5656
packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1;
57-
});
57+
}
5858
}
5959

6060
// sort packages by patch count to get most relevant apps on top

src/data/api/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function set_status_url(apiUrl: string) {
1212
.then((data) => {
1313
if (data?.status) {
1414
localStorage.setItem(STATUS_KEY, data.status);
15-
console.log('status is now ' + localStorage.getItem(STATUS_KEY));
15+
console.log('Status is now:', localStorage.getItem(STATUS_KEY));
1616
}
1717
});
1818
}

0 commit comments

Comments
 (0)