Default exported class is not picked up correctly
See original GitHub issueFirst 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:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks this issue is solved. I encountered a new one, but as you suggested I’ll open up a new issue.
@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 👍.