codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

environment specific pragmas #113

Closed sakari closed 8 years ago

sakari commented 8 years ago

Is there any difficulty in making typecheck support fine grained opt in based on babel plugin options instead of just opt out?

My use case is that I would like some of my files to be always have asserts on, even in production, some files to only have asserts in a test build and, possibly, by default all files with @flow should not have assertions at all.

If the issue is just a simple matter of coding I might be willing to do it

phpnode commented 8 years ago

@sakari there's no difficulty, we could look for an /** @flow */ style comment like flow does. If no such comment exists and the option is enabled, the file doesn't get typechecked. PR would be very welcome, thanks!