Skip to content

Commit 3b5afbc

Browse files
committed
chore: Fix lint and types issues + missing changes
1 parent ab78d36 commit 3b5afbc

10 files changed

Lines changed: 20 additions & 16 deletions

File tree

.oxfmtrc.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3-
"ignorePatterns": ["CLAUDE.md", "SPEC.md"],
3+
"ignorePatterns": ["CLAUDE.md", "SPEC.md", "static/*.html"],
44
"sortImports": { "newlinesBetween": false },
55
"sortPackageJson": true,
66
"sortTailwindcss": true,

.oxlintrc.jsonc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@
7676
{
7777
"files": ["test/**/*.test.ts", "test/**/*.spec.ts"],
7878
"rules": {
79+
"oxclippy/similar-names": "off",
7980
"unicorn/consistent-function-scoping": "off", // tests may define scoped helpers
81+
82+
// TODO: Remove when we can fix all the issues.
83+
"typescript/no-unsafe-type-assertion": "off",
8084
},
8185
},
8286
{

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ What started as an experiment to play with the Chrome browser APIs and explore w
3333

3434
### Design goals
3535

36-
<!-- dprint-ignore -->
36+
<!-- prettier-ignore -->
3737
| Issue | Why / How |
3838
| --- | --- |
3939
| Access | Still have access to common things like the bookmarks bar etc. |

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import js from "@eslint/js";
22
import mm from "@maxmilton/eslint-config";
3-
import { defineConfig } from "eslint/config";
43
import oxlint from "eslint-plugin-oxlint";
54
import unicorn from "eslint-plugin-unicorn";
5+
import { defineConfig } from "eslint/config";
66
import ts from "typescript-eslint";
77

88
export default defineConfig(

globals.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { ONCLICK } from "stage1/fast";
33
declare global {
44
namespace NodeJS {
55
interface ProcessEnv {
6-
readonly CI?: string;
6+
CI?: string;
77
}
88
}
99

src/newtab.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Theme loader code must run first
22
import "./theme.ts";
3-
43
import { append, fragment } from "stage1/fast";
54
import { BookmarkBar } from "./components/BookmarkBar.ts";
65
import { Menu } from "./components/Menu.ts";

test/e2e/newtab.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ test("has no external or unexpected requests", async ({ page, extensionId }) =>
8181
const url = request.url();
8282
const type = request.resourceType();
8383
if (
84-
(type === "document" && url === `chrome-extension://${extensionId}/newtab.html`)
85-
|| (type === "stylesheet" && url === `chrome-extension://${extensionId}/newtab.css`)
86-
|| (type === "script" && url === `chrome-extension://${extensionId}/newtab.js`)
87-
|| (type === "image" && url.startsWith(`chrome-extension://${extensionId}/_favicon?`))
84+
(type === "document" && url === `chrome-extension://${extensionId}/newtab.html`) ||
85+
(type === "stylesheet" && url === `chrome-extension://${extensionId}/newtab.css`) ||
86+
(type === "script" && url === `chrome-extension://${extensionId}/newtab.js`) ||
87+
(type === "image" && url.startsWith(`chrome-extension://${extensionId}/_favicon?`))
8888
) {
8989
expected.push({ url, type });
9090
} else {

test/e2e/settings.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ test("makes no external or unexpected requests", async ({ page, extensionId }) =
5858
const url = request.url();
5959
const type = request.resourceType();
6060
if (
61-
(type === "document" && url === `chrome-extension://${extensionId}/settings.html`)
62-
|| (type === "stylesheet" && url === `chrome-extension://${extensionId}/settings.css`)
63-
|| (type === "script" && url === `chrome-extension://${extensionId}/settings.js`)
64-
|| (type === "fetch" && url === `chrome-extension://${extensionId}/themes.json`)
61+
(type === "document" && url === `chrome-extension://${extensionId}/settings.html`) ||
62+
(type === "stylesheet" && url === `chrome-extension://${extensionId}/settings.css`) ||
63+
(type === "script" && url === `chrome-extension://${extensionId}/settings.js`) ||
64+
(type === "fetch" && url === `chrome-extension://${extensionId}/themes.json`)
6565
) {
6666
expected.push({ url, type });
6767
} else {

test/unit/newtab.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { afterEach, describe, expect, spyOn, test } from "bun:test";
22
import { compile, DECLARATION, lookup, walk } from "@maxmilton/test-utils/css";
33
import { performanceSpy } from "@maxmilton/test-utils/spy";
4-
import { reset } from "../setup.ts";
4+
import type { UserStorageData } from "#types.ts";
5+
import { DEFAULT_SECTION_ORDER } from "#utils.ts";
6+
import { reset } from "./setup.ts";
57

68
// Completely reset DOM and global state between tests
79
afterEach(reset);
@@ -24,7 +26,7 @@ async function load(mockUserSettings?: UserStorageData) {
2426
}
2527

2628
test("renders entire newtab app", async () => {
27-
expect.assertions(5);
29+
expect.assertions(7);
2830
await load();
2931
expect(document.body.getHTML().length).toBeGreaterThan(1000);
3032
expect(document.body.querySelector("#b")).toBeTruthy();

test/unit/setup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import "@maxmilton/test-utils/extend";
2-
32
import { setupDOM } from "@maxmilton/test-utils/dom";
43

54
const noop = () => {};

0 commit comments

Comments
 (0)