chore: bump oxlint & enable more supported rules (#14769)

This commit is contained in:
DarkSky
2026-04-03 03:36:52 +08:00
committed by GitHub
parent cdadf8588a
commit 233004f867
285 changed files with 937 additions and 1983 deletions

View File

@@ -50,7 +50,7 @@ const cardStyleMap: Record<ColorScheme, Record<string, TemplateResult>> = {
@requiredProperties({
actions: PropTypes.array,
context: PropTypes.instanceOf(ToolbarContext),
style$: PropTypes.object,
styleSignal: PropTypes.object,
})
export class CardStyleDropdownMenu extends SignalWatcher(LitElement) {
@property({ attribute: false })
@@ -60,7 +60,7 @@ export class CardStyleDropdownMenu extends SignalWatcher(LitElement) {
accessor context!: ToolbarContext;
@property({ attribute: false })
accessor style$!: Signal<string> | ReadonlySignal<string>;
accessor styleSignal!: Signal<string> | ReadonlySignal<string>;
icons$ = computed(() => cardStyleMap[this.context.theme.theme$.value]);
@@ -68,7 +68,7 @@ export class CardStyleDropdownMenu extends SignalWatcher(LitElement) {
const {
actions,
context,
style$: { value: style },
styleSignal: { value: style },
icons$: { value: icons },
} = this;

View File

@@ -149,7 +149,7 @@ export class MobileMenuButton extends MenuFocusable {
this.disposables.addFromEvent(this, 'click', this.onClick);
}
// eslint-disable-next-line sonarjs/no-identical-functions
// oxlint-disable-next-line sonarjs/no-identical-functions
onClick() {
if (this.data.select(this) !== false) {
this.menu.options.onComplete?.();

View File

@@ -149,7 +149,7 @@ export class Menu {
renderItems(items: MenuConfig[]) {
const result = [];
// eslint-disable-next-line @typescript-eslint/prefer-for-of
// oxlint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < items.length; i++) {
const item = items[i];
const template = item(this, result.length);

View File

@@ -17,7 +17,7 @@ import { EditorChevronDown } from '../toolbar';
@requiredProperties({
actions: PropTypes.array,
context: PropTypes.instanceOf(ToolbarContext),
openDocMode$: PropTypes.object,
openDocModeSignal: PropTypes.object,
updateOpenDocMode: PropTypes.instanceOf(Function),
})
export class OpenDocDropdownMenu extends SignalWatcher(
@@ -59,13 +59,13 @@ export class OpenDocDropdownMenu extends SignalWatcher(
accessor context!: ToolbarContext;
@property({ attribute: false })
accessor openDocMode$!: ReadonlySignal<OpenDocMode>;
accessor openDocModeSignal!: ReadonlySignal<OpenDocMode>;
@property({ attribute: false })
accessor updateOpenDocMode!: (mode: OpenDocMode) => void;
currentAction$ = computed(() => {
const currentOpenDocMode = this.openDocMode$.value;
const currentOpenDocMode = this.openDocModeSignal.value;
return (
this.actions.find(a => a.mode === currentOpenDocMode) ?? this.actions[0]
);

View File

@@ -40,7 +40,7 @@ export interface PeekViewService {
* @returns A promise that resolves when the peek view is closed.
*/
peek(
// eslint-disable-next-line @typescript-eslint/unified-signatures
// oxlint-disable-next-line @typescript-eslint/unified-signatures
element: { target: HTMLElement; template?: TemplateResult },
options?: PeekOptions
): Promise<void>;

View File

@@ -22,7 +22,7 @@ const SIZE_LIST: SizeItem[] = [
] as const;
@requiredProperties({
size$: PropTypes.object,
sizeSignal: PropTypes.object,
})
export class SizeDropdownMenu extends SignalWatcher(
WithDisposable(LitElement)
@@ -68,7 +68,7 @@ export class SizeDropdownMenu extends SignalWatcher(
accessor sizes: readonly SizeItem[] = SIZE_LIST;
@property({ attribute: false })
accessor size$!: Signal<number> | ReadonlySignal<number>;
accessor sizeSignal!: Signal<number> | ReadonlySignal<number>;
@property({ attribute: false })
accessor maxSize: number = MAX_SIZE;
@@ -144,7 +144,7 @@ export class SizeDropdownMenu extends SignalWatcher(
type,
icon,
label,
size$: { value: size },
sizeSignal: { value: size },
} = this;
const isCheckType = type === 'check';
const placeholder = format?.(Math.trunc(size)) ?? Math.trunc(size);

View File

@@ -16,7 +16,7 @@ import { EditorChevronDown } from '../toolbar';
@requiredProperties({
actions: PropTypes.array,
context: PropTypes.instanceOf(ToolbarContext),
viewType$: PropTypes.object,
viewTypeSignal: PropTypes.object,
})
export class ViewDropdownMenu extends SignalWatcher(LitElement) {
@property({ attribute: false })
@@ -26,13 +26,13 @@ export class ViewDropdownMenu extends SignalWatcher(LitElement) {
accessor context!: ToolbarContext;
@property({ attribute: false })
accessor viewType$!: Signal<string> | ReadonlySignal<string>;
accessor viewTypeSignal!: Signal<string> | ReadonlySignal<string>;
override render() {
const {
actions,
context,
viewType$: { value: viewType },
viewTypeSignal: { value: viewType },
} = this;
return html`