chore: bump oxlint & enable more supported rules (#14769)

This commit is contained in:
DarkSky
2026-04-03 03:36:52 +08:00
committed by GitHub
parent cdadf8588a
commit 233004f867
285 changed files with 937 additions and 1983 deletions

View File

@@ -28,10 +28,8 @@
"@blocksuite/std": "workspace:*",
"@emotion/cache": "^11.14.0",
"@emotion/css": "^11.13.5",
"@emotion/react": "^11.14.0",
"@floating-ui/dom": "^1.6.13",
"@juggle/resize-observer": "^3.4.0",
"@lit/context": "^1.1.4",
"@lottiefiles/dotlottie-wc": "^0.9.4",
"@marsidev/react-turnstile": "^1.1.0",
"@myriaddreamin/typst-ts-renderer": "^0.7.0-rc2",
@@ -39,7 +37,6 @@
"@myriaddreamin/typst.ts": "^0.7.0-rc2",
"@preact/signals-core": "^1.8.0",
"@radix-ui/react-collapsible": "^1.1.2",
"@radix-ui/react-context-menu": "^2.1.15",
"@radix-ui/react-dialog": "^1.1.3",
"@radix-ui/react-popover": "^1.1.3",
"@radix-ui/react-scroll-area": "^1.2.2",
@@ -51,7 +48,6 @@
"@toeverything/pdf-viewer": "^0.1.1",
"@toeverything/theme": "^1.1.23",
"@vanilla-extract/dynamic": "^2.1.2",
"@webcontainer/api": "^1.6.1",
"animejs": "^4.0.0",
"bytes": "^3.1.2",
"clsx": "^2.1.1",
@@ -68,13 +64,11 @@
"graphql": "^16.9.0",
"history": "^5.3.0",
"idb": "^8.0.0",
"idb-keyval": "^6.2.2",
"image-blob-reduce": "^4.1.0",
"is-svg": "^6.1.0",
"jotai": "^2.10.3",
"jotai-scope": "^0.7.2",
"katex": "^0.16.27",
"lib0": "^0.2.114",
"lit": "^3.2.1",
"lodash-es": "^4.17.23",
"lottie-react": "^2.4.0",
@@ -92,7 +86,6 @@
"recharts": "^2.15.4",
"rxjs": "^7.8.2",
"semver": "^7.7.3",
"ses": "^1.14.0",
"shiki": "^3.19.0",
"socket.io-client": "^4.8.3",
"swr": "^2.3.7",
@@ -105,7 +98,6 @@
"@blocksuite/affine-ext-loader": "workspace:*",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.1.0",
"@types/animejs": "^3.1.12",
"@types/bytes": "^3.1.5",
"@types/image-blob-reduce": "^4.1.4",
"@types/lodash-es": "^4.17.12",
@@ -113,7 +105,6 @@
"@vanilla-extract/css": "^1.17.0",
"fake-indexeddb": "^6.0.0",
"happy-dom": "^20.3.0",
"lodash-es": "^4.17.23",
"vitest": "^4.0.18"
}
}

View File

@@ -376,7 +376,7 @@ export class CodeArtifactTool extends ArtifactTool<
flex-direction: column;
}
.code-artifact-preview > html-preview {
.code-artifact-preview > affine-html-preview {
height: 100%;
}
@@ -487,7 +487,7 @@ export class CodeArtifactTool extends ArtifactTool<
return html`<div class="code-artifact-preview">
${this.mode === 'preview'
? html`<html-preview .html=${htmlContent}></html-preview>`
? html`<affine-html-preview .html=${htmlContent}></affine-html-preview>`
: html`<code-highlighter
.std=${this.std}
.code=${htmlContent}

View File

@@ -304,11 +304,11 @@ export class PlaygroundContent extends SignalWatcher(
}
};
// eslint-disable-next-line @typescript-eslint/no-misused-promises
// oxlint-disable-next-line @typescript-eslint/no-misused-promises
button.addEventListener('click', handleSendClick);
this._disposables.add(() => {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
// oxlint-disable-next-line @typescript-eslint/no-misused-promises
button.removeEventListener('click', handleSendClick);
});
}

View File

@@ -1,4 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
// oxlint-disable-next-line no-restricted-imports
import 'katex/dist/katex.min.css';
import { useConfirmModal, useLitPortalFactory } from '@affine/component';

View File

