Eslint:React version not specified in eslint-plugin-react settings

在react項目中,配置了eslint,但在 npm start 時,給了這樣的提示:React version not specified in eslint-plugin-react settings
在這裏插入圖片描述
解決方案:

// 在 .eslintrc.js 中需要指定react版本號:
"settings": {
	"react": {
		/**
		* "detect" automatically picks the version you have installed.
		* You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
		* default to latest and warns if missing 
		*/
		
		"version": "999.999.999"   // It will default to "detect" in the future
		
		// "version": "detect"
		// "version": "16.12.0"
	}
}

Git Issues查看:eslint-plugin-react 錯誤

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章