diff --git a/.eslintrc.json b/.eslintrc.json index c821993c40..26b87eab68 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,6 +39,9 @@ }], "@typescript-eslint/no-unused-vars": "off" }, + "globals": { + "globalThis": false + }, "env": { "es6": true, "browser": true, diff --git a/package.json b/package.json index 96a1dd8f99..c2dd066def 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "coverage": "c8 report --reporter=text-lcov > coverage.lcov && c8 report --reporter=html", "codecov": "codecov", "precodecov": "npm run coverage", - "build": "rollup -c && npm run tsd", + "build": "rollup -c && npm run lint && npm run tsd", "prepare": "npm run build", "dev": "rollup -cw", "pretest": "npm run build", diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index f6a8785e5f..53838f90b8 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -234,7 +234,7 @@ export default class Component { } helper(name: string) { - const alias = this.alias(name) + const alias = this.alias(name); this.helpers.set(name, alias); return alias; } diff --git a/src/compiler/compile/render_dom/wrappers/Element/index.ts b/src/compiler/compile/render_dom/wrappers/Element/index.ts index 842201381c..e66e6c7e4f 100644 --- a/src/compiler/compile/render_dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render_dom/wrappers/Element/index.ts @@ -344,12 +344,10 @@ export default class ElementWrapper extends Wrapper { parent.name === 'style' ); - return (raw - ? wrapper.node.data - : escape_html(wrapper.node.data)) - .replace(/\\/g, '\\\\') - .replace(/`/g, '\\`') - .replace(/\$/g, '\\$'); + return (raw ? wrapper.node.data : escape_html(wrapper.node.data)) + .replace(/\\/g, '\\\\') + .replace(/`/g, '\\`') + .replace(/\$/g, '\\$'); } if (wrapper.node.name === 'noscript') return ''; diff --git a/test/runtime/samples/nbsp-div/_config.js b/test/runtime/samples/nbsp-div/_config.js index 6026af2c90..5ab7a7f04b 100644 --- a/test/runtime/samples/nbsp-div/_config.js +++ b/test/runtime/samples/nbsp-div/_config.js @@ -4,16 +4,14 @@ export default {
 hello   hello
`, test({ assert, component, target }) { - var divList = target.querySelectorAll('div') + const divList = target.querySelectorAll('div'); assert.equal( divList[0].textContent.charCodeAt( 0 ), 160 ); assert.equal( divList[1].textContent.charCodeAt( 0 ), 160 ); assert.equal( divList[1].textContent.charCodeAt( 6 ), 160 ); assert.equal( divList[1].textContent.charCodeAt( 7 ), 160 ); assert.equal( divList[2].textContent.charCodeAt( 0 ), 160 ); assert.equal( divList[2].textContent.charCodeAt( 6 ), 160 ); - assert.equal( divList[2].textContent.charCodeAt( 7 ), 32 );//normal space + assert.equal( divList[2].textContent.charCodeAt( 7 ), 32 ); //normal space assert.equal( divList[2].textContent.charCodeAt( 8 ), 160 ); - - } -}; \ No newline at end of file +};