Skip to content

Commit

Permalink
Add eslint with babel
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Apr 13, 2015
1 parent 62c59d1 commit 4d346f5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
50 changes: 50 additions & 0 deletions .eslintrc
@@ -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
8 changes: 8 additions & 0 deletions package.json
Expand Up @@ -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.