eslint-plugin-react
的插件配置的 settings
中没有指定具体的 React
版本,所以运行时会有提示信息:
Warning: React version not specified in eslint-plugin-react settings.See github.com/jsx-eslint/…
在.eslintrc.js
加上配置,指定自动检测选择当前安装的版本:
react: {
pragma: 'React',
version: 'detect'
}