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(base-sheets): fix eslint error

Dushusir35750819f45b
diff --git a/.eslintrc.js b/.eslintrc.js
index 0d5a68f239..ad68550e4d 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -28,8 +28,8 @@ module.exports = {
},
plugins: ['@typescript-eslint', 'prettier', 'import', 'import-newlines', 'unused-imports'],
rules: {
- 'no-cond-assign':'off',
- 'no-restricted-globals':"off",
+ 'no-cond-assign': 'off',
+ 'no-restricted-globals': 'off',
'prettier/prettier': [
'error',
{
@@ -79,7 +79,13 @@ module.exports = {
accessibility: 'no-public',
},
],
- '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }],
+ '@typescript-eslint/consistent-type-assertions': [
+ 'error',
+ {
+ assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow-as-parameter',
+ },
+ ],
'spaced-comment': 'off',
eqeqeq: ['error', 'always', { null: 'ignore' }],
diff --git a/packages/base-render/src/Types/index.d.ts b/packages/base-render/src/Types/index.d.ts
index 7cbf0e33ef..42afbce2d2 100644
--- a/packages/base-render/src/Types/index.d.ts
+++ b/packages/base-render/src/Types/index.d.ts
@@ -1,2 +1,2 @@
export * from '../index';
-declare module '@univer/base-render' { }
+declare module '@univer/base-render' {}
diff --git a/packages/base-sheets/package.json b/packages/base-sheets/package.json
index 3a188a62c2..89df1f00dd 100644
--- a/packages/base-sheets/package.json
+++ b/packages/base-sheets/package.json
@@ -55,7 +55,8 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/base-sheets": "workspace:^0.0.1",
+ "@univer/base-component": "workspace:^0.0.1",
+ "@univer/base-render": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
"@univer/core": "workspace:^0.0.1",
"@univer/sheets-plugin-clipboard": "workspace:^0.0.1",
diff --git a/packages/base-sheets/src/Controller/CellEditorController.ts b/packages/base-sheets/src/Controller/CellEditorController.ts
index 78302e66f4..219afdd3f6 100644
--- a/packages/base-sheets/src/Controller/CellEditorController.ts
+++ b/packages/base-sheets/src/Controller/CellEditorController.ts
@@ -148,8 +148,8 @@ export class CellEditorController {
this.enterEditMode();
}
});
- this._plugin.getObserver('onSpreadsheetKeyCompositionUpdateObservable')?.add((evt: IKeyboardEvent) => { });
- this._plugin.getObserver('onSpreadsheetKeyCompositionEndObservable')?.add((evt: IKeyboardEvent) => { });
+ this._plugin.getObserver('onSpreadsheetKeyCompositionUpdateObservable')?.add((evt: IKeyboardEvent) => {});
+ this._plugin.getObserver('onSpreadsheetKeyCompositionEndObservable')?.add((evt: IKeyboardEvent) => {});
this._cellEditExtensionManager = new CellEditExtensionManager();
}
@@ -445,7 +445,7 @@ export class CellEditorController {
this.enterEditMode();
}
- handleBackSpace() { }
+ handleBackSpace() {}
handleDirection(direction: Direction) {
// todo
diff --git a/packages/base-sheets/src/Controller/Selection/SelectionManager.ts b/packages/base-sheets/src/Controller/Selection/SelectionManager.ts
index b2bfb47dd3..5b5bd8e873 100644
--- a/packages/base-sheets/src/Controller/Selection/SelectionManager.ts
+++ b/packages/base-sheets/src/Controller/Selection/SelectionManager.ts
@@ -167,8 +167,6 @@ export class SelectionManager {
this._selectionControls.push(control);
});
- console.log('setSelectionModel');
-
this.setSelectionModel();
}
}
@@ -308,7 +306,7 @@ export class SelectionManager {
this._selectionModels.set(worksheetId, models);
}
- recreateControlsByRangeData() { }
+ // recreateControlsByRangeData() { }
/**
* Move the selection according to different directions, usually used for the shortcut key operation of ↑ ↓ ← →
@@ -635,25 +633,25 @@ export class SelectionManager {
const cellInfo = cell
? {
- row: cell.row,
- column: cell.column,
- isMerged: false,
- isMergedMainCell: false,
- startY: 0,
- endY: 0,
- startX: 0,
- endX: 0,
- mergeInfo: {
- startColumn,
- startRow,
- endColumn,
- endRow,
- startY: 0,
- endY: 0,
- startX: 0,
- endX: 0,
- },
- }
+ row: cell.row,
+ column: cell.column,
+ isMerged: false,
+ isMergedMainCell: false,
+ startY: 0,
+ endY: 0,
+ startX: 0,
+ endX: 0,
+ mergeInfo: {
+ startColumn,
+ startRow,
+ endColumn,
+ endRow,
+ startY: 0,
+ endY: 0,
+ startX: 0,
+ endX: 0,
+ },
+ }
: null;
// Only update data, not render
diff --git a/packages/base-sheets/src/Controller/SheetContainerController.ts b/packages/base-sheets/src/Controller/SheetContainerController.ts
index c4516c2e60..eb32f4b74d 100644
--- a/packages/base-sheets/src/Controller/SheetContainerController.ts
+++ b/packages/base-sheets/src/Controller/SheetContainerController.ts
@@ -1,4 +1,4 @@
-import { BooleanNumber, CommandManager, ContextBase } from '@univer/core';
+import { BooleanNumber, CommandManager, ISheetActionData, SheetActionBase } from '@univer/core';
import { BaseComponentSheet, BaseComponentRender } from '@univer/base-component';
import { SheetPlugin } from '../SheetPlugin';
@@ -18,10 +18,10 @@ export class SheetContainerController {
private _initialize() {
// Monitor all command changes and automatically trigger the refresh of the canvas
CommandManager.getCommandObservers().add(({ actions }) => {
- const plugin: ContextBase = this._plugin;
+ const plugin: SheetPlugin = this._plugin;
if (!plugin) return;
- const action = actions[0];
+ const action = actions[0] as SheetActionBase<ISheetActionData, ISheetActionData, void>;
const worksheet = action.getWorkSheet();
const currentUnitId = plugin.context.getWorkBook().getUnitId();
@@ -29,8 +29,6 @@ export class SheetContainerController {
if (currentUnitId !== actionUnitId) return;
- console.log('sheetContainer===',actions, currentUnitId, actionUnitId);
-
// Only the currently active worksheet needs to be refreshed
if (worksheet.getConfig().status === BooleanNumber.TRUE) {
try {
diff --git a/packages/base-sheets/src/main.tsx b/packages/base-sheets/src/main.tsx
index 93d541cfd0..d0de142235 100644
--- a/packages/base-sheets/src/main.tsx
+++ b/packages/base-sheets/src/main.tsx
@@ -3,8 +3,8 @@ import { RenderEngine } from '@univer/base-render';
import { UniverComponentSheet } from '@univer/style-universheet';
import { ClipboardPlugin } from '@univer/sheets-plugin-clipboard';
import { NumfmtPlugin } from '@univer/sheets-plugin-numfmt';
-import { DEFAULT_FORMULA_DATA,DEFAULT_FORMULA_DATA_DOWN, FormulaPlugin } from '@univer/sheets-plugin-formula';
-import {DEFAULT_WORKBOOK_DATA,DEFAULT_WORKBOOK_DATA_DOWN} from '@univer/common-plugin-data'
+import { DEFAULT_FORMULA_DATA, DEFAULT_FORMULA_DATA_DOWN, FormulaPlugin } from '@univer/sheets-plugin-formula';
+import { DEFAULT_WORKBOOK_DATA, DEFAULT_WORKBOOK_DATA_DOWN } from '@univer/common-plugin-data';
import { SheetPlugin } from './SheetPlugin';
const uiDefaultConfigUp = {
@@ -103,7 +103,6 @@ univerSheetUp.installPlugin(clipboardPlugin);
univerSheetUp.installPlugin(new NumfmtPlugin());
(window as any).sheetPlugin = sheetPlugin;
-
const uiDefaultConfigDown = {
container: 'universheet-demo-down',
selections: {
@@ -124,7 +123,6 @@ const uiDefaultConfigDown = {
},
};
-
const univerSheetDown = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA_DOWN);
univerSheetDown.installPlugin(new RenderEngine());
univerSheetDown.installPlugin(new UniverComponentSheet());
diff --git a/packages/common-plugin-collaboration/package.json b/packages/common-plugin-collaboration/package.json
index cbe11215ba..2a7801495a 100644
--- a/packages/common-plugin-collaboration/package.json
+++ b/packages/common-plugin-collaboration/package.json
@@ -38,7 +38,6 @@
},
"license": "MIT",
"dependencies": {
- "@univer/common-plugin-collaboration": "workspace:^0.0.1",
"@univer/core": "workspace:^0.0.1"
},
"devDependencies": {
diff --git a/packages/sheets-plugin-alternating-colors/package.json b/packages/sheets-plugin-alternating-colors/package.json
index 702cc656ba..33035ea60f 100644
--- a/packages/sheets-plugin-alternating-colors/package.json
+++ b/packages/sheets-plugin-alternating-colors/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-alternating-colors": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-comment/package.json b/packages/sheets-plugin-comment/package.json
index 30b8ae382b..c41d3b19ec 100644
--- a/packages/sheets-plugin-comment/package.json
+++ b/packages/sheets-plugin-comment/package.json
@@ -51,7 +51,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-comment": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-conditional-format/package.json b/packages/sheets-plugin-conditional-format/package.json
index b2c2119092..de3b4bef9d 100644
--- a/packages/sheets-plugin-conditional-format/package.json
+++ b/packages/sheets-plugin-conditional-format/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-conditional-format": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-data-validation/package.json b/packages/sheets-plugin-data-validation/package.json
index 9340184e2c..e0da0e62de 100644
--- a/packages/sheets-plugin-data-validation/package.json
+++ b/packages/sheets-plugin-data-validation/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-data-validation": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-filter/package.json b/packages/sheets-plugin-filter/package.json
index 80758374d3..7e2d8c6fbf 100644
--- a/packages/sheets-plugin-filter/package.json
+++ b/packages/sheets-plugin-filter/package.json
@@ -48,7 +48,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-filter": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-find/package.json b/packages/sheets-plugin-find/package.json
index bfb3ec000d..5768b19a80 100644
--- a/packages/sheets-plugin-find/package.json
+++ b/packages/sheets-plugin-find/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-find": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-formula/package.json b/packages/sheets-plugin-formula/package.json
index dda6b89a3e..91bfdee384 100644
--- a/packages/sheets-plugin-formula/package.json
+++ b/packages/sheets-plugin-formula/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-formula": "workspace:^0.0.1",
"@univer/base-formula-engine": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-freeze/package.json b/packages/sheets-plugin-freeze/package.json
index aab8d5a770..bdb4327c4e 100644
--- a/packages/sheets-plugin-freeze/package.json
+++ b/packages/sheets-plugin-freeze/package.json
@@ -51,7 +51,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-freeze": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-group/package.json b/packages/sheets-plugin-group/package.json
index 365db41407..854c44274b 100644
--- a/packages/sheets-plugin-group/package.json
+++ b/packages/sheets-plugin-group/package.json
@@ -56,7 +56,6 @@
"vite": "^2.4.4"
},
"dependencies": {
- "@univer/sheets-plugin-group": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-image/package.json b/packages/sheets-plugin-image/package.json
index 441ee06e68..46f8d64930 100644
--- a/packages/sheets-plugin-image/package.json
+++ b/packages/sheets-plugin-image/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-image": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-link/package.json b/packages/sheets-plugin-link/package.json
index 87e5c7ba59..ed0d7d1c4d 100644
--- a/packages/sheets-plugin-link/package.json
+++ b/packages/sheets-plugin-link/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-link": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-pivot-table/package.json b/packages/sheets-plugin-pivot-table/package.json
index 20a81fe239..3292a04cc5 100644
--- a/packages/sheets-plugin-pivot-table/package.json
+++ b/packages/sheets-plugin-pivot-table/package.json
@@ -51,7 +51,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-pivot-table": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-print/package.json b/packages/sheets-plugin-print/package.json
index 6a4db0f1fe..d60b55289b 100644
--- a/packages/sheets-plugin-print/package.json
+++ b/packages/sheets-plugin-print/package.json
@@ -51,7 +51,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-print": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-protection/package.json b/packages/sheets-plugin-protection/package.json
index 985dca3551..c60f4406e4 100644
--- a/packages/sheets-plugin-protection/package.json
+++ b/packages/sheets-plugin-protection/package.json
@@ -51,7 +51,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-protection": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-screenshot/package.json b/packages/sheets-plugin-screenshot/package.json
index 6acd4ef3be..fd4be7392f 100644
--- a/packages/sheets-plugin-screenshot/package.json
+++ b/packages/sheets-plugin-screenshot/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-screenshot": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-sort/package.json b/packages/sheets-plugin-sort/package.json
index d6f91d4fa2..4d682eba92 100644
--- a/packages/sheets-plugin-sort/package.json
+++ b/packages/sheets-plugin-sort/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-sort": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",
diff --git a/packages/sheets-plugin-split-column/package.json b/packages/sheets-plugin-split-column/package.json
index e522667e30..7bb587c98d 100644
--- a/packages/sheets-plugin-split-column/package.json
+++ b/packages/sheets-plugin-split-column/package.json
@@ -52,7 +52,6 @@
"vite-plugin-external": "1.2.3"
},
"dependencies": {
- "@univer/sheets-plugin-split-column": "workspace:^0.0.1",
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/common-plugin-data": "workspace:^0.0.1",