- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 27.1k
Closed
Description
Can you reproduce the problem with npm 4.x?
Yes
Description
An error when running yarn run build occurs if I add a class property with a type to a react component. E.g.
interface MyType {
  what?: string;
}
// works fine
var status: MyType = {};
console.log(status);
class App extends Component {
  // no-undef build error
  state: MyType = {};
  render() {
...
Expected behavior
✨ Done in 11.24s.
Actual behavior
./src/App.js
  Line 16:  'state' is not defined  no-undef
Search for the keywords to learn more about each error.
error Command failed with exit code 1.
Note that yarn run flow raises no issue. So I'm guessing it's an eslint problem but there's no way to tell from the build output. Would be nice if the errors were tagged with their source (vs code does this in the problems panel).
Environment
Run these commands in the project folder and fill in their results:
- npm ls react-scripts(if you haven’t ejected): [email protected]
- node -v: v7.9.0
- npm -v: 4.6.1
Then, specify:
- Operating system: macOS 10.12.5 (16F73), uname -a: Darwin yuv 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
- Browser and version: This is a command line build issue
Reproducible Demo
https://github.com/ubershmekel/create-react-app-flowtypes
Related to
JeffreyATW, fakalit, jfirebaugh, mrtnzlml, AlexandreBourdeaudhui and 1 more
Metadata
Metadata
Assignees
Labels
No labels