ESLint: Require statement not part of import statement.(@typescript-eslint/no-var-requires)

后端 未结 2 1481
生来不讨喜
生来不讨喜 2021-02-19 05:46

I\'m trying to add a background image from react native BackgroundImage which needs to add source as source={require(\'*--iamge path --*\')}

<
2条回答
  •  时光取名叫无心
    2021-02-19 06:09

    you can disable this check in eslintrc.js file

    module.exports = {
      ...
      rules: {
        ...
        '@typescript-eslint/no-var-requires': 0,
      }
    }
    

提交回复
热议问题