我正在使用visual studio代码开发angular2应用程序,我已经安装了以下扩展,
和
我有如下组件模板,
@Component({
selector: 'userprofile',
template: `
<div class="profilecontainer">
<div class="row">
<img [src]="profile.profilePic" />
<div class="row">
<h2>{{profile.firstName}} {{profile.lastName}} </h2>
<a target="_blank" href="{{profile.detailUrl}}"> View profile</a>
<a target="-blank" href="{{profile.editUrl}}">Edit profile</a>
</div>
</div>`
})
Run Code Online (Sandbox Code Playgroud)
Hml lint在vs代码上没有显示任何错误?问题是什么?
我正在使用gulp-htmllint检查带有html片段的文件.但令我惊讶的是,它会跳过带有无效标记的文件.我希望得到"尽可能好"的linting,但至少我希望它失败/报告无效html上的错误.
这是一个复制品.首先gulpfile.js(npm install事先需要适当的命令):
var gulp = require("gulp"),
gutil = require('gulp-util'),
htmllint = require("gulp-htmllint"),
path = require('path');
gulp.task("default", [], function() {
return gulp.src("src/*.html")
.pipe(htmllint({}, reporter));
});
function reporter(filepath, issues) {
var filename = path.basename(filepath);
if (issues.length > 0) {
issues.forEach(function (issue) {
gutil.log(gutil.colors.cyan('[lintHtml] ') + gutil.colors.white(filename + ' [' + issue.line + ',' + issue.column + ']: ') + gutil.colors.red('(' + issue.code + ') ' + issue.msg));
});
process.exitCode = 1; …Run Code Online (Sandbox Code Playgroud)