Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix: fix eslint (#4687)

白熱a3a55ff33a13
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 67364985b3..521e4a101a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -64,7 +64,6 @@ The structure of the repository is as follows:
├── docs/ documentation
├── e2e/ e2e test cases
├── examples/ demos running on the web
-├── examples-node/ demos running on Node.js
├── mockdata/ mock data for development
├── packages/ Univer core and plugins
├── packages-experimental/ experimental plugins (not published on npm.com)
@@ -228,7 +227,6 @@ pnpm create @univerjs/cli init <project-name>
# npm
npm create @univerjs/cli init <project-name>
-
```
### How to Contribute to Facade API
@@ -239,6 +237,6 @@ Please refer to [How to Contribute to Facade API](./docs/CONTRIBUTING.md).
If you are going to deprecate an API, please follow the steps below:
-1. Mark the API as deprecated in the JSDoc, and use `{@link }` to refer to the new API.
+1. Mark the API as deprecated in the JSDoc, and use `{@link}` to refer to the new API.
2. In the implementation, call `deprecate` of `ILogService` to log a deprecation message.
3. Remove the API in the next minor version. If the API is considered heavily used, you can remove it in the next major version, e.g. 1.0.0.
diff --git a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/set-force-string-cell-ci-chromium-linux.png b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/set-force-string-cell-ci-chromium-linux.png
index 4658657778..a9b2e95d41 100644
Binary files a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/set-force-string-cell-ci-chromium-linux.png and b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/set-force-string-cell-ci-chromium-linux.png differ
diff --git a/packages/core/src/types/interfaces/i-cell-custom-render.ts b/packages/core/src/types/interfaces/i-cell-custom-render.ts
index 496fe8f0e6..2257b349c2 100644
--- a/packages/core/src/types/interfaces/i-cell-custom-render.ts
+++ b/packages/core/src/types/interfaces/i-cell-custom-render.ts
@@ -43,7 +43,7 @@ export interface ICellRenderContext {
export interface ICellCustomRender {
drawWith(ctx: CanvasRenderingContext2D, info: ICellRenderContext, skeleton: any, spreadsheets: any): void;
zIndex?: number;
- isHit?: (position: { x: number;y: number }, info: ICellRenderContext) => boolean;
+ isHit?: (position: { x: number; y: number }, info: ICellRenderContext) => boolean;
onPointerDown?: (info: ICellRenderContext, evt: any) => void;
onPointerEnter?: (info: ICellRenderContext, evt: any) => void;
onPointerLeave?: (info: ICellRenderContext, evt: any) => void;
diff --git a/packages/core/src/types/interfaces/i-document-data.ts b/packages/core/src/types/interfaces/i-document-data.ts
index 4cf753f9f5..f7c64af594 100644
--- a/packages/core/src/types/interfaces/i-document-data.ts
+++ b/packages/core/src/types/interfaces/i-document-data.ts
@@ -709,11 +709,11 @@ export interface ITextStyle extends IStyleBase {
}
export interface IIndentStart {
- indentFirstLine?: INumberUnit ; // indentFirstLine,17.3.1.12 ind (Paragraph Indentation)
- hanging?: INumberUnit ; // hanging,offset of first word except first line
- indentStart?: INumberUnit ; // indentStart
+ indentFirstLine?: INumberUnit; // indentFirstLine,17.3.1.12 ind (Paragraph Indentation)
+ hanging?: INumberUnit; // hanging,offset of first word except first line
+ indentStart?: INumberUnit; // indentStart
tabStops?: ITabStop[]; // tabStops
- indentEnd?: INumberUnit ; // indentEnd
+ indentEnd?: INumberUnit; // indentEnd
}
/**
@@ -732,8 +732,8 @@ export interface IParagraphProperties extends IIndentStart {
direction?: TextDirection; // direction
spacingRule?: SpacingRule; // SpacingRule
snapToGrid?: BooleanNumber; // snapToGrid 17.3.2.34 snapToGrid (Use Document Grid Settings For Inter-Character Spacing)
- spaceAbove?: INumberUnit ; // spaceAbove before beforeLines (Spacing Above Paragraph)
- spaceBelow?: INumberUnit ; // spaceBelow after afterLines (Spacing Below Paragraph)
+ spaceAbove?: INumberUnit; // spaceAbove before beforeLines (Spacing Above Paragraph)
+ spaceBelow?: INumberUnit; // spaceBelow after afterLines (Spacing Below Paragraph)
borderBetween?: IParagraphBorder; // borderBetween
borderTop?: IParagraphBorder; // borderTop
borderBottom?: IParagraphBorder; // borderBottom
diff --git a/packages/engine-render/src/scene.ts b/packages/engine-render/src/scene.ts
index bd400d69ab..fc7edec6d2 100644
--- a/packages/engine-render/src/scene.ts
+++ b/packages/engine-render/src/scene.ts
@@ -39,11 +39,11 @@ export const MAIN_VIEW_PORT_KEY = 'viewMain';
export interface ISceneInputControlOptions {
enableDown: boolean;
- enableUp: boolean ;
- enableMove: boolean ;
- enableWheel: boolean ;
- enableEnter: boolean ;
- enableLeave: boolean ;
+ enableUp: boolean;
+ enableMove: boolean;
+ enableWheel: boolean;
+ enableEnter: boolean;
+ enableLeave: boolean;
}
export class Scene extends Disposable {
private _sceneKey: string = '';
diff --git a/packages/sheets-conditional-formatting-ui/src/controllers/cf.i18n.controller.ts b/packages/sheets-conditional-formatting-ui/src/controllers/cf.i18n.controller.ts
index 6268d1adca..c9e30b68a2 100644
--- a/packages/sheets-conditional-formatting-ui/src/controllers/cf.i18n.controller.ts
+++ b/packages/sheets-conditional-formatting-ui/src/controllers/cf.i18n.controller.ts
@@ -51,7 +51,7 @@ export class ConditionalFormattingI18nController extends Disposable {
private _findReplaceIndex = (text: string) => {
const reg = /\{([^}]+)?\}/g;
- const result: { startIndex: number;key: number;endIndex: number }[] = [];
+ const result: { startIndex: number; key: number; endIndex: number }[] = [];
let currentValue = reg.exec(text);
while (currentValue) {
result.push({
diff --git a/packages/sheets-conditional-formatting/src/models/type.ts b/packages/sheets-conditional-formatting/src/models/type.ts
index 553183bfee..56ecf3d58c 100644
--- a/packages/sheets-conditional-formatting/src/models/type.ts
+++ b/packages/sheets-conditional-formatting/src/models/type.ts
@@ -96,7 +96,7 @@ export interface IColorScale extends IBaseCfRule {
export interface IIconSet extends IBaseCfRule {
type: CFRuleType.iconSet;
isShowValue: boolean;
- config: { operator: CFNumberOperator;value: IValueConfig;iconType: IIconType; iconId: string }[];
+ config: { operator: CFNumberOperator; value: IValueConfig; iconType: IIconType; iconId: string }[];
}
export type IConditionalFormattingRuleConfig = IColorScale | IDataBar | IUniqueValuesHighlightCell |
diff --git a/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx b/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx
index 5865e271f6..3b45fa8349 100644
--- a/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/list-dropdown/index.tsx
@@ -42,7 +42,7 @@ interface ISelectListProps {
value: string[];
onChange: (val: string[]) => void;
multiple?: boolean;
- options: { label: string;value: string; color?: string }[];
+ options: { label: string; value: string; color?: string }[];
title?: string;
onEdit?: () => void;
style?: React.CSSProperties;
diff --git a/packages/sheets-data-validation/src/models/rule-matrix.ts b/packages/sheets-data-validation/src/models/rule-matrix.ts
index 7665cd00a5..5b68929049 100644
--- a/packages/sheets-data-validation/src/models/rule-matrix.ts
+++ b/packages/sheets-data-validation/src/models/rule-matrix.ts
@@ -138,7 +138,7 @@ export class RuleMatrix {
this._addRule(ruleId, _newRanges);
}
- addRangeRules(rules: { id: string;ranges: IRange[] }[]) {
+ addRangeRules(rules: { id: string; ranges: IRange[] }[]) {
rules.forEach(({ id: ruleId, ranges }) => {
if (!ranges.length) {
return;
diff --git a/packages/sheets-drawing-ui/src/commands/commands/move-drawings.command.ts b/packages/sheets-drawing-ui/src/commands/commands/move-drawings.command.ts
index 599816d658..c2a0e61bc4 100644
--- a/packages/sheets-drawing-ui/src/commands/commands/move-drawings.command.ts
+++ b/packages/sheets-drawing-ui/src/commands/commands/move-drawings.command.ts
@@ -26,7 +26,7 @@ import { ClearSheetDrawingTransformerOperation } from '../operations/clear-drawi
import { SetSheetDrawingCommand } from './set-sheet-drawing.command';
export interface IMoveDrawingsCommandParams {
- direction: Direction ;
+ direction: Direction;
}
export const MoveDrawingsCommand: ICommand = {
diff --git a/packages/sheets/src/basics/const/command-listener-const.ts b/packages/sheets/src/basics/const/command-listener-const.ts
index ec41665ec8..8b2fb17906 100644
--- a/packages/sheets/src/basics/const/command-listener-const.ts
+++ b/packages/sheets/src/basics/const/command-listener-const.ts
@@ -29,7 +29,8 @@ import type { ISetWorksheetDefaultStyleMutationParams } from '../../commands/mut
import type {
ISetWorksheetRowAutoHeightMutationParams,
ISetWorksheetRowHeightMutationParams,
- ISetWorksheetRowIsAutoHeightMutationParams } from '../../commands/mutations/set-worksheet-row-height.mutation';
+ ISetWorksheetRowIsAutoHeightMutationParams,
+} from '../../commands/mutations/set-worksheet-row-height.mutation';
import type { IToggleGridlinesMutationParams } from '../../commands/mutations/toggle-gridlines.mutation';
import type { ISetWorksheetActiveOperationParams } from '../../commands/operations/set-worksheet-active.operation';
import type { IAddWorksheetMergeMutationParams, IInsertColMutationParams, IInsertRowMutationParams, IRemoveColMutationParams, IRemoveRowsMutationParams, IRemoveWorksheetMergeMutationParams, IWorksheetRangeThemeStyleMutationParams } from '../interfaces';
@@ -248,7 +249,7 @@ export type CommandListenerValueChange =
};
// eslint-disable-next-line max-lines-per-function
-export function getValueChangedEffectedRange(commandInfo: ICommandInfo): { unitId: string;subUnitId: string; range: IRange }[] {
+export function getValueChangedEffectedRange(commandInfo: ICommandInfo): { unitId: string; subUnitId: string; range: IRange }[] {
switch (commandInfo.id) {
case SheetValueChangeType.SET_RANGE_VALUES: {
const params = commandInfo.params as ISetRangeValuesMutationParams;
diff --git a/packages/ui/src/components/hooks/virtual-list.ts b/packages/ui/src/components/hooks/virtual-list.ts
index 1a2f313906..6fa42536d2 100644
--- a/packages/ui/src/components/hooks/virtual-list.ts
+++ b/packages/ui/src/components/hooks/virtual-list.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-import { useEffect, useMemo, useRef, useState } from 'react';
import type { Nullable } from '@univerjs/core';
+import { useEffect, useMemo, useRef, useState } from 'react';
import { useEvent } from './event';
type ItemHeight<T> = (index: number, data: T) => number;
@@ -40,13 +40,13 @@ const useVirtualList = <T>(list: T[], options: IVirtualListOptions<T>) => {
const itemHeightRef = useLatest(itemHeight);
- const [size, setSize] = useState<Nullable<{ width: number;height: number }>>(null);
+ const [size, setSize] = useState<Nullable<{ width: number; height: number }>>(null);
const scrollTriggerByScrollToFunc = useRef(false);
const [targetList, setTargetList] = useState<{ index: number; data: T }[]>([]);
- const [wrapperStyle, setWrapperStyle] = useState<{ height: string | undefined;marginTop: string | undefined }>({ height: undefined, marginTop: undefined });
+ const [wrapperStyle, setWrapperStyle] = useState<{ height: string | undefined; marginTop: string | undefined }>({ height: undefined, marginTop: undefined });
const getVisibleCount = (containerHeight: number, fromIndex: number) => {
if (typeof itemHeightRef.current === 'number') {