Created
April 19, 2013 08:45
-
-
Save shinofara/5419010 to your computer and use it in GitHub Desktop.
javascriptの自動テストに向けて、JSHintと呼ばれるJavascript用構文チェッカーを入れてみた。 ref: http://qiita.com/items/eeca05aaf556655b44f1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"indent" : 2, // インデント | |
"camelcase":true, // キャメルケース | |
"maxlen" : 80, // 一行の最大文字数 | |
"unused" : true, // 宣言のみで使用していない変数を検出 | |
"eqeqeq":true, // ==、!=の使用禁止 | |
"undef" : true, // グローバル変数へのアクセスを禁止 | |
"devel" : true // console、alertを許可 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su | |
cd /usr/local/src/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/creationix/nvm.git ~/.nvm | |
source ~/.nvm/nvm.sh | |
nvm install v0.11.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node -v | |
v0.11.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm -v | |
1.2.15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jshint test.js | |
test.js: line 2, col 2, Expected 'return' to have an indentation at 3 instead at 2. | |
test.js: line 5, col 1, 'res' is not defined. | |
test.js: line 6, col 24, 'res' is not defined. | |
3 errors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jshint test.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function x(a,b) { | |
return a + b; | |
} | |
var res = x(10,20); | |
console.log("res = " + res); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment