LoginSignup
31
30

More than 5 years have passed since last update.

vimでreactの環境を整える

Last updated at Posted at 2015-02-17

JSXのシンタックス

JSXのシンタックスをカラーリングする

https://github.com/mxw/vim-jsx

インストール

NeoBundle 'pangloss/vim-javascript'
NeoBundle 'mxw/vim-jsx'

vimrcのプラグインの管理をNeoBundleでやっているので、NeoBundleの書き方になってます。

設定

.jsxだけではなく、.jsファイルにもシンタックスを有効にするためのオプション

let g:jsx_ext_required = 0

React v0.12からは.jsxが推奨らしいので上のオプションは設定しなくてもいいかも

jslint

普段jshintを使っているので、それでJSXの部分がエラーに成ってしまってて面倒なので、どうにかしたい。

https://github.com/STRML/JSXHint/

これが良さそう?

普段vimでjsを保存する際にjshintをかませているので、その部分をjsxhintにしてあげる

let g:syntastic_javascript_checkers=['jsxhint']

https://github.com/scrooloose/syntastic/wiki/JavaScript:---jsxhint

31
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
30