Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 318
zidniryi Avatar asked Nov 18 '25 14:11

zidniryi


1 Answers

Idk which IDE you are using but for Visual Studio Code which is most popular atm there's a simple rule.

"editor.codeActionsOnSave": {
  "source.organizeImports": true
}
like image 63
Adrian Warkocz Avatar answered Nov 21 '25 04:11

Adrian Warkocz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!