Skip to content

Commit 10cfb3d

Browse files
committed
fix(Flowtype): Resolve all Flowtype warnings
1 parent 05a9019 commit 10cfb3d

34 files changed

+90
-84
lines changed

.flowconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,36 @@
55
.*/resources/.*
66
<PROJECT_ROOT>/lib/.*
77
<PROJECT_ROOT>/dist/.*
8+
.*/node_modules/ajv.*
9+
.*/node_modules/acorn.*
10+
.*/node_modules/async.*
11+
.*/node_modules/babel.*
12+
.*/node_modules/bluebird.*
13+
.*/node_modules/caniuse-db.*
14+
.*/node_modules/config-chain.*
15+
.*/node_modules/conventional-changelog.*
16+
.*/node_modules/core-js.*
17+
.*/node_modules/cssstyle.*
18+
.*/node_modules/diff.*
19+
.*/node_modules/es5-ext.*
20+
.*/node_modules/escope.*
21+
.*/node_modules/escodegen.*
22+
.*/node_modules/eslint.*
23+
.*/node_modules/github.*
24+
.*/node_modules/fsevents.*
25+
.*/node_modules/jsdoctypeparser.*
26+
.*/node_modules/jsdom.*
27+
.*/node_modules/iconv.*
28+
.*/node_modules/istanbul.*
29+
.*/node_modules/handlebars.*
30+
.*/node_modules/markdown.*
31+
.*/node_modules/node-notifier.*
32+
.*/node_modules/npmconf.*
33+
.*/node_modules/prettier.*
34+
.*/node_modules/source-map.*
35+
.*/node_modules/travis.*
36+
.*/node_modules/uglify.*
37+
.*/node_modules/yargs.*
838

939
[include]
1040

@@ -13,5 +43,6 @@
1343
[options]
1444
esproposal.class_instance_fields=enable
1545
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
46+
unsafe.enable_getters_and_setters=true
1647

1748
[version]

package.json

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
},
3030
"peerDependencies": {
3131
"graphql": ">=0.7.1 || >=0.8.0 || >=0.9.0",
32-
"graphql-compose": ">=1.4.0",
33-
"graphql-compose-connection": ">=2.0.2",
32+
"graphql-compose": ">=1.20.1",
33+
"graphql-compose-connection": ">=2.2.0",
3434
"mongoose": ">=4.0.0"
3535
},
3636
"devDependencies": {
3737
"babel-cli": "^6.24.1",
3838
"babel-eslint": "^7.2.3",
39+
"babel-jest": "^20.0.3",
3940
"babel-plugin-transform-flow-strip-types": "^6.22.0",
4041
"babel-plugin-transform-object-rest-spread": "^6.23.0",
4142
"babel-preset-env": "^1.5.1",
@@ -48,11 +49,10 @@
4849
"eslint-plugin-prettier": "^2.1.1",
4950
"flow-bin": "^0.47.0",
5051
"graphql": "^0.10.1",
51-
"graphql-compose": "^1.19.3",
52-
"graphql-compose-connection": "^2.1.4",
52+
"graphql-compose": "^1.20.1",
53+
"graphql-compose-connection": "^2.2.0",
5354
"jest": "^20.0.4",
54-
"jest-babel": "^1.0.1",
55-
"mongodb-memory-server": "^1.1.1",
55+
"mongodb-memory-server": "^1.1.2",
5656
"mongoose": "^4.10.4",
5757
"prettier": "^1.4.2",
5858
"rimraf": "^2.6.1",
@@ -63,18 +63,6 @@
6363
"path": "./node_modules/cz-conventional-changelog"
6464
}
6565
},
66-
"nyc": {
67-
"exclude": [
68-
"**/__mocks__/**",
69-
"**/__tests__/**",
70-
"resources",
71-
"node_modules"
72-
],
73-
"reporter": [
74-
"lcov",
75-
"text"
76-
]
77-
},
7866
"jest": {
7967
"roots": [
8068
"<rootDir>/src"
@@ -89,6 +77,7 @@
8977
"lint": "eslint src test *.js",
9078
"test": "jest",
9179
"watch": "jest --watch",
80+
"all": "npm run test && npm run lint && ./node_modules/.bin/flow",
9281
"link": "yarn build && yarn link graphql && yarn link graphql-compose && yarn link graphql-compose-connection && yarn link mongoose && yarn link",
9382
"unlink": "yarn unlink graphql && yarn unlink graphql-compose && yarn unlink graphql-compose-connection && yarn unlink mongoose && yarn add graphql graphql-compose graphql-compose-connection mongoose",
9483
"semantic-release": "semantic-release pre && npm publish && semantic-release post"

src/__mocks__/contactsSchema.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @flow */
2+
13
import { Schema } from './mongooseCommon';
24

35
const ContactsSchema = new Schema({

src/__mocks__/enumEmployment.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @flow */
2+
13
const enumEmployment = {
24
full: { description: 'Full time' },
35
partial: { description: 'Partial time' },

src/__mocks__/languageSchema.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @flow */
2+
13
import { Schema } from './mongooseCommon';
24
import { convertSchemaToGraphQL } from '../fieldsConverter';
35

src/__mocks__/mongooseCommon.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
/* @flow */
12
/* eslint-disable no-param-reassign, no-console */
3+
24
import mongoose, { Schema } from 'mongoose';
3-
import MongodbMemoryServer from 'mongodb-memory-server'; // eslint-disable
5+
import MongodbMemoryServer from 'mongodb-memory-server';
46

57
mongoose.Promise = Promise;
68

src/__mocks__/postModel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @flow */
2+
13
import { mongoose, Schema } from './mongooseCommon';
24

35
const PostSchema = new Schema({

src/__mocks__/userModel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* @flow */
2+
13
import { mongoose, Schema } from './mongooseCommon';
24
import ContactsSchema from './contactsSchema';
35
import enumEmployment from './enumEmployment';

src/__tests__/composeWithMongoose-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* @flow */
12
/* eslint-disable no-unused-expressions */
23

34
import mongoose from 'mongoose';

src/__tests__/fieldConverter-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* @flow */
12
/* eslint-disable no-unused-expressions, no-template-curly-in-string */
23

34
import {

0 commit comments

Comments
 (0)