From 18c0a6f9acf47b8c7a35547fd09c5a065dfc0a76 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Sat, 27 Apr 2019 08:37:21 +0300 Subject: [PATCH] show flow warnings and fixes all reported ones --- .flowconfig | 2 ++ src/type/__tests__/predicate-test.js | 1 - src/utilities/__tests__/buildClientSchema-test.js | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.flowconfig b/.flowconfig index 13c2af4b56..0a68e390ce 100644 --- a/.flowconfig +++ b/.flowconfig @@ -10,6 +10,8 @@ [libs] [options] +include_warnings=true +module.use_strict=true suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)?)\\) suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$DisableFlowOnNegativeTest diff --git a/src/type/__tests__/predicate-test.js b/src/type/__tests__/predicate-test.js index 09a7853540..29c233c9e6 100644 --- a/src/type/__tests__/predicate-test.js +++ b/src/type/__tests__/predicate-test.js @@ -605,7 +605,6 @@ describe('Directive predicates', () => { }); it('returns false for directive class (rather than instance)', () => { - // $DisableFlowOnNegativeTest expect(isDirective(GraphQLDirective)).to.equal(false); expect(() => assertDirective(GraphQLDirective)).to.throw(); }); diff --git a/src/utilities/__tests__/buildClientSchema-test.js b/src/utilities/__tests__/buildClientSchema-test.js index b0a70c89da..0ec0f1d994 100644 --- a/src/utilities/__tests__/buildClientSchema-test.js +++ b/src/utilities/__tests__/buildClientSchema-test.js @@ -548,7 +548,6 @@ describe('Type System: build schema from introspection', () => { const introspection = introspectionFromSchema(dummySchema); expect(introspection).to.have.nested.property('__schema.queryType.name'); - // $DisableFlowOnNegativeTest delete introspection.__schema.queryType.name; expect(() => buildClientSchema(introspection)).to.throw( @@ -705,7 +704,6 @@ describe('Type System: build schema from introspection', () => { name: 'SomeDirective', locations: ['QUERY'], }); - // $DisableFlowOnNegativeTest delete someDirectiveIntrospection.locations; expect(() => buildClientSchema(introspection)).to.throw( @@ -721,7 +719,6 @@ describe('Type System: build schema from introspection', () => { name: 'SomeDirective', args: [], }); - // $DisableFlowOnNegativeTest delete someDirectiveIntrospection.args; expect(() => buildClientSchema(introspection)).to.throw(