Importing multiple entries in a single line


#1

Here is a code example:

import com.my.package.util.fun1
import com.my.package.util.fun2
import com.my.package.util.fun3
import com.my.package.util.fun4
import com.my.package.util.fun5
import com.my.package.util.fun6
import com.my.package.util.fun7

Why not to remove repeating characters like this:

import {fun1, fun2, fun3, fun4, fun5, fun6, fun7} from com.my.package.util

This syntax is used in ES6/TypeScript and looks very compact and readable.


#2

You can use import com.my.package.util.*

BTW, these import is supported from the IDE. I don’t see any problem when we import each package individually


#3

There are some people in this world that just like using Notepad :slight_smile:


#4

Our position is that, if you’re doing anything with imports manually, you’re doing it wrong. The correct way to deal with imports is to use auto-import and “optimize imports on the fly” features in the IDE. Because of that, making imports compact and readable is a non-goal - you’re not supposed to ever read them.