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

@@ -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;