Skip to content

Commit

Permalink
add eslint rules from fbjs
Browse files Browse the repository at this point in the history
Summary: As @​zpao suggested (reference #58) here is the new PR with the rules from [facebook/fbjs#49](facebook/fbjs#49).

I'll still need some guidance on what should be Relay specific.

At the moment with the current fbjs rules there is a lot of errors on [no-undef](http://eslint.org/docs/rules/no-undef.html) (example: $FlowIssue, $FixMe, $Enum and also when defining Flow types, this is related to [babel-eslint/known-issues](https://github.com/babel/babel-eslint#known-issues) - [babel-eslint#130](babel/babel-eslint#130) and [babel-eslint#132](babel/babel-eslint#132))

@​josephsavona @​zpao what are your thoughts?
Closes #202

Reviewed By: @josephsavona

Differential Revision: D2417828
  • Loading branch information
knowbody authored and steveluscher committed Sep 17, 2015
1 parent 180f222 commit 1027bf0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist/
docs/
examples/
node_modules/
lib/
scripts/
# TODO: Enable ESLint for website.
website/
*.md
18 changes: 18 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
parser: babel-eslint

extends:
- ./node_modules/fbjs-scripts/eslint/.eslintrc

plugins:
- react

globals:
$Enum: true
$FixMe: true
$FlowFixMe: true
$FlowIssue: true
Iterator: true
IteratorResult: true
ReactClass: true
ReactElement: true
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prepublish": "npm run build",
"test": "f() { EXIT=0; npm run typecheck || EXIT=$?; NODE_ENV=test jest $@ || EXIT=$?; exit $EXIT; }; f",
"typecheck": "flow check src/",
"update-schema": "babel-node ./scripts/jest/updateSchema.js"
"update-schema": "babel-node ./scripts/jest/updateSchema.js",
"lint": "eslint ."
},
"dependencies": {
"babel-runtime": "5.8.20",
Expand All @@ -36,10 +37,13 @@
},
"devDependencies": {
"babel-core": "^5.8.23",
"babel-eslint": "^4.1.1",
"babel-loader": "^5.3.2",
"babel-relay-plugin": "^0.2.1",
"del": "^1.2.0",
"envify": "^3.4.0",
"eslint": "^1.3.1",
"eslint-plugin-react": "^3.3.1",
"fbjs-scripts": "^0.2.0",
"flow-bin": "0.14.0",
"graphql": "^0.4.2",
Expand Down

0 comments on commit 1027bf0

Please sign in to comment.