freeCodeCamp/guide/chinese/javascript/code-linting-in-javascript/index.md

25 lines
924 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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)