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
@@ -108,11 +108,13 @@ export class EmbedFigmaBlockComponent extends EmbedBlockComponent<EmbedFigmaMode
</div>
</div>
${description
? html`<div class="affine-embed-figma-content-description">
${description}
</div>`
: nothing}
${
description
? html`<div class="affine-embed-figma-content-description">
${description}
</div>`
: nothing
}
<div class="affine-embed-figma-content-url" @click=${this.open}>
<span>www.figma.com</span>
@@ -183,21 +183,23 @@ export class EmbedGithubBlockComponent extends EmbedBlockComponent<
${titleIcon}
</div>
${status && statusText
? html`<div
class=${classMap({
'affine-embed-github-content-title-status-icon': true,
[githubType]: true,
[status]: true,
success: statusReason === 'completed',
failure: statusReason === 'not_planned',
})}
>
${statusIcon}
${
status && statusText
? html`<div
class=${classMap({
'affine-embed-github-content-title-status-icon': true,
[githubType]: true,
[status]: true,
success: statusReason === 'completed',
failure: statusReason === 'not_planned',
})}
>
${statusIcon}
<span>${statusText}</span>
</div>`
: nothing}
<span>${statusText}</span>
</div>`
: nothing
}
</div>
<div class="affine-embed-github-content-title-text">
@@ -209,50 +211,56 @@ export class EmbedGithubBlockComponent extends EmbedBlockComponent<
${descriptionText}
</div>
${githubType === 'issue' && assignees
? html`
<div class="affine-embed-github-content-assignees">
<div
class="affine-embed-github-content-assignees-text label"
>
Assignees
</div>
${
githubType === 'issue' && assignees
? html`
<div class="affine-embed-github-content-assignees">
<div
class="affine-embed-github-content-assignees-text label"
>
Assignees
</div>
<div
class="affine-embed-github-content-assignees-text users"
>
${assignees.length === 0
? html`<span
class="affine-embed-github-content-assignees-text-users placeholder"
>No one</span
>`
: repeat(
assignees,
assignee => assignee,
(assignee, index) =>
html`<span
class="affine-embed-github-content-assignees-text-users user"
@click=${() =>
this._handleAssigneeClick(assignee)}
>${`@${assignee}`}</span
>
${index === assignees.length - 1 ? '' : `, `}`
)}
<div
class="affine-embed-github-content-assignees-text users"
>
${
assignees.length === 0
? html`<span
class="affine-embed-github-content-assignees-text-users placeholder"
>No one</span
>`
: repeat(
assignees,
assignee => assignee,
(assignee, index) =>
html`<span
class="affine-embed-github-content-assignees-text-users user"
@click=${() =>
this._handleAssigneeClick(assignee)}
>${`@${assignee}`}</span
>
${index === assignees.length - 1 ? '' : `, `}`
)
}
</div>
</div>
</div>
`
: nothing}
`
: nothing
}
<div class="affine-embed-github-content-url" @click=${this.open}>
<span class="affine-embed-github-content-repo"
>${`${owner}/${repo} |`}</span
>
${createdAt
? html`<span class="affine-embed-github-content-date"
>${dateText} |</span
>`
: nothing}
${
createdAt
? html`<span class="affine-embed-github-content-date"
>${dateText} |</span
>`
: nothing
}
<span>github.com</span>
<div class="affine-embed-github-content-url-icon">
@@ -252,16 +252,18 @@ export class EmbedIframeErrorCard extends WithDisposable(LitElement) {
${this.error?.message || 'Failed to load embedded content'}
</div>
<div class="error-info">
${this.readonly
? nothing
: html`
<div class="button edit" @click=${this._toggleEdit}>
<span class="icon"
>${EditIcon({ width: '16px', height: '16px' })}</span
>
<span class="text">Edit</span>
</div>
`}
${
this.readonly
? nothing
: html`
<div class="button edit" @click=${this._toggleEdit}>
<span class="icon"
>${EditIcon({ width: '16px', height: '16px' })}</span
>
<span class="text">Edit</span>
</div>
`
}
<div class="button retry" @click=${this._handleRetry}>
<span class="icon"
>${ResetIcon({ width: '16px', height: '16px' })}</span
@@ -244,13 +244,15 @@ export class EmbedIframeLinkInputPopup extends EmbedIframeLinkInputBase {
return html`
<div class=${modalMainWrapperClass}>
${showCloseButton
? html`
<div class="popup-close-button" @click=${this._onClose}>
${CloseIcon({ width: '20', height: '20' })}
</div>
`
: nothing}
${
showCloseButton
? html`
<div class="popup-close-button" @click=${this._onClose}>
${CloseIcon({ width: '20', height: '20' })}
</div>
`
: nothing
}
<div class="link-input-popup-content-wrapper">
<div class="title">${title}</div>
<div class="description">${description}</div>
@@ -392,9 +392,11 @@ export class EmbedIframeBlockComponent extends CaptionedBlockComponent<EmbedIfra
scrolling=${ifDefined(scrolling)}
style=${ifDefined(style)}
></iframe>
${sourceHost
? html`<div class="affine-embed-iframe-source">${sourceHost}</div>`
: nothing}`;
${
sourceHost
? html`<div class="affine-embed-iframe-source">${sourceHost}</div>`
: nothing
}`;
};
private readonly _isIframeUrlAllowed = (iframeUrl: string) => {
@@ -118,28 +118,30 @@ export class EmbedLoomBlockComponent extends EmbedBlockComponent<
@dblclick=${this._handleDoubleClick}
>
<div class="affine-embed-loom-video">
${videoId
? html`
<div class="affine-embed-loom-video-iframe-container">
<iframe
src=${`https://www.loom.com/embed/${videoId}?hide_title=true`}
frameborder="0"
allow="fullscreen; autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"
sandbox="allow-scripts allow-same-origin allow-presentation"
loading="lazy"
credentialless
></iframe>
${
videoId
? html`
<div class="affine-embed-loom-video-iframe-container">
<iframe
src=${`https://www.loom.com/embed/${videoId}?hide_title=true`}
frameborder="0"
allow="fullscreen; autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"
sandbox="allow-scripts allow-same-origin allow-presentation"
loading="lazy"
credentialless
></iframe>
<!-- overlay to prevent the iframe from capturing pointer events -->
<div
class=${classMap({
'affine-embed-loom-video-iframe-overlay': true,
hide: !this.showOverlay$.value,
})}
></div>
</div>
`
: bannerImage}
<!-- overlay to prevent the iframe from capturing pointer events -->
<div
class=${classMap({
'affine-embed-loom-video-iframe-overlay': true,
hide: !this.showOverlay$.value,
})}
></div>
</div>
`
: bannerImage
}
</div>
<div class="affine-embed-loom-content">
<div class="affine-embed-loom-content-header">
@@ -134,40 +134,42 @@ export class EmbedYoutubeBlockComponent extends EmbedBlockComponent<
@dblclick=${this._handleDoubleClick}
>
<div class="affine-embed-youtube-video">
${videoId
? html`
<div class="affine-embed-youtube-video-iframe-container">
<iframe
id="ytplayer"
type="text/html"
src=${`https://www.youtube.com/embed/${videoId}`}
frameborder="0"
allow="fullscreen; autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"
sandbox="allow-scripts allow-same-origin allow-presentation"
loading="lazy"
credentialless
></iframe>
${
videoId
? html`
<div class="affine-embed-youtube-video-iframe-container">
<iframe
id="ytplayer"
type="text/html"
src=${`https://www.youtube.com/embed/${videoId}`}
frameborder="0"
allow="fullscreen; autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"
sandbox="allow-scripts allow-same-origin allow-presentation"
loading="lazy"
credentialless
></iframe>
<!-- overlay to prevent the iframe from capturing pointer events -->
<div
class=${classMap({
'affine-embed-youtube-video-iframe-overlay': true,
hide: !this.showOverlay$.value,
})}
></div>
<img
class=${classMap({
'affine-embed-youtube-video-iframe-overlay': true,
'media-print': true,
hide: !this._showImage,
})}
src=${`https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`}
alt="YouTube Video"
loading="lazy"
/>
</div>
`
: bannerImage}
<!-- overlay to prevent the iframe from capturing pointer events -->
<div
class=${classMap({
'affine-embed-youtube-video-iframe-overlay': true,
hide: !this.showOverlay$.value,
})}
></div>
<img
class=${classMap({
'affine-embed-youtube-video-iframe-overlay': true,
'media-print': true,
hide: !this._showImage,
})}
src=${`https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`}
alt="YouTube Video"
loading="lazy"
/>
</div>
`
: bannerImage
}
</div>
<div class="affine-embed-youtube-content">
<div class="affine-embed-youtube-content-header">
@@ -188,15 +190,17 @@ export class EmbedYoutubeBlockComponent extends EmbedBlockComponent<
</div>
</div>
${loading
? html`<div
class="affine-embed-youtube-content-description"
></div>`
: descriptionText
? html`<div class="affine-embed-youtube-content-description">
${descriptionText}
</div>`
: nothing}
${
loading
? html`<div
class="affine-embed-youtube-content-description"
></div>`
: descriptionText
? html`<div class="affine-embed-youtube-content-description">
${descriptionText}
</div>`
: nothing
}
<div class="affine-embed-youtube-content-url" @click=${this.open}>
<span>www.youtube.com</span>