Add Flow type checking; React >= 0.13

This commit is contained in:
Nicolas Gallagher
2015-09-11 21:17:48 -07:00
parent 5453c8843a
commit c7524b7b6f
3 changed files with 9 additions and 7 deletions
+5
View File
@@ -1,4 +1,9 @@
{
"env": {
"development": {
"plugins": [ "typecheck" ]
}
},
"optional": [
"es7.classProperties",
"runtime"
+3 -2
View File
@@ -7,7 +7,7 @@
"dist"
],
"scripts": {
"build": "rm -rf ./dist && webpack --config config/webpack.config.publish.js --sort-assets-by --progress",
"build": "rm -rf ./dist && NODE_ENV=publish webpack --config config/webpack.config.publish.js --sort-assets-by --progress",
"dev": "webpack-dev-server --config config/webpack.config.example.js --inline --colors --quiet",
"lint": "eslint config src",
"prepublish": "npm run build",
@@ -16,7 +16,7 @@
"test": "npm run specs && npm run lint"
},
"dependencies": {
"react": "^0.13.3",
"react": ">=0.13.3",
"react-swipeable": "^3.0.2",
"react-tappable": "^0.6.0"
},
@@ -25,6 +25,7 @@
"babel-core": "^5.8.23",
"babel-eslint": "^4.1.1",
"babel-loader": "^5.3.2",
"babel-plugin-typecheck": "^1.2.0",
"babel-runtime": "^5.8.20",
"css-loader": "^0.17.0",
"eslint": "^1.3.1",
+1 -5
View File
@@ -1,8 +1,4 @@
function filterProps(obj, props, excluded = false) {
if (!Array.isArray(props)) {
throw new TypeError('props is not an Array')
}
function filterProps(obj, props: Array, excluded = false) {
const filtered = {}
for (const prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {