Skip to content

Commit

Permalink
Flow ?.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Mar 18, 2020
1 parent aea8e41 commit f0b4ac3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ packages/*/src
include_warnings=true
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
suppress_type=$FlowIgnore
module.name_mapper='^@babel\/plugin-inject-polyfills$' -> '<PROJECT_ROOT>/packages/babel-plugin-inject-polyfills/src/index'
esproposal.optional_chaining=enable
module.name_mapper='^@babel\/plugin-inject-polyfills$' -> '<PROJECT_ROOT>/packages/babel-plugin-inject-polyfills/src/index'
2 changes: 2 additions & 0 deletions packages/babel-plugin-inject-polyfills/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ export default declare((api, options: Options, dirname: string) => {
};

for (const provider of resolvedProviders) {
// $FlowIgnore - Flow doesn't support optional calls
provider.pre?.apply(this, arguments);
}
},
post() {
for (const provider of resolvedProviders) {
// $FlowIgnore - Flow doesn't support optional calls
provider.post?.apply(this, arguments);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ describe("missingDependencies", () => {
"out",
]);

expect(stdout?.toString()).toMatchInlineSnapshot(`
expect(stdout.toString()).toMatchInlineSnapshot(`
"Successfully compiled 2 files with Babel.
"
`);
expect(stderr?.toString()).toMatchInlineSnapshot(`
expect(stderr.toString()).toMatchInlineSnapshot(`
"
Some polyfills have been added but are not present in your dependencies.
Please run one of the following commands:
Expand Down

0 comments on commit f0b4ac3

Please sign in to comment.