3 ms·
I tend to agree, but I’ve found it mostly doesn’t matter as I stopped typing import statements almost altogether. I type a reference to the thing I want to impo
by eyelidlessness 2y ago
I tend to agree, but I’ve found it mostly doesn’t matter as I stopped typing import statements almost altogether. I type a reference to the thing I want to import, in the place I want to use it, choose a suggestion from the editor, and let the editor write the import statement as a side effect. It only doesn’t work when dealing with aliases, and even then only when something isn’t cached yet.
- eddd-ddde 2y agoYou can type the real name, import it with autocomplete, then rename the symbol (f2), which creates the alias.
- eyelidlessness 2y agoI should’ve been more clear that I meant import specifier aliases. Eg in TypeScript, this is often determined by `paths` in tsconfig.json. It may also be controlled by `imports` in package.json, or any number of other tools and configs.
- paulddraper 2y agoThat doesn't work so well for default or wildcard imports. (I'd argue that default + wildcard imports are bad, but ESM went out of its way to have them :shrug:)
- eyelidlessness 2y agoIt works okay for defaults IME, and yeah I generally avoid both but especially namespace (wildcard) imports.
- deleted 2y ago[deleted]