diff --git a/.eslintignore b/.eslintignore index 129fb3332..ad6cd2ec2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,6 +8,7 @@ dist demo es lib +tests .* ~* diff --git a/.eslintrc.js b/.eslintrc.js index 7f19d5ce7..e3c2be803 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,5 @@ module.exports = { extends: 'eslint-config-ali/typescript/react', - ignorePatterns: [ 'tests/** '], rules: { 'react/no-multi-comp': 0, 'no-unused-expressions': 0, @@ -27,5 +26,7 @@ module.exports = { 'no-proto': 0, 'prefer-const': 0, 'eol-last': 0, + 'react/no-find-dom-node': 0, + 'no-case-declarations': 0, } }; diff --git a/package.json b/package.json index c4982a965..983fcb829 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "test:snapshot": "lerna run test:snapshot", "watchdog:build": "node ./scripts/watchdog.js", "xima:fix": "xima fix", - "xima:scan": "xima scan" + "xima:scan": "xima scan --quiet" }, "husky": { "hooks": { @@ -39,12 +39,9 @@ "**/*.{js,jsx,ts,tsx}": "xima exec eslint" }, "devDependencies": { - "ava": "^1.0.1", "@ali/lerna": "^1", - "ts-node": "^7.0.1", - "tslib": "^1.9.3", "typescript": "^3.2.2", - "xima": "^0.2.15" + "xima": "^0.3.0" }, "engines": { "node": ">=14.0.0" diff --git a/packages/designer/package.json b/packages/designer/package.json index c530af087..b7ad7eeeb 100644 --- a/packages/designer/package.json +++ b/packages/designer/package.json @@ -41,6 +41,7 @@ "build-scripts-config": "^0.1.8", "jest": "^26.6.3", "lodash": "^4.17.20", + "moment": "^2.29.1", "typescript": "^4.0.3" }, "publishConfig": { diff --git a/packages/designer/src/document/node/node.ts b/packages/designer/src/document/node/node.ts index 2e9fb2baa..35618f20a 100644 --- a/packages/designer/src/document/node/node.ts +++ b/packages/designer/src/document/node/node.ts @@ -929,7 +929,7 @@ export class Node { return null; } - if (node.componentMeta?.getMetadata().configure.component?.isModal) { + if (node?.componentMeta?.getMetadata().configure.component?.isModal) { return { container: this.document.rootNode, ref }; } diff --git a/packages/designer/tests/document/node/props/__snapshots__/value-to-source.test.ts.snap b/packages/designer/tests/document/node/props/__snapshots__/value-to-source.test.ts.snap index e39abc1c8..f148298d2 100644 --- a/packages/designer/tests/document/node/props/__snapshots__/value-to-source.test.ts.snap +++ b/packages/designer/tests/document/node/props/__snapshots__/value-to-source.test.ts.snap @@ -20,7 +20,7 @@ exports[`valueToSource 5`] = ` exports[`valueToSource 6`] = `"null"`; -exports[`valueToSource 7`] = `"function haha() {}"`; +exports[`valueToSource 7`] = `"() => {}"`; exports[`valueToSource 8`] = `"new Map()"`; diff --git a/xima.config.js b/xima.config.js index 84185467c..17adca113 100644 --- a/xima.config.js +++ b/xima.config.js @@ -1,3 +1,4 @@ module.exports = { eslintType: 'typescript/react', + enableStylelint: false, };