Skip to content

Commit

Permalink
Add support for $FlowFixMe
Browse files Browse the repository at this point in the history
  • Loading branch information
loyd committed Jul 25, 2018
1 parent 563789f commit 695aa2e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/collector/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ function either(params: (?Type)[]): ?Type {
: t.createUnion(variants);
}

// $ FlowFixMe
function fixMe(params: (?Type)[]): ?Type {
return t.createAny();
}

export default {
Object: object,
Buffer: buffer,
Expand All @@ -214,4 +219,5 @@ export default {
$Diff: diff,
$All: all,
$Either: either,
$FlowFixMe: fixMe,
};
3 changes: 2 additions & 1 deletion src/collector/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export type Query =
| Template
| Definition
| External
| Special;
| Special
;

export type Unknown = {
kind: 'unknown',
Expand Down
11 changes: 11 additions & 0 deletions tests/samples/fixMe/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"definitions": {
"fixMe::X": true,
"fixMe::Y": {
"type": "object",
"properties": {"y": true},
"required": ["y"]
}
}
}
7 changes: 7 additions & 0 deletions tests/samples/fixMe/source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type X = $FlowFixMe;

type Y = {
y: $FlowFixMe;
};

export {X, Y};
8 changes: 8 additions & 0 deletions tests/samples/fixMe/types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- kind: any
id: [fixMe, X]
- kind: record
fields:
- name: y
value: {kind: any}
required: true
id: [fixMe, Y]

0 comments on commit 695aa2e

Please sign in to comment.