Skip to content

Instantly share code, notes, and snippets.

@burdiuz
Last active November 20, 2019 09:16
Show Gist options
  • Save burdiuz/6d2b0a66cee19caad549b2edd8781c7b to your computer and use it in GitHub Desktop.
Save burdiuz/6d2b0a66cee19caad549b2edd8781c7b to your computer and use it in GitHub Desktop.
Sort import names after copy-pasting
` Checkbox,
Chip,
DataTable,
Button,
Paragraph,
Dialog,
Portal,
Divider,
Text,
Drawer,
FAB,
Portal,
Provider,
HelperText,
TextInput,
IconButton,
Colors,
Text,
TouchableRipple,
List,
Checkbox,
Button,
Paragraph,
Menu,
Divider,
Provider,
Modal,
Portal,
Text,
Button,
Provider,
ProgressBar,
Colors,
RadioButton,
Searchbar,
Button,
Snackbar,
Surface,
Text,
Switch,\
Button,
Card,
ActivityIndicator,
Colors,
Appbar,
Badge,
BottomNavigation,
Text,
Avatar,
Caption,
Headline,
Paragraph,
Title,
Subheading,
ToggleButton,
TextInput`
.trim()
.split(/\s*,\s*/)
.sort()
.filter(((hash = {}) => (item) => !item || hash[item] ? false : (hash[item] = true, true))())
.join(',\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment