Skip to content

Commit

Permalink
demonstrate issue with eslint-plugin-flowtype-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jbinto committed Jan 6, 2017
1 parent cea1ec9 commit 3dcbcd4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
10 changes: 8 additions & 2 deletions package.json
Expand Up @@ -88,6 +88,12 @@
]
},
"eslintConfig": {
"extends": "react-app"
"extends": "react-app",
"rules": {
"flowtype-errors/show-errors": 2
},
"plugins": [
"flowtype-errors"
]
}
}
}
16 changes: 16 additions & 0 deletions src/index.js
@@ -1,8 +1,24 @@
// @flow

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';

import { GraphQLObjectType } from 'graphql'
import type { GraphQLOutputType } from 'graphql'

// The following line (12) is detected as a flow error by the plugin and flow cli
const x: number = "lol"

// The following line (15) is detected as a flow error by the flow CLI, but not the plugin
const y: GraphQLOutputType = new GraphQLObjectType({
name: 'foo'
// fields: (missing, flow should complain)
})

console.log(x, y)

ReactDOM.render(
<App />,
document.getElementById('root')
Expand Down

0 comments on commit 3dcbcd4

Please sign in to comment.