vimjsxhint


Ⅰ. 插件描述

Inline JSHint error highlighting with support for JSX

Ⅱ. 基本信息

创建日期:  2014-03-09
使用用户:  1
Github星:  6
插件作者:  Jordan W

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'jordwalke/vimjsxhint'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'jordwalke/vimjsxhint'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'jordwalke/vimjsxhint'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/jordwalke/vimjsxhint

Ⅳ. 文档说明

VimJSXHint

Inline JSHint error highlighting with support for JSX.

Installation

  • Install Node.js
  • Put this in your .vimrc: let g:jsCommand='node'
  • Install using Vundle or NeoBundle.
    " Using Vundle
    Bundle 'jordwalke/JSXVimHint'

    " Or if using NeoBundle(recommended)
    NeoBundle 'jordwalke/JSXVimHint'

Then open a JS file edit it, save it and any lint errors should appear, underlined in red.

Support

MacOS + MacVim work well. iTerm on Mac and gvim on windows (with cygwin) have also been tested and worked in the past.

Check for known issues and send pull requests to help resolve them. Ideally this same approach would be ported on top of syntastic but this plugin provides a good starting point to demonstrate how to integrate JSX into an existing linter. JSX preserves line numbers so it's quite simple.

Customizing Errors

JSXVimHint looks for a file ~/.vim/.jshint.js. Here's an example of what you could include:

    
    /*global __DEV__:true, self: true, document: true, window: true, Event: true, localStorage: true, expect: true, it: true, beforeEach: true, describe: true */
    /*jshint
      browser: true,
      devel: true,
      node: true,
      nonstandard: true,
      browser:   true,
      regexp:    true,
      smarttabs: true,
      unused: true,
      bitwise:  true,
      curly:    true,
      eqeqeq:   false,
      forin:    false,
      immed:    false,
      latedef:  false,
      noarg:    true,
      noempty:  false,
      nonew:    false,
      plusplus: false,
      regexp:   false,
      undef:    true,
      strict:   false,
      trailing: false,
      asi:      false,
      debug:    true,
      es5:      false,
      esnext:   false,
      evil:     false,
      expr:     true,
      funcscope: false,
      globalstrict: false,
      iterator: false,
      lastsemic: false,
      laxbreak: false,
      laxcomma: false,
      loopfunc: false,
      multistr: false,
      onecase:  false,
      proto:    false,
      regexdash: false,
      scripturl: true,
      smarttabs: false,
      sub:      true,
      supernew: false,
      boss:     false,
      newcap:   false,
      eqnull:   false,
      shadow:   false
    */

LICENSE

The vim plugin is based on:
https://github.com/hallettj/jslint.vim
Which is why the top level license is copied from there. Within this repo, there are subprojects that have and retain their own licensing. Most of the JS is a direct copy of the Facebook JS transform stack and jshint itself, each of which include the license that apply to those particular projects.

添加新评论