chore: migrate oxlint & oxfmt (#15464)

#### PR Dependency Tree


* **PR #15464** 👈

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

* **Chores**
* Replaced the project’s formatting and linting workflow with Oxfmt and
Oxlint.
* Added shared formatting and linting configuration, editor integration,
and updated automated checks.
* Updated generated files, scripts, and lint guidance to use the new
tooling.

* **Style**
* Reformatted templates, source code, examples, and configuration files
for consistent readability.
  * No user-facing functionality or rendering behavior changed.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2026-08-10 23:51:28 +08:00
committed by GitHub
parent 749c83cd8e
commit 0c7b20dc18
292 changed files with 3372 additions and 2866 deletions

View File

@@ -134,13 +134,15 @@ export class AdapterPanelBody extends SignalWatcher(LitElement) {
private _renderHtmlPanel() {
return html`
${this.isHtmlPreview
? html`<iframe
class="html-preview-container"
.srcdoc=${this.htmlContent}
sandbox="allow-same-origin"
></iframe>`
: html`<div class="html-panel-content">${this.htmlContent}</div>`}
${
this.isHtmlPreview
? html`<iframe
class="html-preview-container"
.srcdoc=${this.htmlContent}
sandbox="allow-same-origin"
></iframe>`
: html`<div class="html-panel-content">${this.htmlContent}</div>`
}
<div class="html-panel-footer">
<div class="html-toggle-container">
<span

View File

@@ -213,9 +213,9 @@ export class DocTitle extends WithDisposable(ShadowlessElement) {
return html`
<div
class="doc-title-container ${isEmpty
? 'doc-title-container-empty'
: ''}"
class="doc-title-container ${
isEmpty ? 'doc-title-container-empty' : ''
}"
data-block-is-title="true"
>
<rich-text

View File

@@ -268,11 +268,13 @@ export class FramePanelBody extends SignalWatcher(
.std=${this.editorHost.std}
.cardIndex=${cardIndex}
.frameIndex=${frameIndex}
.status=${selectedFrames.has(frame.id)
? this._dragging
? 'placeholder'
: 'selected'
: 'none'}
.status=${
selectedFrames.has(frame.id)
? this._dragging
? 'placeholder'
: 'selected'
: 'none'
}
@select=${this._selectFrame}
@fitview=${this._fitToElement}
@drag=${this._drag}
@@ -281,12 +283,14 @@ export class FramePanelBody extends SignalWatcher(
})}`;
const frameList = html` <div class="frame-list-container">
${this.insertIndex !== undefined
? html`<div
class="insert-indicator"
style=${`transform: translateY(${this._indicatorTranslateY}px)`}
></div>`
: nothing}
${
this.insertIndex !== undefined
? html`<div
class="insert-indicator"
style=${`transform: translateY(${this._indicatorTranslateY}px)`}
></div>`
: nothing
}
${frameCards}
</div>`;
return frameList;
@@ -385,9 +389,11 @@ export class FramePanelBody extends SignalWatcher(
override render() {
this._updateFrameItems();
return html` ${this._frameItems.length
? this._renderFrameList()
: this._renderEmptyContent()}`;
return html` ${
this._frameItems.length
? this._renderFrameList()
: this._renderEmptyContent()
}`;
}
override updated(_changedProperties: PropertyValues) {

View File

@@ -193,24 +193,28 @@ export class FrameCard extends WithDisposable(ShadowlessElement) {
class="frame-card-container ${this.status ?? ''}"
style=${containerStyle}
>
${this.status === 'dragging'
? nothing
: html`<affine-frame-card-title
.cardIndex=${this.cardIndex}
.frame=${this.frame}
></affine-frame-card-title>`}
${
this.status === 'dragging'
? nothing
: html`<affine-frame-card-title
.cardIndex=${this.cardIndex}
.frame=${this.frame}
></affine-frame-card-title>`
}
<div
class="frame-card-body"
@click=${this._dispatchSelectEvent}
@dblclick=${this._dispatchFitViewEvent}
@mousedown=${this._dispatchDragEvent}
>
${this.status === 'dragging' && stackOrder !== 0
? nothing
: html`<frame-preview
.frame=${this.frame}
.std=${this.std}
></frame-preview>`}
${
this.status === 'dragging' && stackOrder !== 0
? nothing
: html`<frame-preview
.frame=${this.frame}
.std=${this.std}
></frame-preview>`
}
${this._DraggingCardNumber()}
</div>
</div>`;

View File

