# Closure Linter

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/help/idea/llms.txt).

> **TL;DR**
> 必需插件  :
>
>
>
> `JavaScript 和 TypeScript`  -  插件与 IntelliJ IDEA 捆绑在一起，并默认启用。
>
>
>
> `Closure Linter` ：在   设置 | 插件   页面上安装插件。

> **Warning:**
> 自 IntelliJ IDEA 2020.2 起，IDE 中对 Closure Linter 的支持已弃用。 如需更多信息，请参阅 [Closure Linter official website](https://developers.google.com/closure/utilities/)。
>
>
>
> 不过，Closure Linter 支持仍可通过  Closure Linter  插件获得，该插件可在   设置 | 插件   页面上安装，详情请参阅 [从 JetBrains Marketplace 安装插件](managing-plugins.html#install_plugin_from_repo)。

当 [启用 Closure Linter 支持](#ws_js_linters_closure_linter_enable)时，IntelliJ IDEA 会高亮显示 Closure Linter 检测到的错误，提供这些错误的描述，并在可能的情况下建议快速修复。

您可以在编辑器以及 [问题](linters.html#ws_js_linters_general_problems_tool_window) 工具窗口的   文件   选项卡中查看当前文件中检测到的错误的描述及其快速修复。

所有之前打开的文件中的错误及其快速修复会显示在   项目错误   选项卡的   问题   工具窗口中。 若要打开工具窗口，请点击编辑器右上角的   检查   小组件：

![检查小部件](https://resources.jetbrains.com.cn/help/img/idea/2026.3/inspection-widget.png)

有关详情，请参阅 [在编辑器中查看问题并应用快速修复](linters.html#ws_js_linters_editor)以及 [问题工具窗口](linters.html#ws_js_linters_general_problems_tool_window)。

Procedure: 开始之前

1. 请按照 [Python 官方网站](https://www.python.org/downloads/)中的描述下载并安装 Python。

2. 按照 [从 JetBrains Marketplace 安装插件](managing-plugins.html#install_plugin_from_repo) 中的说明，在   设置 | 插件   页面上安装并启用  结束 Linter  插件。

3. 按照 [Closure 官方网站](https://developers.google.com/closure/utilities/docs/linter_howto#install-closure-linter)上的说明下载并安装 Closure Linter。

Procedure: 在 IntelliJ IDEA 中启用 Closure Linter 并配置其行为

1. 打开   设置  对话框 `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))，进入  `语言与框架 | JavaScript | 代码质量工具 | Closure Linter` ，选择   启用  复选框。 之后，页面上的所有控件将可用。

2. 指定  Closure Linter  可执行文件的路径：

* `<Python_home>\Scripts\gjslint.exe` 适用于 Windows

* `/usr/local/bin/gjslint` 适用于 Linux 和 macOS

3. 请指定路径以访问先前创建的带有 [Closure Linter flags](https://developers.google.com/closure/utilities/docs/linter_howto#find-style-problems) 的配置文件。

## See also

### 语言和框架特定指南

[JavaScript](javascript-specific-guidelines.html) [JavaScript linter](linters.html)

### 外部链接

[https://developers.google.com/closure/utilities/](https://developers.google.com/closure/utilities/)

