question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Fix all imports` removes star imports (* as)

See original GitHub issue

Hi, how are you? 😊

First, I want to thank you so much for the 2.0 release, Auto import named exports is amazing!

Lately, I encountered a regression where calling importjs: fix all imports removes all import expression with * as syntax

I’m not 100% sure, but I believe that it starts with v2.0.0, where earlier versions (v1.1.2) works fine.

Steps to reproduce:

  1. Create 2 files:
// api.js

export function get () {
  // ....
}

export function post () {
  // ....
}
// index.js

import * as api from './api'

api.get()
  1. Call importjs: fix all imports on index.js

Results:

// index.js

api.get()

Tested on:

  • Sublime Text 3
  • node v6.6.0
  • importjs 2.1.0
  • macOS sierra

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asfktzcommented, Feb 14, 2017

I use Sublime Text 3. As much as I’d like to try something new, it’s hard to let go after I configured every inch of it 😆

At first glance, looks like it works I’ll test it more thoroughly tomorrow, and let you know if I find anything funny.

0reactions
asfktzcommented, Feb 17, 2017

It’s been a few busy days for me lately, Finally manage to find some free time.

Seems like all works as expected regarding the import behavior. One thing I noticed is that the exclude list is ignored. I created a separate issue for it: #375

Will let you know if I find anything else (:

Read more comments on GitHub >

github_iconTop Results From Across the Web

`source.fixAll` (Fix All command) removes unused imports ...
Pylance recently added fix all for unused import. let me take a look and make sure we don't remove unused imports whose diagnostic...
Read more >
Auto import | IntelliJ IDEA Documentation - JetBrains
The Optimize Imports feature helps you remove unused imports and organize import statements in the current file or in all files in a ......
Read more >
How to organize import in Eclipse but not *change* star imports
In the Unnecessary Code tab uncheck the Remove unused imports checkbox; Click OK and Apply and Save to close both dialogs. Share.
Read more >
Why you should disable wildcard imports in IntelliJ IDEA
The default behavior of IntelliJ IDEA is to replace multiple class imports from a package with a star/wildcard/asterisk.
Read more >
zimports - PyPI
no star imports (e.g. from <foo> import *); these are rewritten as explicit names, by importing all the names from each target module...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found