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,prettier

Dushusirdf9128948649
diff --git a/.eslintrc.js b/.eslintrc.js
index ad68550e4d..2a22e7e235 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -96,6 +96,7 @@ module.exports = {
'prefer-regex-literals': 'off',
'@typescript-eslint/default-param-last': 'off',
'grouped-accessor-pairs': 'off',
+ '@typescript-eslint/member-ordering': ['error', { default: ['private-field', 'protected-field', 'public-field', 'private-method', 'protected-method', 'public-method'] }],
},
settings: {
'import/parsers': {
diff --git a/packages/base-docs/.eslintrc.js b/packages/base-docs/.eslintrc.js
deleted file mode 100644
index 7f4cf3e7ba..0000000000
--- a/packages/base-docs/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-module.exports = {
- env: {
- browser: true,
- es2021: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- extends: [
- 'airbnb-typescript',
- 'prettier',
- 'eslint:recommended',
- 'plugin:import/recommended',
- 'plugin:import/typescript',
- ],
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- project: './tsconfig.json',
- },
- plugins: ['@typescript-eslint', 'prettier', 'import'],
- rules: {
- 'prettier/prettier': [
- 'error',
- {
- endOfLine: 'auto',
- },
- ],
- 'import/prefer-default-export': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true },
- ],
- // turn on errors for missing imports
- 'import/no-unresolved': 'error',
- },
- settings: {
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts', '.tsx'],
- },
- 'import/resolver': {
- typescript: {
- alwaysTryTypes: true, // always try to resolve config under `<root>@config` directory even it doesn't contain any source code, like `@config/unist`
-
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
-
- // use <root>/path/to/folder/tsconfig.json
- project: './tsconfig.json',
- },
- },
- },
-};
diff --git a/packages/base-docs/.prettierrc.cjs b/packages/base-docs/.prettierrc.cjs
deleted file mode 100644
index 6604107223..0000000000
--- a/packages/base-docs/.prettierrc.cjs
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- singleQuote: true,
- trailingComma: 'es5',
- tabWidth: 4,
- semi: true,
- printWidth: 180,
-};
diff --git a/packages/base-formula-engine/.eslintrc.js b/packages/base-formula-engine/.eslintrc.js
deleted file mode 100644
index 7f4cf3e7ba..0000000000
--- a/packages/base-formula-engine/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-module.exports = {
- env: {
- browser: true,
- es2021: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- extends: [
- 'airbnb-typescript',
- 'prettier',
- 'eslint:recommended',
- 'plugin:import/recommended',
- 'plugin:import/typescript',
- ],
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- project: './tsconfig.json',
- },
- plugins: ['@typescript-eslint', 'prettier', 'import'],
- rules: {
- 'prettier/prettier': [
- 'error',
- {
- endOfLine: 'auto',
- },
- ],
- 'import/prefer-default-export': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true },
- ],
- // turn on errors for missing imports
- 'import/no-unresolved': 'error',
- },
- settings: {
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts', '.tsx'],
- },
- 'import/resolver': {
- typescript: {
- alwaysTryTypes: true, // always try to resolve config under `<root>@config` directory even it doesn't contain any source code, like `@config/unist`
-
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
-
- // use <root>/path/to/folder/tsconfig.json
- project: './tsconfig.json',
- },
- },
- },
-};
diff --git a/packages/base-formula-engine/.prettierrc.cjs b/packages/base-formula-engine/.prettierrc.cjs
deleted file mode 100644
index 6604107223..0000000000
--- a/packages/base-formula-engine/.prettierrc.cjs
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- singleQuote: true,
- trailingComma: 'es5',
- tabWidth: 4,
- semi: true,
- printWidth: 180,
-};
diff --git a/packages/base-slides/.eslintrc.js b/packages/base-slides/.eslintrc.js
deleted file mode 100644
index 7f4cf3e7ba..0000000000
--- a/packages/base-slides/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-module.exports = {
- env: {
- browser: true,
- es2021: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- extends: [
- 'airbnb-typescript',
- 'prettier',
- 'eslint:recommended',
- 'plugin:import/recommended',
- 'plugin:import/typescript',
- ],
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- project: './tsconfig.json',
- },
- plugins: ['@typescript-eslint', 'prettier', 'import'],
- rules: {
- 'prettier/prettier': [
- 'error',
- {
- endOfLine: 'auto',
- },
- ],
- 'import/prefer-default-export': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true },
- ],
- // turn on errors for missing imports
- 'import/no-unresolved': 'error',
- },
- settings: {
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts', '.tsx'],
- },
- 'import/resolver': {
- typescript: {
- alwaysTryTypes: true, // always try to resolve config under `<root>@config` directory even it doesn't contain any source code, like `@config/unist`
-
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
-
- // use <root>/path/to/folder/tsconfig.json
- project: './tsconfig.json',
- },
- },
- },
-};
diff --git a/packages/base-slides/.prettierrc.cjs b/packages/base-slides/.prettierrc.cjs
deleted file mode 100644
index 6604107223..0000000000
--- a/packages/base-slides/.prettierrc.cjs
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- singleQuote: true,
- trailingComma: 'es5',
- tabWidth: 4,
- semi: true,
- printWidth: 180,
-};
diff --git a/packages/base-ui/src/Components/index.ts b/packages/base-ui/src/Components/index.ts
index 7540cf3a4f..ce9e5422f8 100644
--- a/packages/base-ui/src/Components/index.ts
+++ b/packages/base-ui/src/Components/index.ts
@@ -1,5 +1,3 @@
-// import { FormulaBar } from '@univer/base-sheets/src/View/UI/FormulaBar/FormulaBar';
-// import { RichText } from '@univer/base-sheets/src/View/UI/RichText/RichText';
import { Avatar } from './Avatar';
import { Button } from './Button';
import { BorderLine } from './CanvasIcon';
diff --git a/packages/common-plugin-collaboration/.eslintrc.js b/packages/common-plugin-collaboration/.eslintrc.js
deleted file mode 100644
index 7f4cf3e7ba..0000000000
--- a/packages/common-plugin-collaboration/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-module.exports = {
- env: {
- browser: true,
- es2021: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- extends: [
- 'airbnb-typescript',
- 'prettier',
- 'eslint:recommended',
- 'plugin:import/recommended',
- 'plugin:import/typescript',
- ],
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- project: './tsconfig.json',
- },
- plugins: ['@typescript-eslint', 'prettier', 'import'],
- rules: {
- 'prettier/prettier': [
- 'error',
- {
- endOfLine: 'auto',
- },
- ],
- 'import/prefer-default-export': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true },
- ],
- // turn on errors for missing imports
- 'import/no-unresolved': 'error',
- },
- settings: {
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts', '.tsx'],
- },
- 'import/resolver': {
- typescript: {
- alwaysTryTypes: true, // always try to resolve config under `<root>@config` directory even it doesn't contain any source code, like `@config/unist`
-
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
-
- // use <root>/path/to/folder/tsconfig.json
- project: './tsconfig.json',
- },
- },
- },
-};
diff --git a/packages/common-plugin-collaboration/.prettierrc.cjs b/packages/common-plugin-collaboration/.prettierrc.cjs
deleted file mode 100644
index 6604107223..0000000000
--- a/packages/common-plugin-collaboration/.prettierrc.cjs
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- singleQuote: true,
- trailingComma: 'es5',
- tabWidth: 4,
- semi: true,
- printWidth: 180,
-};
diff --git a/packages/core/src/Basics/Context.ts b/packages/core/src/Basics/Context.ts
index b5ea41dc95..603fe952c3 100644
--- a/packages/core/src/Basics/Context.ts
+++ b/packages/core/src/Basics/Context.ts
@@ -8,6 +8,8 @@ import { ContextBase } from './ContextBase';
export class Context extends ContextBase {
protected _locale: Locale;
+ protected _setObserver(): void { }
+
constructor(univerData: Partial<IUniverData> = {}) {
super();
@@ -18,6 +20,4 @@ export class Context extends ContextBase {
getLocale(): Locale {
return this._locale;
}
-
- protected _setObserver(): void { }
}
diff --git a/packages/sheets-plugin-group/.eslintrc.js b/packages/sheets-plugin-group/.eslintrc.js
deleted file mode 100644
index 7f4cf3e7ba..0000000000
--- a/packages/sheets-plugin-group/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-module.exports = {
- env: {
- browser: true,
- es2021: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- extends: [
- 'airbnb-typescript',
- 'prettier',
- 'eslint:recommended',
- 'plugin:import/recommended',
- 'plugin:import/typescript',
- ],
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- project: './tsconfig.json',
- },
- plugins: ['@typescript-eslint', 'prettier', 'import'],
- rules: {
- 'prettier/prettier': [
- 'error',
- {
- endOfLine: 'auto',
- },
- ],
- 'import/prefer-default-export': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true },
- ],
- // turn on errors for missing imports
- 'import/no-unresolved': 'error',
- },
- settings: {
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts', '.tsx'],
- },
- 'import/resolver': {
- typescript: {
- alwaysTryTypes: true, // always try to resolve config under `<root>@config` directory even it doesn't contain any source code, like `@config/unist`
-
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
-
- // use <root>/path/to/folder/tsconfig.json
- project: './tsconfig.json',
- },
- },
- },
-};
diff --git a/packages/sheets-plugin-group/.prettierrc.cjs b/packages/sheets-plugin-group/.prettierrc.cjs
deleted file mode 100644
index 6604107223..0000000000
--- a/packages/sheets-plugin-group/.prettierrc.cjs
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- singleQuote: true,
- trailingComma: 'es5',
- tabWidth: 4,
- semi: true,
- printWidth: 180,
-};
diff --git a/packages/sheets-plugin-import-xlsx/.eslintrc.js b/packages/sheets-plugin-import-xlsx/.eslintrc.js
deleted file mode 100644
index 7f4cf3e7ba..0000000000
--- a/packages/sheets-plugin-import-xlsx/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-module.exports = {
- env: {
- browser: true,
- es2021: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- extends: [
- 'airbnb-typescript',
- 'prettier',
- 'eslint:recommended',
- 'plugin:import/recommended',
- 'plugin:import/typescript',
- ],
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- project: './tsconfig.json',
- },
- plugins: ['@typescript-eslint', 'prettier', 'import'],
- rules: {
- 'prettier/prettier': [
- 'error',
- {
- endOfLine: 'auto',
- },
- ],
- 'import/prefer-default-export': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true },
- ],
- // turn on errors for missing imports
- 'import/no-unresolved': 'error',
- },
- settings: {
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts', '.tsx'],
- },
- 'import/resolver': {
- typescript: {
- alwaysTryTypes: true, // always try to resolve config under `<root>@config` directory even it doesn't contain any source code, like `@config/unist`
-
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
-
- // use <root>/path/to/folder/tsconfig.json
- project: './tsconfig.json',
- },
- },
- },
-};
diff --git a/packages/sheets-plugin-import-xlsx/.prettierrc.cjs b/packages/sheets-plugin-import-xlsx/.prettierrc.cjs
deleted file mode 100644
index 6604107223..0000000000
--- a/packages/sheets-plugin-import-xlsx/.prettierrc.cjs
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- singleQuote: true,
- trailingComma: 'es5',
- tabWidth: 4,
- semi: true,
- printWidth: 180,
-};
diff --git a/packages/ui-plugin-sheets/.eslintrc.js b/packages/ui-plugin-sheets/.eslintrc.js
deleted file mode 100644
index 7f4cf3e7ba..0000000000
--- a/packages/ui-plugin-sheets/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-module.exports = {
- env: {
- browser: true,
- es2021: true,
- node: true,
- },
- parser: '@typescript-eslint/parser',
- extends: [
- 'airbnb-typescript',
- 'prettier',
- 'eslint:recommended',
- 'plugin:import/recommended',
- 'plugin:import/typescript',
- ],
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- project: './tsconfig.json',
- },
- plugins: ['@typescript-eslint', 'prettier', 'import'],
- rules: {
- 'prettier/prettier': [
- 'error',
- {
- endOfLine: 'auto',
- },
- ],
- 'import/prefer-default-export': 'off',
- 'import/no-extraneous-dependencies': [
- 'error',
- { devDependencies: true },
- ],
- // turn on errors for missing imports
- 'import/no-unresolved': 'error',
- },
- settings: {
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts', '.tsx'],
- },
- 'import/resolver': {
- typescript: {
- alwaysTryTypes: true, // always try to resolve config under `<root>@config` directory even it doesn't contain any source code, like `@config/unist`
-
- // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
-
- // use <root>/path/to/folder/tsconfig.json
- project: './tsconfig.json',
- },
- },
- },
-};
diff --git a/packages/ui-plugin-sheets/.prettierrc.cjs b/packages/ui-plugin-sheets/.prettierrc.cjs
deleted file mode 100644
index 6604107223..0000000000
--- a/packages/ui-plugin-sheets/.prettierrc.cjs
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
- singleQuote: true,
- trailingComma: 'es5',
- tabWidth: 4,
- semi: true,
- printWidth: 180,
-};