25 lines
924 B
Markdown
25 lines
924 B
Markdown
---
|
||
title: Code Linting
|
||
localeTitle: 代码Linting
|
||
---
|
||
Linting是运行程序的过程,该程序分析代码中的程序和样式错误。 linting工具或linter标记或标记代码中的任何潜在错误,例如语法错误或拼写错误的变量名称。这可以节省时间并帮助您编写更好的代码。
|
||
|
||
可以使用`npm`或其他包管理器安装`npm` 。可以通过传入文件从命令行使用Linters。 Linters也可用作工具的插件,有时它们直接集成到编辑器中。
|
||
|
||
以下是一些流行的Javascript Linters:
|
||
|
||
[JSLint的](http://www.javascriptlint.com/online_lint.php)
|
||
|
||
[JSHint](http://jshint.com)
|
||
|
||
[JSCS](http://jscs.info)
|
||
|
||
[ESLint](http://eslint.org)
|
||
|
||
#### 编辑Linters:
|
||
|
||
* 可视代码:要安装eslint扩展,打开命令面板(View - > Command Palette ..或cmd + shift + p)并执行命令: ext install eslint
|
||
|
||
#### 工具和插件
|
||
|
||
[漂亮](https://prettier.io) |