我在所有导入 React Native 组件的 js 文件中都收到了这些 ESLint 错误。从所有其他库导入工作正常,应用程序也可以编译和运行,没有问题。知道可能是什么原因吗?
3:3 error Text not found in 'react-native' import/named
4:3 error View not found in 'react-native' import/named
5:3 error ScrollView not found in 'react-native' import/named
6:3 error StyleSheet not found in 'react-native' import/named
Run Code Online (Sandbox Code Playgroud)
进口:
import {
Text,
View,
ScrollView,
StyleSheet
} from 'react-native';
Run Code Online (Sandbox Code Playgroud)
包.json
"react-native": "0.62.0",
"eslint": "6.8.0",
"eslint-plugin-react-native": "3.8.1",
"@react-native-community/eslint-config": "1.0.0",
"flow-bin": "0.121.0" (not using in my code)
Run Code Online (Sandbox Code Playgroud)
.eslintrc:
{
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 7,
"sourceType": …Run Code Online (Sandbox Code Playgroud)