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
+18 -6
View File
@@ -18,12 +18,24 @@ export abstract class BaseAdapter<AdapterTarget = unknown> {
return this.job.adapterConfigs;
}
abstract fromDocSnapshot(payload: FromDocSnapshotPayload): Promise<FromDocSnapshotResult<AdapterTarget>>;
abstract fromBlockSnapshot(payload: FromBlockSnapshotPayload): Promise<FromBlockSnapshotResult<AdapterTarget>>;
abstract fromSliceSnapshot(payload: FromSliceSnapshotPayload): Promise<FromSliceSnapshotResult<AdapterTarget>>;
abstract toDocSnapshot(payload: ToDocSnapshotPayload<AdapterTarget>): Promise<DocSnapshot>;
abstract toBlockSnapshot(payload: ToBlockSnapshotPayload<AdapterTarget>): Promise<BlockSnapshot>;
abstract toSliceSnapshot(payload: ToSliceSnapshotPayload<AdapterTarget>): Promise<SliceSnapshot | null>;
abstract fromDocSnapshot(
payload: FromDocSnapshotPayload
): Promise<FromDocSnapshotResult<AdapterTarget>>;
abstract fromBlockSnapshot(
payload: FromBlockSnapshotPayload
): Promise<FromBlockSnapshotResult<AdapterTarget>>;
abstract fromSliceSnapshot(
payload: FromSliceSnapshotPayload
): Promise<FromSliceSnapshotResult<AdapterTarget>>;
abstract toDocSnapshot(
payload: ToDocSnapshotPayload<AdapterTarget>
): Promise<DocSnapshot>;
abstract toBlockSnapshot(
payload: ToBlockSnapshotPayload<AdapterTarget>
): Promise<BlockSnapshot>;
abstract toSliceSnapshot(
payload: ToSliceSnapshotPayload<AdapterTarget>
): Promise<SliceSnapshot | null>;
}
```
+4 -1
View File
@@ -123,7 +123,10 @@ type MyCommandOptions = {
configA: number;
configB: string;
};
export const myCommand: Command<never, never, MyCommandOptions> = (ctx, next) => {
export const myCommand: Command<never, never, MyCommandOptions> = (
ctx,
next
) => {
const { configA, configB } = ctx;
if (fail) {
@@ -46,7 +46,12 @@ export class SimplePageEditor extends LitElement {
doc!: Doc;
override render() {
return html` <editor-host .doc=${this.doc} .specs=${PageEditorBlockSpecs}></editor-host> `;
return html`
<editor-host
.doc=${this.doc}
.specs=${PageEditorBlockSpecs}
></editor-host>
`;
}
}
```
@@ -81,7 +81,11 @@ function createDoc() {
});
doc.addBlock('affine:surface', {}, pageBlockId);
const noteId = doc.addBlock('affine:note', {}, pageBlockId);
doc.addBlock('affine:paragraph', { text: new Text('Hello World!') }, noteId);
doc.addBlock(
'affine:paragraph',
{ text: new Text('Hello World!') },
noteId
);
});
}
+3 -1
View File
@@ -95,7 +95,9 @@ const attributeRenderer: AttributeRenderer<AffineTextAttributes> = (
selected
) => {
// Generate style from delta
return html`<span style=${style}><v-text .str=${delta.insert}></v-text></span>`;
return html`<span style=${style}
><v-text .str=${delta.insert}></v-text
></span>`;
};
const doc = new Y.Doc();
@@ -188,7 +188,11 @@ export class RootService extends BlockService<RootBlockModel> {
// Introducing commands!
this.std.command
.chain()
.tryAll(chain => [chain.getTextSelection(), chain.getImageSelections(), chain.getBlockSelections()])
.tryAll(chain => [
chain.getTextSelection(),
chain.getImageSelections(),
chain.getBlockSelections(),
])
.getSelectedBlocks()
.inline(({ selectedBlocks }) => {
if (!selectedBlocks) return;