Skip to content

Commit 764e841

Browse files
committed
chore: lint fixed
1 parent 6b8d0c1 commit 764e841

File tree

207 files changed

+2700
-660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+2700
-660
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ typings/
110110
codealike.json
111111
.node
112112

113-
.must.config.js
113+
.must.config.js

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git-checks=false

eslint.config.js

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
import stylistic from '@stylistic/eslint-plugin';
2-
import tseslint from 'typescript-eslint'
2+
import tseslint from 'typescript-eslint';
33
import js from '@eslint/js';
4-
import react from 'eslint-plugin-react'
4+
import react from 'eslint-plugin-react';
55
import reactHooks from 'eslint-plugin-react-hooks';
6-
import reactRefresh from 'eslint-plugin-react-refresh';
7-
import globals from 'globals'
6+
import globals from 'globals';
87

98
export default tseslint.config({
10-
files: ['packages/*/src/**/*.{ts?(x),js?(x)}'],
11-
ignores: ["**/*.test.ts"],
12-
extends: [
13-
js.configs.recommended,
14-
...tseslint.configs.recommended,
15-
],
9+
files: ['packages/*/{src,__tests__}/**/*.{ts?(x),js?(x)}'],
10+
ignores: ['**/*.test.ts'],
11+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
1612
plugins: {
1713
'@stylistic': stylistic,
1814
react,
1915
'react-hooks': reactHooks,
20-
'react-refresh': reactRefresh
2116
},
2217
languageOptions: {
2318
parserOptions: {
@@ -28,18 +23,22 @@ export default tseslint.config({
2823
globals: {
2924
...globals.browser,
3025
...globals.nodeBuiltin,
31-
...globals.jest
26+
...globals.jest,
3227
},
3328
},
3429
rules: {
3530
'@stylistic/indent': ['error', 2],
3631
'@stylistic/indent-binary-ops': ['error', 2],
37-
'@stylistic/max-len': ['error', { tabWidth: 2, "ignoreStrings": true }],
32+
'@stylistic/max-len': ['error', { code: 100, tabWidth: 2, ignoreStrings: true, ignoreComments: true }],
3833
'@stylistic/no-tabs': 'error',
3934
'@stylistic/quotes': ['error', 'single'],
4035
'@stylistic/jsx-pascal-case': [2],
4136
'@stylistic/jsx-indent': [2, 2, { checkAttributes: true, indentLogicalExpressions: true }],
4237
'@stylistic/semi': ['error', 'always'],
38+
'@stylistic/eol-last': ['error', 'always'],
39+
'@stylistic/jsx-quotes': ['error', 'prefer-double'],
40+
41+
"@typescript-eslint/ban-ts-comment": ["error", { 'ts-expect-error': 'allow-with-description' }],
4342

4443
'react/jsx-no-undef': 'error',
4544
'react/jsx-uses-vars': 'error',
@@ -50,7 +49,5 @@ export default tseslint.config({
5049

5150
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
5251
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
53-
54-
'react-refresh/only-export-components': 'warn',
5552
},
56-
})
53+
});

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"type": "module",
55
"scripts": {
66
"playground": "pnpm --filter playground dev",
7-
"test": "pnpm -r test",
87
"build": "node ./scripts/build.js",
8+
"test": "vitest",
99
"clean": "rimraf ./packages/*/dist",
1010
"clean:lib": "rimraf ./node_modules ./packages/*/node_modules",
1111
"lint": "eslint . --cache",
@@ -35,7 +35,6 @@
3535
"eslint": "^8.57.0",
3636
"eslint-plugin-react": "^7.34.1",
3737
"eslint-plugin-react-hooks": "^4.6.0",
38-
"eslint-plugin-react-refresh": "^0.4.6",
3938
"globals": "^15.0.0",
4039
"husky": "^9.0.11",
4140
"less": "^4.2.0",

packages/designer/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"import": "./dist/low-code-designer.js",
1212
"require": "./dist/low-code-designer.cjs",
1313
"types": "./dist/index.d.ts"
14+
},
15+
"./dist/": {
16+
"import": "./dist/",
17+
"require": "./dist/"
1418
}
1519
},
1620
"files": [

packages/designer/src/builtin-simulator/bem-tools/border-container.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ function getTitle(title: string | IPublicTypeI18nData | ReactElement) {
5050
export class BorderContainer extends Component<{
5151
host: BuiltinSimulatorHost;
5252
}, {
53-
target?: INode;
54-
}> {
53+
target?: INode;
54+
}> {
5555
state = {} as any;
5656

5757
@computed get scale() {
@@ -70,7 +70,7 @@ export class BorderContainer extends Component<{
7070
const { host } = this.props;
7171

7272
host.designer.editor.eventBus.on('designer.dropLocation.change', (loc: DropLocation) => {
73-
let { target } = this.state;
73+
const { target } = this.state;
7474
if (target === loc?.target) return;
7575
this.setState({
7676
target: loc?.target,

packages/designer/src/builtin-simulator/bem-tools/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ export class BemTools extends Component<{ host: BuiltinSimulatorHost }> {
3434
</div>
3535
);
3636
}
37-
}
37+
}

packages/designer/src/builtin-simulator/bem-tools/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ export class BemToolsManager {
3434
getAllBemTools() {
3535
return this.toolsContainer;
3636
}
37-
}
37+
}

packages/designer/src/builtin-simulator/host.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,9 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
12251225
const childrenCanMove =
12261226
onChildMoveHook && parentContainerNode && typeof onChildMoveHook === 'function'
12271227
? onChildMoveHook(
1228-
node!.internalToShellNode(),
1229-
(parentContainerNode as any).internalToShellNode(),
1230-
)
1228+
node!.internalToShellNode(),
1229+
(parentContainerNode as any).internalToShellNode(),
1230+
)
12311231
: true;
12321232

12331233
return canMove && childrenCanMove;
@@ -1313,9 +1313,9 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
13131313
const inst = instances
13141314
? instances.length > 1
13151315
? instances.find(
1316-
(_inst) =>
1317-
this.getClosestNodeInstance(_inst, container.id)?.instance === containerInstance,
1318-
)
1316+
(_inst) =>
1317+
this.getClosestNodeInstance(_inst, container.id)?.instance === containerInstance,
1318+
)
13191319
: instances[0]
13201320
: null;
13211321
const rect = inst

packages/designer/src/builtin-simulator/live-editing/live-editing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ export class LiveEditing {
197197

198198
export type SpecificRule = (target: EditingTarget) =>
199199
| (IPublicTypeLiveTextEditingConfig & {
200-
propElement?: HTMLElement;
201-
})
200+
propElement?: HTMLElement;
201+
})
202202
| null;
203203

204204
export interface SaveHandler {

0 commit comments

Comments
 (0)