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.

style(workspace): eslint script

Dushusir5562cb30eca2
diff --git a/.eslintrc.js b/.eslintrc.js
index e4521a27bb..c6a3974e8c 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,5 +1,9 @@
module.exports = {
"root": true,
+ env: {
+ browser: true,
+ es2021: true,
+ },
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint", "prettier", 'import', 'import-newlines', 'unused-imports'
@@ -11,6 +15,8 @@ module.exports = {
"prettier"
],
"parserOptions": {
+ "ecmaVersion": 12,
+ "sourceType": "module",
"project": "./tsconfig.json"
},
rules: {
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 75040296fd..520f41678b 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
-# npm run pre-lint
+npm run pre-lint
diff --git a/package.json b/package.json
index 256bd6b127..41d2009704 100644
--- a/package.json
+++ b/package.json
@@ -28,8 +28,8 @@
"postinstall": "node scripts/postinstall.js",
"prepare": "husky install",
"pre-lint": "lint-staged",
- "lint": "eslint ./packages/cores/src --ext .ts,.tsx",
- "lint-and-fix": "eslint ./packages/core/src --ext .ts,.tsx --fix"
+ "lint": "eslint --cache --ext .ts,.tsx packages/{core,base-render,base-ui,base-sheets,ui-plugin-sheets}/src/*/**.ts{x,}",
+ "lint-and-fix": "eslint --ext .ts,.tsx packages/{core,base-render,base-ui,base-sheets,ui-plugin-sheets}/src/*/**.ts{x,} --fix"
},
"author": "DreamNum <[email protected]>",
"license": "MIT",
@@ -67,8 +67,8 @@
"typescript": "^4.4.1-rc"
},
"lint-staged": {
- "./packages/**/*.ts?(x)": [
- "eslint --fix"
+ "./packages/{core,base-render,base-ui,base-sheets,ui-plugin-sheets}/src/**/*.ts?(x)": [
+ ["eslint --fix","git add"]
]
}
}
diff --git a/packages/base-sheets/src/Controller/SheetBarController.ts b/packages/base-sheets/src/Controller/SheetBarController.ts
index 897b1250f3..116f7163b8 100644
--- a/packages/base-sheets/src/Controller/SheetBarController.ts
+++ b/packages/base-sheets/src/Controller/SheetBarController.ts
@@ -63,7 +63,6 @@ export class SheetBarControl {
const workbook = this._plugin.getContext().getWorkBook();
const worksheet = workbook.getSheetBySheetId(value as string);
if (worksheet) {
- debugger;
worksheet.hideSheet();
}
break;