普段は C++ をメインに使っているが最近 JavaScript を使うことになったので、 JavaScript の便利ツールを調べた結果をメモとして残すことにした。 他にも便利なツールなどありましたら教えていただけると嬉しいです。 JSLint / JSHint JavaScript のコードを分析してjs ファイルに潜む悪いパーツを検出してくれるツール。 下記コマンドにてインストール可能。
普段は C++ をメインに使っているが最近 JavaScript を使うことになったので、 JavaScript の便利ツールを調べた結果をメモとして残すことにした。 他にも便利なツールなどありましたら教えていただけると嬉しいです。 JSLint / JSHint JavaScript のコードを分析してjs ファイルに潜む悪いパーツを検出してくれるツール。 下記コマンドにてインストール可能。
先日JSHint 1.1.0がリリースされ、そのリリースノートに気になる記述がありました。 Adds new option gcl to make JSHint style checks compatible with Google Closure Linter. うそーまじでーなにそれヤバイ! 普段は仕事でClosureにどっぷりなせいもあってClosure Linterを使っているんですが、Closure LinterってJSDocとかお作法的なとこはチェックしてくれるけど、他のLintツールが当たり前にチェックしてくれるとこはやってくれないんですよね。たとえばvarの付け忘れとか。 Closure Compilerを使ってコンパイル時にチェックすることもできるけど、規模が大きくなってくるとその結果が出るまでに10分とか待たないといけなくっていやな感じー。Closure Linterと
JSHint JSHintとは、Javascript用構文チェッカーです。 構文チェッカーとしては、かなり厳しめのチェックをしてくれるJSLintがありますが、 これをforkして融通効くようにしたものがJSHintです。 詳しい経緯はここに。 とりあえずどんなチェックをしてくれるか知りたい場合、 このサイトでJavascriptのコード入力すれば、 どのようなチェックをしてくれるかわかります。 今回はコマンドラインからJSHintを使ってみたり、Sublime Text2から使ってみましょう。 環境構築方法 今回使用した動作環境は以下のとおりです。 OS : MacOS X 10.7.4 Node.js : v0.10.0 npm : 1.2.14 Grunt : 0.4 npmを使用してJSHintをインストールします。 このモジュールはグローバルオプションをつけてインストールしましょ
最近、JavaScriptの新刊が本当に増えててうれしいなーと思うtanakaです。Web+DB PRESS vol.73 の連載で、JavaScriptのユニットテストについて書かれていたのを読みました。主に3つのツール・ライブラリが紹介されていましたが、中でも複数のブラウザに対して一斉にテスト実行させるtestemがすごい便利そうです。以前、同様のツールであるjsTestDriverをバシャログで紹介しましたが、testemはnpmコマンドでインストールしたらすぐテストを書き始められるし、設定を書けば、自動でブラウザを起動してくれるので楽でした。(Windows,Macともに導入できました)テスト書きたいと思っている方がいましたら是非読んでみてください。 さて、testemはまだあんまりいじってないので、今日は JavaScript のコードをjshintというツールでチェックする方法
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く