vscode-jshint

VSCode extension to integrate jshint into VSCode

  • 所有者: microsoft/vscode-jshint
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

VS Code JSHint extension

Integrates JSHint into VS Code.

Setup

The extension looks for a jshint module in the current directory and in the global package location. You can install jshint locally with npm install jshint or globally
with npm install -g jshint. If your jshint module is in a different location, use the jshint.nodePath setting to specify the correct path. The jshint.packageManager
setting can be used to specify which package manager you are using, npm or yarn.

To check where jshint is loaded from, use the JSHint: Show output command after the extension has started to view the extension logs in the output panel.

Configuration Options

The jshint extension uses the standard jshint configuration options described on the jshint web site.

The options can be specified in a number of locations mostly mimicing jshint's default behavior. The extension looks for its configuration
options the following way and stops at the first positive match:

  1. An options file specified in the user or workspace settings like this: "jshint.config" : "<file path>". The file path is interpreted relative to the workspace's root folder.
  2. The value of the jshintConfig attribute in a package.json file located in the current directory or any parent of the current directory.
  3. A .jshintrc file located in the current directory or any parent of the current directory.
  4. A .jshintrc file located in the user's home directory.
  5. The values specified within jshint.options in the user or workspace settings. By default jshint.options is empty.

.jshintrc files can be chained using the extends attribute as described here.

Exclude Options

In order to ignore specific files or folders from being linted exclude options can be specified in a number of locations
mostly mimicing jshint's default behavior. The extenion looks for its exclude options the following way and stops at the first positive match:

  1. A file specified in the user or workspace settings like this: "jshint.excludePath" : "<file path>". The file path is interpreted relative to the workspace's root folder.
    The file contains glob patterns specifying files that should be excluded. The glob patterns are interpreted relative to the workspace's root folder.
  2. A .jshintignore file located in the current directory or any parent of the current directory. The glob patterns in this file are interpreted relative to the location of the
    .jshintignore file.
  3. The value of the jshint.exclude attribute in the user or workspace settings. The attribute has the following form: "jshint.exclude" : { "<glob pattern>" : true, "<glob pattern>" : true }.
    The glob patterns are interpreted relative to the workspace's root folder.

The glob patterns are interpreted using the npm minimatch module. Be aware that there are slight differences between minimatch and how .gitignore patterns are interpreted.
Most noteably, **/name and name are not the same in minimatch whereas they are consider equal in .gitignore. Always use **/name if you want to match a name within a subtree.

No files are excluded by default.

Disable JSHint

In order to disable jshint for a workspace specify "jshint.enable" : false in the workspace settings. jshint is enabled by default.

Contributing

Contributions to the extension are welcome! Please see contributing for information on how to develop the extension.

主要指标

概览
名称与所有者microsoft/vscode-jshint
主编程语言TypeScript
编程语言TypeScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2015-10-27 15:45:48
推送于2022-12-23 19:32:53
最后一次提交
发布数0
用户参与
星数71
关注者数52
派生数48
提交数104
已启用问题?
问题数93
打开的问题数39
拉请求数8
打开的拉请求数2
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?