Vscode会在几分钟后停止本地扩展,例如导入相对路径建议,定义,样式建议,恒定重定向。
我已经尝试重新安装所有的react native扩展。 仅一个项目发生此问题,其他项目未响应本机项目。所以我认为它的发生是因为该项目中的一些代码
我的package.json
{
"name": "test",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/async-storage": "^1.6.1",
"@react-native-community/netinfo": "^4.2.0",
"axios": "^0.18.0",
"moment": "^2.24.0",
"native-base": "^2.13.5",
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-country-picker-modal": "git+https://github.com/xcarpentier/react-native-country-picker-modal.git",
"react-native-device-info": "^2.3.2",
"react-native-fbsdk": "^1.0.1",
"react-native-gesture-handler": "^1.4.1",
"react-native-google-signin": "^2.0.0",
"react-native-image-crop-picker": "^0.25.0",
"react-native-modal-datetime-picker": "^7.5.0",
"react-native-otp-inputs": "^3.3.2",
"react-native-reanimated": "^1.2.0",
"react-native-splash-screen": "^3.2.0",
"react-native-step-indicator": "0.0.11",
"react-native-video": "^5.0.0",
"react-navigation": "^4.0.0",
"react-navigation-drawer": "^2.0.1",
"react-navigation-stack": "^1.5.1",
"react-redux": "^7.0.2",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@babel/core": "7.5.5",
"@babel/runtime": "7.5.5",
"@react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.8.0",
"eslint": "^5.0.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}
babel.config.js
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
.eslintrc
module.exports = {
extends: ['airbnb', 'prettier'],
parser: 'babel-eslint',
plugins: ['prettier'],
rules: {
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/prefer-stateless-function': 0,
'comma-dangle': ['error', 'never'],
'global-require': 0,
'import/no-unresolved': 0,
'react/prop-types': 0,
'react/jsx-one-expression-per-line': 'off',
'no-tabs': 0,
'no-param-reassign': 0,
'react/forbid-prop-types': 0,
'prettier/prettier': [
'error',
{
singleQuote: true
}
],
'no-useless-escape': 0,
'no-nested-ternary': 0,
'react/no-access-state-in-setstate': 0,
'no-underscore-dangle': 0,
'react/jsx-indent': 0,
'react/jsx-indent-props': 0,
'react/jsx-wrap-multilines': 0,
'react/jsx-indent-props': 0,
'react/jsx-props-no-spreading': 0,
'import/no-named-default': 0
},
env: {
jest: true
}
};
想要显示javascript,响应本地建议,例如导入生命周期,样式建议,导入建议