简体   繁体   中英

ESLint - how to disable react/forbid-foreign-prop-types?

in my Chrome console, I'm seeing the following warnings:

Module Warning (from /Users/me/sites/site/node_modules/react-scripts/node_modules/eslint-loader/index.js):  

Line 365:16:  Using propTypes from another component is not safe because they may be removed in production builds  react/forbid-foreign-prop-types  

Line 365:45:  Using propTypes from another component is not safe because they may be removed in production builds  react/forbid-foreign-prop-types  

Per the docs, I tried to disable this warning by adding the following to the top of the file causing the warning:

/* eslint-disable no-underscore-dangle, forbid-foreign-prop-types */

This is having no effect to silence the warning. What am I doing wrong?

弄清楚了:

/* eslint-disable react/forbid-foreign-prop-types */

put this line into .eslintrc

"react/prop-types": 0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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