From b08cf8ecb112767d85376ffae729329784f94a7d Mon Sep 17 00:00:00 2001 From: mzabriskie Date: Tue, 14 Jul 2015 22:55:29 -0600 Subject: [PATCH] Adding eslint to testing --- .eslintrc | 16 ++++++++++++++++ package.json | 4 ++++ tasks/test | 6 +++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..8132e1f --- /dev/null +++ b/.eslintrc @@ -0,0 +1,16 @@ +{ + "extends": "eslint-config-airbnb", + "env": { + "browser": true, + "mocha": true, + "node": true + }, + "rules": { + "react/jsx-uses-react": 2, + "react/jsx-uses-vars": 2, + "react/react-in-jsx-scope": 2 + }, + "plugins": [ + "react" + ] +} diff --git a/package.json b/package.json index 6b1807f..4cfe9d9 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,11 @@ "dependencies": { "babel": "^5.5.8", "babel-core": "^5.5.6", + "babel-eslint": "^3.1.23", "babel-loader": "^5.1.4", + "eslint": "^0.24.1", + "eslint-config-airbnb": "0.0.6", + "eslint-plugin-react": "^2.7.0", "karma": "^0.12.36", "karma-chrome-launcher": "^0.1.12", "karma-cli": "0.0.4", diff --git a/tasks/test b/tasks/test index eb75f39..d3aefac 100755 --- a/tasks/test +++ b/tasks/test @@ -5,4 +5,8 @@ if [ "$1" == "--ci" ]; then CI="--single-run" fi -NODE_ENV=test $RACKT_PATH/node_modules/.bin/karma start $RACKT_PATH/karma.conf.js "$@" "$CI" +eslint=$RACKT_PATH/node_modules/.bin/eslint +karma=$RACKT_PATH/node_modules/.bin/karma + +$eslint -c $RACKT_PATH/.eslintrc lib examples && \ +NODE_ENV=test $karma start $RACKT_PATH/karma.conf.js "$@" "$CI"