@@ -191,9 +191,9 @@ export class FramePanelHeader extends WithDisposable(LitElement) {
<div class="all-frames-setting">
<span class="all-frames-setting-label">All frames</span>
<edgeless-tool-icon-button
class="all-frames-setting-button ${this._settingPopperShow
? 'active'
: ''}"
class="all-frames-setting-button ${
this._settingPopperShow ? 'active' : ''
}"
.tooltip=${this._settingPopperShow ? '' : 'All Frames Settings'}
.tipPosition=${'top'}
.active=${this._settingPopperShow}

View File

@@ -412,11 +412,13 @@ export class OutlinePanelBody extends SignalWatcher(
index=${index}
.note=${note}
.activeHeadingId=${this._activeHeadingId$.value}
.status=${this._allSelectedNotes$.value.includes(note)
? this._dragging$.value
? 'dragging'
: 'selected'
: 'normal'}
.status=${
this._allSelectedNotes$.value.includes(note)
? this._dragging$.value
? 'dragging'
: 'selected'
: 'normal'
}
@fitview=${this._fitToElement}
@select=${this._selectNote}
@displaymodechange=${this._handleDisplayModeChange}

View File

@@ -101,11 +101,13 @@ export class OutlineBlockPreview extends SignalWatcher(
class="${styles.text} ${styles.textGeneral} ${headingClass}"
>${previewText}</span
>
${this._context.showIcons$.value
? html`<span class=${iconClass}
>${previewIconMap[block.props.type]}</span
>`
: nothing}`;
${
this._context.showIcons$.value
? html`<span class=${iconClass}
>${previewIconMap[block.props.type]}</span
>`
: nothing
}`;
}
override render() {
@@ -148,15 +150,17 @@ export class OutlineBlockPreview extends SignalWatcher(
assertType<BookmarkBlockModel>(block);
return html`
<span class="${styles.text} ${styles.textGeneral}"
>${block.props.title ||
block.props.url ||
placeholderMap['bookmark']}</span
>${
block.props.title || block.props.url || placeholderMap['bookmark']
}</span
>
${showPreviewIcon
? html`<span class=${iconClass}
>${previewIconMap['bookmark']}</span
>`
: nothing}
${
showPreviewIcon
? html`<span class=${iconClass}
>${previewIconMap['bookmark']}</span
>`
: nothing
}
`;
case 'affine:code':
assertType<CodeBlockModel>(block);
@@ -164,47 +168,61 @@ export class OutlineBlockPreview extends SignalWatcher(
<span class="${styles.text} ${styles.textGeneral}"
>${block.props.language ?? placeholderMap['code']}</span
>
${showPreviewIcon
? html`<span class=${iconClass}>${previewIconMap['code']}</span>`
: nothing}
${
showPreviewIcon
? html`<span class=${iconClass}>${previewIconMap['code']}</span>`
: nothing
}
`;
case 'affine:database':
assertType<DatabaseBlockModel>(block);
return html`
<span class="${styles.text} ${styles.textGeneral}"
>${block.props.title.toString().length
? block.props.title.toString()
: placeholderMap['database']}</span
>${
block.props.title.toString().length
? block.props.title.toString()
: placeholderMap['database']
}</span
>
${showPreviewIcon
? html`<span class=${iconClass}>${previewIconMap['table']}</span>`
: nothing}
${
showPreviewIcon
? html`<span class=${iconClass}>${previewIconMap['table']}</span>`
: nothing
}
`;
case 'affine:image':
assertType<ImageBlockModel>(block);
return html`
<span class="${styles.text} ${styles.textGeneral}"
>${block.props.caption?.length
? block.props.caption
: placeholderMap['image']}</span
>${
block.props.caption?.length
? block.props.caption
: placeholderMap['image']
}</span
>
${showPreviewIcon
? html`<span class=${iconClass}>${previewIconMap['image']}</span>`
: nothing}
${
showPreviewIcon
? html`<span class=${iconClass}>${previewIconMap['image']}</span>`
: nothing
}
`;
case 'affine:attachment':
assertType<AttachmentBlockModel>(block);
return html`
<span class="${styles.text} ${styles.textGeneral}"
>${block.props.name?.length
? block.props.name
: placeholderMap['attachment']}</span
>${
block.props.name?.length
? block.props.name
: placeholderMap['attachment']
}</span
>
${showPreviewIcon
? html`<span class=${iconClass}
>${previewIconMap['attachment']}</span
>`
: nothing}
${
showPreviewIcon
? html`<span class=${iconClass}
>${previewIconMap['attachment']}</span
>`
: nothing
}
`;
default:
return nothing;