Merge pull request #3095 from 43081j/lint-script

add lint to build script
pull/3098/head
Rich Harris 5 years ago committed by GitHub
commit f7479bc57b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,6 +39,9 @@
}],
"@typescript-eslint/no-unused-vars": "off"
},
"globals": {
"globalThis": false
},
"env": {
"es6": true,
"browser": true,

@ -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",

@ -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;
}

@ -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 '';

@ -4,16 +4,14 @@ export default {
<div>&nbsp;hello&nbsp; &nbsp;hello</div>`,
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 );
}
};
};

Loading…
Cancel
Save