简体   繁体   English

如何删除不需要自动响应所有文件中的本机的导入?

[英]How to delete import that is not needed to react native in all files automatically?

I made a project, but I found a lot of imports that are useless and I want to delete them automatically 我做了一个项目,但是发现很多导入是无用的,我想自动删除它们

I tried using a linter but it wasn't automatic 我尝试使用短绒棉,但它不是自动的

import { Text, View, StyleSheet, TouchableOpacity } from 'react-native'
import LinearGradient from 'react-native-linear-gradient'

I want to optimize the import automatically react native as in the android studio 我想优化导入,就像在android studio中一样自动响应本机

Idk which IDE you are using but for Visual Studio Code which is most popular atm there's a simple rule. Idk您正在使用哪个IDE,但是对于最流行的atm的Visual Studio Code,有一个简单的规则。

 "editor.codeActionsOnSave": { "source.organizeImports": true } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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