Skip to content

Commit

Permalink
Explicitly annotate (@flow/@noflow) every JS file (#1533)
Browse files Browse the repository at this point in the history
It's the first step towards #1484 and also enables additional ESLint rules.
  • Loading branch information
IvanGoncharov committed Sep 26, 2018
1 parent d7594f3 commit 7874229
Show file tree
Hide file tree
Showing 94 changed files with 201 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ rules:
#flowtype/no-flow-fix-me-comments: undecided
#flowtype/no-mutable-array: undecided
#flowtype/no-primitive-constructor-types: undecided
#flowtype/no-types-missing-file-annotation: undecided
flowtype/no-types-missing-file-annotation: error
#flowtype/no-unused-expressions: undecided
flowtype/no-weak-types: [error, {any: false}]
flowtype/object-type-delimiter: off
#flowtype/require-exact-type: undecided
#flowtype/require-parameter-type: undecided
#flowtype/require-return-type: undecided
#flowtype/require-types-at-top: undecided
#flowtype/require-valid-file-annotation: undecided
flowtype/require-valid-file-annotation: [error, always, { annotationStyle: block }]
#flowtype/require-variable-type: undecided
flowtype/semi: off
#flowtype/sort-keys: undecided
Expand Down
9 changes: 9 additions & 0 deletions src/__fixtures__/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { join } from 'path';
import { readFileSync } from 'fs';

Expand Down
2 changes: 2 additions & 0 deletions src/error/__tests__/GraphQLError-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/error/__tests__/locatedError-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/error/__tests__/printError-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/abstract-promise-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/abstract-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/directives-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/executor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/lists-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/mutations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/nonnull-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/resolve-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/schema-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/sync-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/union-interface-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/execution/__tests__/variables-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { inspect } from 'util';
Expand Down
2 changes: 2 additions & 0 deletions src/jsutils/__tests__/dedent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/jsutils/__tests__/inspect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/jsutils/__tests__/instanceOf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/jsutils/__tests__/quotedOrList-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/jsutils/__tests__/suggestionList-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/blockStringValue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/lexer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/parser-benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { join } from 'path';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { inspect } from 'util';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/printer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/schema-parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/schema-printer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/visitor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/language/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { visit } from './visitor';
Expand Down
2 changes: 2 additions & 0 deletions src/subscription/__tests__/asyncIteratorReject-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/subscription/__tests__/eventEmitterAsyncIterator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/subscription/__tests__/subscribe-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/type/__tests__/definition-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import {
Expand Down
2 changes: 2 additions & 0 deletions src/type/__tests__/enumType-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { describe, it } from 'mocha';
Expand Down
2 changes: 2 additions & 0 deletions src/type/__tests__/introspection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import { expect } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions src/type/__tests__/predicate-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { describe, it } from 'mocha';
Expand Down
2 changes: 2 additions & 0 deletions src/type/__tests__/schema-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import {
Expand Down
2 changes: 2 additions & 0 deletions src/type/__tests__/serialization-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/

import {
Expand Down
9 changes: 9 additions & 0 deletions src/type/__tests__/toStringTag-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { describe, it } from 'mocha';
import { expect } from 'chai';
import {
Expand Down
2 changes: 2 additions & 0 deletions src/type/__tests__/validation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { describe, it } from 'mocha';
Expand Down
Loading

0 comments on commit 7874229

Please sign in to comment.