mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-24 05:07:06 +08:00
chore: bump oxlint & enable more supported rules (#14769)
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
+3
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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]);
|
||||
|
||||
+1
-1
@@ -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'](),
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user