Skip to content

Commit

Permalink
Add eslint-plugin-import to handle flow type imports
Browse files Browse the repository at this point in the history
The built-in no duplicate rule for imports was breaking when I would
import from a file, then below that, import types from that same file.
It would incorrectly label the second import as a duplicate.
  • Loading branch information
gregtatum committed Mar 12, 2017
1 parent 9f85b90 commit c3e5b85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module.exports = {
},
"plugins": [
"react",
"flowtype"
"flowtype",
"import"
],
"rules": {
// Flow type rules:
Expand All @@ -26,6 +27,11 @@ module.exports = {
"flowtype/space-after-type-colon": [ 2, "always" ],
"flowtype/delimiter-dangle": [ 2, "always-multiline" ],

// ES6 Import rules:
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"import/named": "error",

// JS Rules:
"indent": [
"error",
Expand Down Expand Up @@ -85,7 +91,6 @@ module.exports = {
"space-in-parens": ["error", "never"],
"spaced-comment": "error",
"generator-star-spacing": "error",
"no-duplicate-imports": "error",
"no-var": "error",
"prefer-const": "error",
"array-bracket-spacing": "error",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"eslint": "^3.10.2",
"eslint-config-google": "^0.6.0",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-react": "^6.4.0",
"express": "^4.13.4",
"fetch-jsonp": "^1.0.2",
Expand Down

0 comments on commit c3e5b85

Please sign in to comment.