Skip to content

Commit

Permalink
Add Flow Types (firefox-devtools#135)
Browse files Browse the repository at this point in the history

* Address flow review comments
  • Loading branch information
gregtatum authored Feb 1, 2017
1 parent 3f77bc6 commit 6551173
Show file tree
Hide file tree
Showing 9 changed files with 306 additions and 109 deletions.
15 changes: 12 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
"es6": true,
"node": true
},
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaFeatures": {
Expand All @@ -13,9 +14,18 @@ module.exports = {
"sourceType": "module"
},
"plugins": [
"react"
"react",
"flowtype"
],
"rules": {
// Flow type rules:
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1,
"flowtype/generic-spacing": [2, "never"],
"flowtype/space-before-type-colon": [ 2, "never" ],
"flowtype/space-after-type-colon": [ 2, "always" ],

// JS Rules:
"indent": [
"error",
2,
Expand All @@ -28,7 +38,6 @@ module.exports = {
"comma-dangle": [ "error", "always-multiline" ],
"no-console": [ "error", { allow: ["log", "warn", "error"] } ],
"eqeqeq": "error",
"valid-jsdoc": "error",
"consistent-return": "error",
"curly": ["error", "all" ],
"dot-location": ["error", "property"],
Expand Down Expand Up @@ -92,4 +101,4 @@ module.exports = {
"version": "15.0"
}
}
};
};
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ignore]
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ machine:
test:
pre:
- npm run eslint
- npm run flow
post:
- npm run test-report
- bash <(curl -s https://codecov.io/bash)
34 changes: 20 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
"description": "perf.html, the gecko profiler UI",
"main": "src/content/index.js",
"scripts": {
"test": "npm run build && npm run test-all",
"test-all": "NODE_ENV=test nyc mocha --compilers js:babel-core/register 'test/**/*.js' 'src/**/test/*.js'",
"test-file": "NODE_ENV=test mocha --compilers js:babel-core/register",
"test-report": "nyc report --reporter=text-lcov > coverage.lcov",
"build": "npm run build:clean && NODE_ENV=development webpack --progress",
"build:clean": "rimraf dist && mkdirp dist && cp res/.htaccess dist/ && cp res/zee-worker.js dist/",
"build-prod": "npm run build:clean && NODE_ENV=production webpack -p --progress",
"build-prod-readable": "npm run build:clean && NODE_ENV=production webpack --progress",
"eslint": "eslint index.js src",
"eslint-fix": "eslint --fix index.js src",
"flow": "flow",
"publish": "rimraf public_html && cp -r dist public_html",
"serve-static": "ws -d dist/ -s index.html -p 4242",
"start": "mkdir -p dist && cp res/zee-worker.js dist/ && NODE_ENV=development node server.js",
"start-no-hot": "npm run start",
"start-prod": "npm run build-prod && npm run serve-static",
"start-prod-readable": "npm run build-prod-readable && npm run serve-static",
"serve-static": "ws -d dist/ -s index.html -p 4242",
"build": "npm run build:clean && NODE_ENV=development webpack --progress",
"build-prod-readable": "npm run build:clean && NODE_ENV=production webpack --progress",
"build-prod": "npm run build:clean && NODE_ENV=production webpack -p --progress",
"build:clean": "rimraf dist && mkdirp dist && cp res/.htaccess dist/ && cp res/zee-worker.js dist/",
"publish": "rimraf public_html && cp -r dist public_html",
"eslint": "eslint src",
"eslint-fix": "eslint --fix src",
"documentation": "documentation"
"test": "npm run build && npm run test-all",
"test-all": "NODE_ENV=test nyc mocha --compilers js:babel-core/register 'test/**/*.js' 'src/**/test/*.js'",
"test-file": "NODE_ENV=test mocha --compilers js:babel-core/register",
"test-report": "nyc report --reporter=text-lcov > coverage.lcov"
},
"author": "Markus Stange <[email protected]>",
"license": "MPL-2.0",
Expand All @@ -33,7 +33,9 @@
"array-range": "^1.0.1",
"babel-cli": "^6.2.0",
"babel-core": "^6.2.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.4",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-polyfill": "^6.2.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.5.0",
Expand All @@ -44,13 +46,14 @@
"clamp": "^1.0.1",
"classnames": "^2.2.5",
"css-loader": "^0.26.0",
"documentation": "^4.0.0-beta2",
"eslint": "^3.10.2",
"eslint-config-google": "^0.6.0",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-react": "^6.4.0",
"express": "^4.13.4",
"fetch-jsonp": "^1.0.2",
"file-loader": "^0.9.0",
"flow-bin": "^0.37.0",
"html-webpack-plugin": "^2.24.1",
"http-server": "^0.9.0",
"json-loader": "^0.5.4",
Expand Down Expand Up @@ -86,6 +89,9 @@
"presets": [
"react",
"es2015"
],
"plugins": [
"transform-flow-strip-types"
]
}
}
Loading

0 comments on commit 6551173

Please sign in to comment.