0

I've turned on the semicolon option in tslint and before entering a Git issue, I wanted to know if anybody in the community knows if this is as designed or not. Should the private resolvedCampaign : Campaign below be throwing a lint error?

///<reference path="../../../../typings/tsd.d.ts" />

class MyClass {
  private resolvedCampaign : Campaign

  constructor(resolvedCampaign : Campaign) {
    this.resolvedCampaign = resolvedCampaign;
  }
}
4

1 回答 1

1

在我看来,它应该会出错,并且与此处发现的问题没有太大区别:https ://github.com/palantir/tslint/issues/254

此代码在分号规则上不会出错的地方。

interface ITest {
    foo: string
}

您的代码的不同之处在于它位于接口属性上。我认为最好在您的代码中添加对问题 #254 的评论,希望它最终会得到修复!:)

于 2015-04-15T17:30:43.050 回答