@@ -50,10 +50,7 @@ export const usePageHelper = (docCollection: Workspace) => {
const createEdgelessAndOpen = useCallback(
(
options: {
at?: 'new-tab' | 'tail' | 'active';
show?: boolean;
} = {
options: { at?: 'new-tab' | 'tail' | 'active'; show?: boolean } = {
at: 'active',
show: true,
}

View File

@@ -12,7 +12,7 @@ import { linkIframe } from './iframe-container';
export const CodeBlockHtmlPreview = CodeBlockPreviewExtension(
'html',
model => html`<html-preview .model=${model}></html-preview>`
model => html`<affine-html-preview .model=${model}></affine-html-preview>`
);
export class HTMLPreview extends SignalWatcher(
@@ -153,11 +153,11 @@ export class HTMLPreview extends SignalWatcher(
}
export function effects() {
customElements.define('html-preview', HTMLPreview);
customElements.define('affine-html-preview', HTMLPreview);
}
declare global {
interface HTMLElementTagNameMap {
'html-preview': HTMLPreview;
'affine-html-preview': HTMLPreview;
}
}

View File

@@ -734,7 +734,7 @@ function renderOpenDocMenu(
<affine-open-doc-dropdown-menu
.actions=${actions}
.context=${ctx}
.openDocMode$=${openDocMode}
.openDocModeSignal=${openDocMode}
.updateOpenDocMode=${updateOpenDocMode}
>
</affine-open-doc-dropdown-menu>

View File

@@ -7,6 +7,7 @@ import type {
LinkedMenuItem,
LinkedWidgetConfig,
} from '@blocksuite/affine/widgets/linked-doc';
import { unsafeHTML } from '@blocksuite/affine-shared/utils';
import { UserIcon } from '@blocksuite/icons/lit';
import { BLOCK_ID_ATTR, type BlockComponent } from '@blocksuite/std';
import { computed } from '@preact/signals-core';
@@ -15,7 +16,6 @@ import { cssVarV2 } from '@toeverything/theme/v2';
import Fuse, { type FuseResultMatch } from 'fuse.js';
import { html } from 'lit';
import { styleMap } from 'lit/directives/style-map.js';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
export const createCommentLinkedWidgetConfig = (
framework: FrameworkProvider

View File

@@ -130,7 +130,7 @@ export const EdgelessSnapshot = (props: Props) => {
}, [docName, extensions, firstUpdate, updateElements]);
useEffect(() => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
// oxlint-disable-next-line @typescript-eslint/no-floating-promises
renderEditor();
return () => editorHostRef.current?.remove();
}, [renderEditor]);

View File

@@ -174,7 +174,7 @@ const McpServerSetting = () => {
variant="primary"
onClick={() => {
if (!code) return;
// eslint-disable-next-line @typescript-eslint/no-floating-promises
// oxlint-disable-next-line @typescript-eslint/no-floating-promises
navigator.clipboard.writeText(code);
notify.success({
title: t['Copied to clipboard'](),

View File

@@ -1,4 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
// oxlint-disable-next-line no-restricted-imports
import { useNavigate } from 'react-router-dom';
import { MobileSignInPanel } from '../components/sign-in';

View File

@@ -22,6 +22,7 @@ import {
type LinkedWidgetConfig,
LinkedWidgetUtils,
} from '@blocksuite/affine/widgets/linked-doc';
import { unsafeHTML } from '@blocksuite/affine-shared/utils';
import {
DateTimeIcon,
NewXxxEdgelessIcon,
@@ -35,7 +36,6 @@ import type { FuseResultMatch } from 'fuse.js';
import Fuse from 'fuse.js';
import { html } from 'lit';
import { styleMap } from 'lit/directives/style-map.js';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import {
createAbsolutePositionFromRelativePosition,
createRelativePositionFromTypeIndex,

View File

@@ -36,7 +36,7 @@ export { WorkspaceServerService } from './services/workspace-server';
export { WorkspaceSubscriptionService } from './services/workspace-subscription';
export type { ServerConfig } from './types';
// eslint-disable-next-line simple-import-sort/imports
// oxlint-disable-next-line simple-import-sort/imports
import { type Framework } from '@toeverything/infra';
import { GlobalCache, GlobalState } from '../storage/providers/global';

View File

@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* oxlint-disable @typescript-eslint/no-non-null-assertion */
import { apis, appInfo, events, sharedStorage } from '@affine/electron-api';
import { Service } from '@toeverything/infra';

View File

@@ -7,13 +7,13 @@ import type {
LinkedMenuGroup,
LinkedMenuItem,
} from '@blocksuite/affine/widgets/linked-doc';
import { unsafeHTML } from '@blocksuite/affine-shared/utils';
import { CollectionsIcon, WarningIcon } from '@blocksuite/icons/lit';
import { computed, signal } from '@preact/signals-core';
import { Service } from '@toeverything/infra';
import { cssVarV2 } from '@toeverything/theme/v2';
import Fuse, { type FuseResultMatch } from 'fuse.js';
import { html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import { catchError, map, of } from 'rxjs';
import { normalizeSearchText } from '../../../utils/normalize-search-text';

View File

@@ -156,7 +156,7 @@ export class AsyncStorageMemento implements AsyncMemento {
this.eventEmitter.on(key, eventEmitterCb);
// Listen for cross-tab events
// eslint-disable-next-line sonarjs/no-identical-functions
// oxlint-disable-next-line sonarjs/no-identical-functions
const channelCb = (event: MessageEvent) => {
if (event.data.key === key) {
subscriber.next(event.data.value);

View File

@@ -1,7 +1,7 @@
import { useLiveData } from '@toeverything/infra';
import type { Location } from 'history';
import { useEffect } from 'react';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
// oxlint-disable-next-line no-restricted-imports
import { useLocation, useNavigate } from 'react-router-dom';
import type { Workbench } from '../entities/workbench';

View File

@@ -1,6 +1,6 @@
import type { Location } from 'history';
import { useEffect } from 'react';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
// oxlint-disable-next-line no-restricted-imports
import { useLocation } from 'react-router-dom';
import type { Workbench } from '../entities/workbench';

View File

@@ -199,7 +199,7 @@ type Events<F> = {
call: (arg: any) => void;
};
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
// oxlint-disable-next-line @typescript-eslint/no-unsafe-function-type
function createEvents<F extends Function>(): Events<F> {
let handlers: F[] = [];