Closed stofolus closed 6 years ago
This seems weird, especially the import { foo, bar } from './file'
resulting in foo
.
I would say that the "name" of the import, if anything, is actually the name of the file being imported.
So it should be file
instead?
How should other cases be handled? Here are some examples:
./path/to/file
=> file
?
./path/to/file.js
=> file
?
Why not just the full string that is provided?
./file => ./file
./path/to/file => ./path/to/file
./path/to/file.js => ./path/to/file.js
I've changed it to return the full path now
Done!
Thanks!
A fix for #250
By looking at https://astexplorer.net/ I think this is the best way to get a good enough name out of all import statements.
This matcher should return the following: