gajus / gajus/flow-runtime

/* @flow-runtime */ turns on assert and annotate even if they're disabled in plugin config

Open
#167 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
797
Forks
49
PR merge metrics
No merged PRs in 30d

Description

This is a:

- [ ] Bug Report
- [ ] Feature Request
- [ ] Question
- [x] Other

Which concerns:

- [ ] flow-runtime
- [x] babel-plugin-flow-runtime
- [ ] flow-runtime-validators
- [ ] flow-runtime-mobx
- [ ] flow-config-parser
- [ ] The documentation website

---

### What is the current behaviour?
If the `.babelrc` contains `["flow-runtime", {"assert": false, "annotate": false}]`, a file with a `/* @flow-runtime */` annotation will override this and turn on assertions and annotations.
---

### What is the expected behaviour?
`/* @flow-runtime */` just enables `babel-plugin-flow-runtime` if it is not already enabled (with my new `optInOnly` PR).

Without reading the docs it's not at all obvious that `/* @flow-runtime */` turns on assertions and annotations; by itself it looks like an opt-in just like `/* @flow */`. Why not just require assertions and annotations to be explicitly turned back on if they're disabled in the plugin options?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.