LoginSignup
2
2

More than 5 years have passed since last update.

sublimeText2でJSHINT入れる手順メモ

Last updated at Posted at 2013-12-18

Mac10.6.8でインストールしたので、手順をメモ。
必要なもの

  • ターミナル
  • sublimeText2

ターミナルで

(nodeとHomebrewがあったらとばす)Homebrewのインストール

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)

(node入ってたらとばす)nodeをインストール

brew install node

JSHintをインストール

sudo npm install -g jshint

sublimeText2で

(sublimeText2入ってたらとばす)sumlimeText2をインストール

(Package Control入っていたらとばす)Package Controlを入れる

View > Show Console

Ctrl + `

import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation') 

JSHINTを入れる

Cmd+Shift+p>install>JSHINT

適当なJSを開いて、動くか確認

ファイルの上で右クリック>JSHINT
もしくは
Ctrl+J

リアルタイムにエラーチェックするにはSublimeLinterがいいらしい

Cmd+Shift+p>install>SublimeLinter

エラーチェックの設定

よくわからないので、ひとまずバシャログの設定をコピペ。
これで、jQueryのエラー出なくなる。
Preferences>Package Settings>SublimeLinter>Settings - User
http://c-brains.jp/blog/wsg/13/02/27-225904.php

でもこれだとJSHINTと違う箇所にもエラーが・・・
どうなってるのかよくわからないので、あとで調べる

2
2
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
2
2