将 webhint 与 angular7 一起使用
Using webhint with angular7
我正在尝试合并 webhint,这是一个 linting 工具
将帮助您提高网站的可访问性、速度、安全性等,
通过检查您的代码以了解最佳做法和常见错误。
所以它的安装如下:-
- npm 安装提示 --save-dev
- npm create hintrc(创建配置文件)
- 然后我向包 json 中的脚本添加提示
"hint" : 提示
- 我运行本地服务器在一个cmd中使用ng serve
- 而我 运行 在其他 cmd 中使用 webhint
npm 运行 提示 -- http://localhost:4200
我想 运行 ng serve/build 和 npm 运行 提示。
我尝试了 link https://webhint.io/docs/user-guide/development-flow-integration/local-server/
上的步骤
我也试过&&, |和并发但都失败了。
我想要的是 运行 这两个 ng serve/build 和 npm 运行 使用一个命令提示。
如有任何帮助,我们将不胜感激。
When an angular application with multiple components is run and webhint is run, the html or json formatters show errors but line numbers are column -1 and row -1.
这很可能是因为页面的 html 是在客户端生成的,所以 line/col 没有多大意义,因为它是动态生成的。如果您告诉浏览器这样的页面代码,您只会获得初始 html,如果您转到 devtools 行和列中的元素面板,那里就没有意义了。
错误应该包含出现错误的元素的 html,这有望帮助您识别出现问题的模板。
也就是说,我们计划改善这种体验,但需要先完成一些事情。
How does webhint traverse the code using routes or urls so I can better understand it ?
当使用 Chrome 或 jsdom 时,我们会等到页面加载完毕,然后分析所有 html,同时跟踪所有网络请求。在本地的情况下,我们分析作为参数传递的文件夹中的所有文件。
npm run all and concurrency don't work for me. ng serve only keeps running.
你有没有代码,我们可以看看?启用并发应该同时启动所有任务。也许这是在 webhint 或类似的东西中添加延迟的问题。
谢谢!
我正在尝试合并 webhint,这是一个 linting 工具 将帮助您提高网站的可访问性、速度、安全性等, 通过检查您的代码以了解最佳做法和常见错误。
所以它的安装如下:-
- npm 安装提示 --save-dev
- npm create hintrc(创建配置文件)
- 然后我向包 json 中的脚本添加提示 "hint" : 提示
- 我运行本地服务器在一个cmd中使用ng serve
- 而我 运行 在其他 cmd 中使用 webhint npm 运行 提示 -- http://localhost:4200
我想 运行 ng serve/build 和 npm 运行 提示。 我尝试了 link https://webhint.io/docs/user-guide/development-flow-integration/local-server/
上的步骤我也试过&&, |和并发但都失败了。
我想要的是 运行 这两个 ng serve/build 和 npm 运行 使用一个命令提示。
如有任何帮助,我们将不胜感激。
When an angular application with multiple components is run and webhint is run, the html or json formatters show errors but line numbers are column -1 and row -1.
这很可能是因为页面的 html 是在客户端生成的,所以 line/col 没有多大意义,因为它是动态生成的。如果您告诉浏览器这样的页面代码,您只会获得初始 html,如果您转到 devtools 行和列中的元素面板,那里就没有意义了。
错误应该包含出现错误的元素的 html,这有望帮助您识别出现问题的模板。
也就是说,我们计划改善这种体验,但需要先完成一些事情。
How does webhint traverse the code using routes or urls so I can better understand it ?
当使用 Chrome 或 jsdom 时,我们会等到页面加载完毕,然后分析所有 html,同时跟踪所有网络请求。在本地的情况下,我们分析作为参数传递的文件夹中的所有文件。
npm run all and concurrency don't work for me. ng serve only keeps running.
你有没有代码,我们可以看看?启用并发应该同时启动所有任务。也许这是在 webhint 或类似的东西中添加延迟的问题。
谢谢!