From 019cb2eb25690a88f9e3cf6aaadadbeae7200f70 Mon Sep 17 00:00:00 2001 From: yuche Date: Thu, 23 Apr 2020 16:22:28 +0800 Subject: [PATCH 1/2] chore: enable lint-staged --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1dd74bde7d5d..d7b96690956e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "type": "git", "url": "git+https://github.com/NervJS/taro.git" }, - "//lint-staged": { + "lint-staged": { "*.{js,jsx}": [ "eslint --fix", "git add" @@ -34,7 +34,7 @@ "husky": { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "//pre-commit": "lint-staged" + "pre-commit": "lint-staged" } }, "keywords": [ From 76a16620d533b194e5fbd0652ee7ee02b407e99a Mon Sep 17 00:00:00 2001 From: yuche Date: Fri, 24 Apr 2020 14:00:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(runtime):=20=E5=BD=93=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=B1=82=E7=BA=A7=E8=BE=BE=E5=88=B0=E9=98=88?= =?UTF-8?q?=E5=80=BC=E6=97=B6=E6=98=AF=E4=B8=80=E4=B8=AA=20text=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=BB=99=E4=BA=88=E8=AD=A6=E5=91=8A=20close?= =?UTF-8?q?=20#6054?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-runtime/src/dsl/common.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/taro-runtime/src/dsl/common.ts b/packages/taro-runtime/src/dsl/common.ts index a5fc707f9513..04e5a5bcb969 100644 --- a/packages/taro-runtime/src/dsl/common.ts +++ b/packages/taro-runtime/src/dsl/common.ts @@ -1,5 +1,5 @@ /* eslint-disable dot-notation */ -import { isFunction, EMPTY_OBJ, ensure, Shortcuts, isUndefined, isArray } from '@tarojs/shared' +import { isFunction, EMPTY_OBJ, ensure, Shortcuts, isUndefined, isArray, warn } from '@tarojs/shared' import { eventHandler } from '../dom/event' import { Current } from '../current' import { document } from '../bom/document' @@ -253,6 +253,14 @@ export function createRecursiveComponentConfig () { } } }, + observers: { + i (val: Record) { + warn( + val[Shortcuts.NodeName] === '#text', + `请在此元素外再套一层非 Text 元素:${val[Shortcuts.Text]},详情:https://github.com/NervJS/taro/issues/6054` + ) + } + }, options: { addGlobalClass: true },