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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?