diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..d71edad1 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,25 @@ +{ + "parser": "babel-eslint", + "env": { + "browser": true, + "node": true, + }, + "ecmaFeatures": { + "arrowFunctions": true, + "classes": true, + "modules": true, + "jsx": true + }, + "rules": { + // Possible Errors + "comma-dangle": "always", + // Best Practices + "consistent-return": "never", + "yoda": "always", + // Variables + "no-use-before-define": "nofunc", + // Stylistic Issues + "camelcase": "never", + "no-underscore-dangle": "never", + }, +} diff --git a/package.json b/package.json index 5d773769..18431d77 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build": "rm -rf ./lib && babel --stage=1 ./src --out-dir ./lib", "build_client": "cd examples/gh-pages && npm i && npm run build_client", "dev": "cd examples/gh-pages && npm i && npm run dev", + "lint": "eslint src", "test": "jest" }, "repository": { @@ -49,6 +50,8 @@ "devDependencies": { "babel": "^5.1.13", "babel-core": "^5.1.13", + "babel-eslint": "^3.1.7", + "eslint": "^0.21.2", "jest-cli": "^0.4.0", "tomchentw-npm-dev": "^1.2.0" },