简体   繁体   English

停止WebStorm将静态类属性显示为“未使用的字段”

[英]Stop WebStorm showing static class properties as 'Unused field'

Whenever I define a static class property WebStorm tells me it's an 'unused property', which isn't true for things like prop types. 每当我定义一个静态类属性时,WebStorm都会告诉我这是一个“未使用的属性”,这对于诸如prop类型之类的东西并不正确。 For some reason this only happens in my personal projects, at work it isn't an issue. 由于某种原因,这仅发生在我的个人项目中,在工作中这不是问题。

How do I stop WebStorm showing the following two static methods as unused properties without disabling the unused property inspection on all properties? 如何停止WebStorm将以下两个静态方法显示为未使用的属性,而不对所有属性禁用未使用的属性检查?

class TestScreen extends Component {
  static propTypes = {
    onLeftButtonPress: PropTypes.func.isRequired
  }

  static navigationOptions = {
    title: 'Test Title'
  }

propTypes : please vote for WEB-25093 propTypes :请为WEB-25093投票

navigationOptions : WEB-26298 navigationOptionsWEB-26298

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM