flow-runtime icon indicating copy to clipboard operation
flow-runtime copied to clipboard

Some problems with pragmas

Open flodiebold opened this issue 7 years ago • 0 comments

This is a:

  • [X] Bug Report

Which concerns:

  • [X] babel-plugin-flow-runtime

What is the current behaviour?

  1. When warnings are enabled via the options, @flow-runtime assert does nothing; shouldWarn still is true in the ConversionContext, and only warnings are emitted.

  2. 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?

  1. The pragma should override the options completely.
  2. 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

flodiebold avatar Jul 09 '17 18:07 flodiebold