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

后端 未结 2 1470
生来不讨喜
生来不讨喜 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 05:53

    It's also possible to disable it for individual files, instead of globally disabling it for the whole project.

    Add at the top of the file:

    /* eslint @typescript-eslint/no-var-requires: "off" */
    

提交回复
热议问题