Skip to content

Commit

Permalink
Basic flow configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapette committed Jan 23, 2017
1 parent 8ab59d9 commit 3836fc2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
1 change: 0 additions & 1 deletion .babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[ignore]
.*/node_modules/*

[include]

[libs]

[options]
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
"babel-cli": "^6.22.2",
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"flow-bin": "^0.38.0",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"webpack": "2",
"webpack-dev-server": "2"
},
"scripts": {
"start": "node_modules/.bin/webpack-dev-server --open",
"build": "node_modules/.bin/webpack --config webpack.config.js"
"build": "node_modules/.bin/webpack --config webpack.config.js",
"flow": "flow; test $? -eq 0 -o $? -eq 2"
}
}
7 changes: 6 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
//@flow
import React from 'react';
import ReactDOM from 'react-dom';

function world(): string {
return "world"
}

ReactDOM.render(
<h1>Hello, world!</h1>,
<h1>Hello {world()}</h1>,
document.getElementById('root')
);
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const config = {
test: /\.(js|jsx)$/,
loader: 'babel-loader',
options: {
presets: ["es2015", "react"]
presets: ["es2015", "react"],
plugins: ["transform-flow-strip-types"]
},
exclude: [/node_modules/]
}
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,10 @@ find-up@^1.0.0:
path-exists "^2.0.0"
pinkie-promise "^2.0.0"

flow-bin@^0.38.0:
version "0.38.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.38.0.tgz#3ae096d401c969cc8b5798253fb82381e2d0237a"

for-in@^0.1.5:
version "0.1.6"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8"
Expand Down

0 comments on commit 3836fc2

Please sign in to comment.