【问题标题】:Meteor with flowtype: why does it work?流类型的流星:为什么它起作用?
【发布时间】:2016-04-24 17:17:13
【问题描述】:

我将一些遗留代码导入到新的流星包中。我必须调整很多东西才能让它工作,但我惊讶地发现流星礼貌地忽略了我所有的流类型注释,例如:

GmailApi = class {
  gmail: Object;

  constructor() {
    // HACK(chris): Keep the gmail api instance,
    // to facilitate stubbing it in the test.
    this.gmail = google.gmail('v1');
  }

  /**
   * Sends an email.
   */
  send(email: Email): Promise {

似乎meteor使用了babel; babel 可以移除这些注解,但只能使用正确的选项,而我没有添加那些。

为什么会这样?

【问题讨论】:

    标签: meteor babeljs flowtype


    【解决方案1】:

    如果您添加了react preset,它会附带transform-flow-strip-types plugin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-22
      • 2016-04-06
      • 1970-01-01
      • 2013-11-25
      • 1970-01-01
      • 2015-04-06
      • 2013-03-06
      • 1970-01-01
      相关资源
      最近更新 更多