Permalink
Browse files

Add eslint with babel

  • Loading branch information...
1 parent 62c59d1 commit 4d346f523ac2c96499961f3f4d5fb1a822f4b30c @MoOx MoOx committed Apr 13, 2015
Showing with 59 additions and 0 deletions.
  1. +1 −0 .eslintignore
  2. +50 −0 .eslintrc
  3. +8 −0 package.json
View
View
@@ -0,0 +1,50 @@
+---
+# babel support more syntax stuff than eslint for now
+parser: babel-eslint
+
+ecmaFeatures:
+ modules: true
+ jsx: true
+
+env:
+ es6: true
+ browser: true
+ node: true
+
+globals:
+ __DEV__: true
+ __PROD__: true
+
+plugins:
+ - react
+
+# 0: off, 1: warning, 2: error
+rules:
+ # semicolons are useless
+ semi: [1, "never"]
+
+ quotes: [1, "double"]
+
+ # 2 spaces indentation
+ indent: [1, 2]
+
+ # trailing coma are cool for diff
+ comma-dangle: [1, "always-multiline"]
+
+ # enforce comma at eol (never before)
+ comma-style: [1, "last"]
+ no-underscore-dangle: 0
+
+ camelcase: 0
+
+ # eslint-plugin-react rules
+ react/no-multi-comp: 1
+ # https://github.com/yannickcr/eslint-plugin-react/issues/43
+ # react/prop-types: 1
+ # react/display-name: 1
+ react/wrap-multilines: 1
+ react/self-closing-comp: 1
+ react/no-did-mount-set-state: 1
+ react/no-did-update-set-state: 1
+ react/jsx-uses-react: 1
+ react/jsx-uses-vars: 1
View
@@ -15,7 +15,15 @@
"dependencies": {
},
"devDependencies": {
+ "babel": "^5.1.6",
+ "babel-core": "^5.1.6",
+ "babel-eslint": "^2.0.2",
+ "eslint": "^0.19.0",
+ "eslint-plugin-react": "^2.1.0"
},
"scripts": {
+ "lint": "eslint .",
+ "deploy": "echo '@todo deploy using gh-pages'";
+ "test": "npm run lint"
}
}

0 comments on commit 4d346f5

Please sign in to comment.