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.

Default exported class is not picked up correctly

See original GitHub issue

First of all thanks for the great tool! It is really providing a lot of value when cleaning up old code.

I found a bug when exporting classes in the default export:

// a.js
export default class User extends Person {
  walk() {
    console.log("I'm walking");
  }
}
// b.js
import User from './a';

new User().walk();

shrimpit! Output:

 Shrimpit!

 > Files tree

{ '.': null,
  'a.js': { exports: [ 'walk', '/' ], imports: [] },
  'b.js': { exports: [], imports: [ '/' ] } }

 > Unused exports

[ 'walk' ]

Expectation: It should not traverse the members of the class declaration, it should simply check whether the “Default” export of a.js is used anywhere.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
peterjurascommented, Feb 15, 2018

Thanks this issue is solved. I encountered a new one, but as you suggested I’ll open up a new issue.

0reactions
yamafaktorycommented, Feb 15, 2018

@peterjuras I’ve released a new version with a fix https://github.com/yamafaktory/shrimpit/commit/396d16ad913e1ab84666ba37904e8a22a8f6d09c.

Please give it another try and let me know! If this fine, please close the issue. If you encounter another bug, please open a new issue (will be easier to track everything in different threads), thanks a lot 👍.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not declaration merging for default exported class #14080
If the class Foo is exported without default in file Foo.ts, and then import {Foo} from './Foo', it works correctly as example in...
Read more >
Why isn't "export default" recommended in Angular?
Generally, a component's or module's primary purpose is to house one specific export. So, is there a reason why Angular does not use...
Read more >
Avoid Export Default - TypeScript Deep Dive - Gitbook
Discoverability is very poor for default exports. You cannot explore a module with intellisense to see if it has a default export or...
Read more >
Understanding Modules and Import and Export Statements in ...
The other type of export that you will explore in the next section is known as a default export. Default Exports. In the...
Read more >
export - JavaScript - MDN Web Docs
This re-exports all named exports from mod as the named exports of the current module, but the default export of mod is not...
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