chore: fix oxlint errors (#13434)

#### PR Dependency Tree


* **PR #13434** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Style**
* Improved clarity of TypeScript error suppression comments across
various test files and helper scripts. Comments now specify the reasons
for ignoring specific type errors, enhancing code readability for
developers.
* **Chores**
* Updated inline comments without affecting application functionality or
user experience. No changes to features, logic, or test outcomes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
fengmk2
2025-08-07 10:53:25 +08:00
committed by GitHub
parent 21c758b6d6
commit 542c8e2c1d
9 changed files with 15 additions and 14 deletions

View File

@@ -114,6 +114,7 @@ export class PreviewHelper {
});
let width: number = 500;
// oxlint-disable-next-line no-unassigned-vars
let height;
const noteBlock = this.widget.host.querySelector('affine-note');

View File

@@ -732,7 +732,7 @@ for (const {
[
...prompt.finish(
messages.reduce(
// @ts-expect-error
// @ts-expect-error params not typed
(acc, m) => Object.assign(acc, m.params),
{}
)
@@ -802,7 +802,7 @@ for (const {
[
...prompt.finish(
finalMessage.reduce(
// @ts-expect-error
// @ts-expect-error params not typed
(acc, m) => Object.assign(acc, m.params),
params
)

View File

@@ -111,7 +111,7 @@ test.before(async t => {
m.overrideProvider(OpenAIProvider).useClass(MockCopilotProvider);
m.overrideProvider(GeminiGenerativeProvider).useClass(
class MockGenerativeProvider extends MockCopilotProvider {
// @ts-expect-error
// @ts-expect-error type not typed
override type: CopilotProviderType = CopilotProviderType.Gemini;
}
);

View File

@@ -411,7 +411,7 @@ test('should be able to fork chat session', async t => {
// fork session
const s1 = (await session.get(sessionId))!;
// @ts-expect-error
// @ts-expect-error find maybe return undefined
const latestMessageId = s1.finish({}).find(m => m.role === 'assistant')!.id;
const forkedSessionId1 = await session.fork({
userId,

View File

@@ -125,7 +125,7 @@ test('should not switch user quota if the new quota is the same as the current o
});
test('should use pro plan as free for selfhost instance', async t => {
// @ts-expect-error
// @ts-expect-error DEPLOYMENT_TYPE is readonly
env.DEPLOYMENT_TYPE = 'selfhosted';
await using module = await createTestingModule();

View File

@@ -66,7 +66,7 @@ export async function createTestingModule(
// setting up
let imports = moduleDef.imports ?? [buildAppModule(globalThis.env)];
imports =
// @ts-expect-error
// @ts-expect-error ignore the type error
imports[0].module?.name === 'AppModule'
? imports
: dedupeModules([

View File

@@ -493,19 +493,19 @@ describe('ORM entity CRUD', () => {
expect(() => {
client.users.create({
// @ts-expect-error
// @ts-expect-error ignore the type error
name: null,
});
}).toThrowError("Field 'name' is required but not set.");
expect(() => {
// @ts-expect-error
// @ts-expect-error ignore the type error
client.users.create({});
}).toThrowError("Field 'name' is required but not set.");
expect(() => {
client.users.update(1, {
// @ts-expect-error
// @ts-expect-error ignore the type error
name: null,
});
}).toThrowError("Field 'name' is required but not set.");

View File

@@ -57,11 +57,11 @@ test('newly created page shows empty history', async ({ page }) => {
const pushCurrentPageUpdates = async (page: Page) => {
const [workspaceId, guid, updates, state] = await page.evaluate(() => {
// @ts-expect-error
// @ts-expect-error ignore the type error
const Y = window.Y;
// @ts-expect-error
// @ts-expect-error ignore the type error
const spaceDoc = window.currentEditor.page.spaceDoc;
// @ts-expect-error
// @ts-expect-error ignore the type error
const workspaceId: string = window.currentWorkspace.id;
const updates: Uint8Array = Y.encodeStateAsUpdate(spaceDoc);
const state: Uint8Array = Y.encodeStateVector(spaceDoc);

View File

@@ -77,7 +77,7 @@ export const test = baseTest.extend<{
if (enableCoverage) {
await context.addInitScript(() =>
window.addEventListener('beforeunload', () =>
// @ts-expect-error
// @ts-expect-error window.__coverage__ is not typed
window.collectIstanbulCoverage(JSON.stringify(window.__coverage__))
)
);
@@ -103,7 +103,7 @@ export const test = baseTest.extend<{
if (enableCoverage) {
for (const page of context.pages()) {
await page.evaluate(() =>
// @ts-expect-error
// @ts-expect-error window.__coverage__ is not typed
window.collectIstanbulCoverage(JSON.stringify(window.__coverage__))
);
}