使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Closure Linter 已弃用
随着 JavaScript 的语法不断发展(从 ES2015 开始),要让 Closure Linter 保持最新状态变得越来越困难。它无人管理、无人维护,且已弃用。
Google 的大多数项目都已迁移到新的 lint。
对于使用 Closure 工具的团队,我们建议他们改用基于 Closure 编译器的全新代码检查工具。您可以通过将 --jscomp_warning=lintChecks
传递给编译器或构建独立的 lint 二进制文件来实现此目的;有关详情,请参阅
Closure 编译器 Wiki
。本页面的其余信息将保留一段时间,以供仍在使用 Closure Linter 的团队参考。
什么是 Closure Linter?
Closure Linter 是一种实用程序,用于检查 JavaScript 文件是否存在样式问题,例如运算符放置位置、缺少分号、间距、是否存在 JsDoc 注释等。
Closure Linter 能为我做什么?
Closure Linter 可确保项目的所有 JavaScript 代码都遵循 Google JavaScript 样式指南中的准则。它还可以自动修正许多常见错误,从而节省您的时间,让您专注于编码。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eClosure Linter is deprecated and no longer actively maintained due to difficulties in keeping up with evolving JavaScript syntax.\u003c/p\u003e\n"],["\u003cp\u003eGoogle recommends using the new linter integrated with Closure Compiler by passing \u003ccode\u003e--jscomp_warning=lintChecks\u003c/code\u003e to the compiler or building the standalone linter binary.\u003c/p\u003e\n"],["\u003cp\u003eClosure Linter, while deprecated, is a tool used for checking JavaScript files for style issues, ensuring code follows Google JavaScript Style Guide, and automatically fixing common errors.\u003c/p\u003e\n"]]],[],null,["Closure Linter is deprecated\n----------------------------\n\n\nAs the syntax of JavaScript has continued to evolve, with ES2015\nand beyond, it has become increasingly difficult to keep Closure\nLinter up to date. It is unstaffed, unmaintained, and deprecated.\nMost projects at Google have migrated to the new linter.\n\n\nFor teams using the Closure tools, we recommend they use the new\nlinter based on the Closure Compiler instead. You can do this by\npassing `--jscomp_warning=lintChecks` to the compiler,\nor building the standalone linter binary; see the\n[Closure Compiler wiki](https://github.com/google/closure-compiler/wiki/Lint-checks) for details. The rest of the information on this page will be\nkept up for a while, for teams who are still using Closure Linter.\n\nWhat is the Closure Linter?\n---------------------------\n\n\nThe Closure Linter is a utility that checks JavaScript files for\nstyle issues such as operator placement, missing semicolons,\nspacing, the presence of JsDoc annotations, and more.\n\nWhat can the Closure Linter do for me?\n--------------------------------------\n\n\nThe Closure Linter ensures that all of your project's JavaScript\ncode follows the guidelines in\nthe [Google\nJavaScript Style Guide](https://google.github.io/styleguide/javascriptguide.xml). It can also automatically fix many\ncommon errors, which saves you time and lets you focus on coding. \n\nHow do I start?\n---------------\n\n\n- [Download Closure Linter](https://github.com/google/closure-linter/zipball/master).\n- Read [How to Use Closure Linter](/closure/utilities/docs/linter_howto).\n- Browse [the source code](https://github.com/google/closure-linter/).\n- Questions? Ask the [discussion forum](http://groups.google.com/group/closure-linter-discuss).\n\n\u003cbr /\u003e"]]