React: Expected an assignment or function call and instead saw an expression

前端 未结 8 1398
一个人的身影
一个人的身影 2020-11-27 05:40

I am trying to fix this lint error at line const def = (props) => { in following sample code.

const propTypes = {
prop1: PropTypes.string,
pr         


        
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 06:14

    Not sure about solutions but a temporary workaround is to ask eslint to ignore it by adding the following on top of the problem line.

    // eslint-disable-next-line @typescript-eslint/no-unused-expressions
    

提交回复
热议问题