flow-runtime
flow-runtime copied to clipboard
Some problems with pragmas
This is a:
- [X] Bug Report
Which concerns:
- [X] babel-plugin-flow-runtime
What is the current behaviour?
-
When warnings are enabled via the options,
@flow-runtime assert
does nothing;shouldWarn
still is true in theConversionContext
, and only warnings are emitted. -
The
@flow-runtime
annotation is not recognized when it is followed by a"use strict"
directive, because babel attaches the comment to the directive; e.g.
// @flow-runtime assert
"use strict";
console.log((1: string));
does not assert.
What is the expected behaviour?
- The pragma should override the options completely.
- The pragma should still work even in the presence of a strictness directive.
Which package versions are you using?
0.11.1, also reproducible on https://codemix.github.io/flow-runtime/#/try