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
@@ -29,9 +29,11 @@ export const typeConfig = (property: Property) => {
style="color: var(--affine-text-secondary-color);gap:4px;font-size: 14px;"
>
${renderUniLit(property.icon)}
${property.view.propertyMetas$.value.find(
v => v.type === property.type$.value
)?.config.name}
${
property.view.propertyMetas$.value.find(
v => v.type === property.type$.value
)?.config.name
}
</div>`,
options: {
title: {
@@ -361,11 +361,13 @@ export class MultiTagSelect extends SignalWatcher(
});
return html` <div class="${tagContainerStyle}" style=${style}>
<div data-testid="tag-name" class="${tagTextStyle}">${name}</div>
${onDelete
? html` <div class="${tagDeleteIconStyle}" @click="${onDelete}">
${CloseIcon()}
</div>`
: nothing}
${
onDelete
? html` <div class="${tagDeleteIconStyle}" @click="${onDelete}">
${CloseIcon()}
</div>`
: nothing
}
</div>`;
}
@@ -402,27 +404,31 @@ export class MultiTagSelect extends SignalWatcher(
@click="${select.select}"
>
<div class="${selectOptionContentStyle}">
${select.isCreate
? html` <div class="${selectOptionNewIconStyle}">
Create
</div>`
: html`
<div
${dragHandler(select.id)}
class="${selectOptionDragHandlerStyle}"
></div>
`}
${
select.isCreate
? html` <div class="${selectOptionNewIconStyle}">
Create
</div>`
: html`
<div
${dragHandler(select.id)}
class="${selectOptionDragHandlerStyle}"
></div>
`
}
${this.renderTag(select.value, select.color)}
</div>
${!select.isCreate
? html` <div
class="${selectOptionIconStyle}"
@click="${clickOption}"
data-testid="option-more"
>
${MoreHorizontalIcon()}
</div>`
: null}
${
!select.isCreate
? html` <div
class="${selectOptionIconStyle}"
@click="${clickOption}"
data-testid="option-more"
>
${MoreHorizontalIcon()}
</div>`
: null
}
</div>
`;
}
@@ -586,9 +592,13 @@ const popMobileTagSelect = (target: PopupTarget, ops: TagSelectOptions) => {
});
return html`
<div style="display: flex; align-items:center;">
${option.isCreate
? html` <div style="margin-right: 8px;">Create</div>`
: ''}
${
option.isCreate
? html` <div style="margin-right: 8px;">
Create
</div>`
: ''
}
<div class="${tagContainerStyle}" style=${style}>
<div class="${tagTextStyle}">${option.value}</div>
</div>
@@ -256,15 +256,17 @@ export class RecordDetail extends SignalWatcher(
);
}
)}
${!this.readonly
? html` <div
class="add-property"
@click="${this._clickAddProperty}"
>
<div class="icon">${PlusIcon()}</div>
Add Property
</div>`
: nothing}
${
!this.readonly
? html` <div
class="add-property"
@click="${this._clickAddProperty}"
>
<div class="icon">${PlusIcon()}</div>
Add Property
</div>`
: nothing
}
</div>
${keyed(this.rowId, this.renderNote())}
</div>
@@ -96,16 +96,18 @@ const GroupTitleMobile = (
${icon} ${renderUniLit(groupData.view, props)} ${columnName}
${GroupHeaderCount(groupData)}
</div>
${ops.readonly
? nothing
: html` <div class="group-header-ops">
<div @click="${ops.clickAdd}" class="group-header-op add-card">
${PlusIcon()}
</div>
<div @click="${ops.clickOps}" class="group-header-op">
${MoreHorizontalIcon()}
</div>
</div>`}
${
ops.readonly
? nothing
: html` <div class="group-header-ops">
<div @click="${ops.clickAdd}" class="group-header-op add-card">
${PlusIcon()}
</div>
<div @click="${ops.clickOps}" class="group-header-op">
${MoreHorizontalIcon()}
</div>
</div>`
}
`;
};
@@ -211,15 +213,17 @@ export const GroupTitle = (
${icon} ${renderUniLit(groupData.view, props)} ${columnName}
${GroupHeaderCount(groupData)}
</div>
${ops.readonly
? nothing
: html` <div class="group-header-ops">
<div @click="${ops.clickAdd}" class="group-header-op add-card">
${PlusIcon()}
</div>
<div @click="${ops.clickOps}" class="group-header-op">
${MoreHorizontalIcon()}
</div>
</div>`}
${
ops.readonly
? nothing
: html` <div class="group-header-ops">
<div @click="${ops.clickAdd}" class="group-header-op add-card">
${PlusIcon()}
</div>
<div @click="${ops.clickOps}" class="group-header-op">
${MoreHorizontalIcon()}
</div>
</div>`
}
`;
};
@@ -25,9 +25,11 @@ export class BooleanGroupView extends BaseGroup<boolean, NonNullable<unknown>> {
}
return html` <div class="data-view-group-title-boolean-view">
${this.value
? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
: CheckBoxUnIcon()}
${
this.value
? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
: CheckBoxUnIcon()
}
</div>`;
}
}
@@ -224,9 +224,9 @@ export class GroupSetting extends SignalWatcher(
<div
${sortable(g.key)}
${dragHandler(g.key)}
class="dv-hover dv-round-4 group-item ${g.hide$.value
? 'group-hidden'
: ''}"
class="dv-hover dv-round-4 group-item ${
g.hide$.value ? 'group-hidden' : ''
}"
>
<div class="group-item-drag-bar"></div>
<div
@@ -376,27 +376,28 @@ export const buildGroupSettingItems = (
['Month', 'date-month'],
['Year', 'date-year'],
] as [string, string][]
).map(
([label, key]): MenuConfig =>
menu.action({
name: label,
label: () => {
const isSelected =
group.groupInfo$.value?.config.name === key;
return html`<span
style="font-size:14px;color:${isSelected
).map(([label, key]): MenuConfig =>
menu.action({
name: label,
label: () => {
const isSelected =
group.groupInfo$.value?.config.name === key;
return html`<span
style="font-size:14px;color:${
isSelected
? 'var(--affine-text-emphasis-color)'
: 'var(--affine-text-secondary-color)'}"
>${label}</span
>`;
},
isSelected:
group.groupInfo$.value?.config.name === key,
select: () => {
group.changeGroupMode(key);
return false;
},
})
: 'var(--affine-text-secondary-color)'
}"
>${label}</span
>`;
},
isSelected:
group.groupInfo$.value?.config.name === key,
select: () => {
group.changeGroupMode(key);
return false;
},
})
)
),
],
@@ -417,10 +418,12 @@ export const buildGroupSettingItems = (
<div
style="display:flex;align-items:center;gap:4px;font-size:14px;line-height:20px;color:var(--affine-text-secondary-color);margin-left:8px;"
>
${group.groupInfo$.value?.config.name ===
'date-week-mon'
? 'Monday'
: 'Sunday'}
${
group.groupInfo$.value?.config.name ===
'date-week-mon'
? 'Monday'
: 'Sunday'
}
</div>
`,
options: {
@@ -439,9 +442,11 @@ export const buildGroupSettingItems = (
group.groupInfo$.value?.config.name ===
key;
return html`<span
style="font-size:14px;color:${isSelected
? 'var(--affine-text-emphasis-color)'
: 'var(--affine-text-secondary-color)'}"
style="font-size:14px;color:${
isSelected
? 'var(--affine-text-emphasis-color)'
: 'var(--affine-text-secondary-color)'
}"
>${label}</span
>`;
},
@@ -485,9 +490,11 @@ export const buildGroupSettingItems = (
label: () => {
const isSelected = group.sortAsc$.value;
return html`<span
style="font-size:14px;color:${isSelected
? 'var(--affine-text-emphasis-color)'
: 'var(--affine-text-secondary-color)'}"
style="font-size:14px;color:${
isSelected
? 'var(--affine-text-emphasis-color)'
: 'var(--affine-text-secondary-color)'
}"
>Oldest first</span
>`;
},
@@ -502,9 +509,11 @@ export const buildGroupSettingItems = (
label: () => {
const isSelected = !group.sortAsc$.value;
return html`<span
style="font-size:14px;color:${isSelected
? 'var(--affine-text-emphasis-color)'
: 'var(--affine-text-secondary-color)'}"
style="font-size:14px;color:${
isSelected
? 'var(--affine-text-emphasis-color)'
: 'var(--affine-text-secondary-color)'
}"
>Newest first</span
>`;
},