-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[import/no-unused-modules] not correctly handling export { default } from 'foo'
syntax
#1631
Comments
It's possible the ExportMap needs a fix to handle |
Thanks for pointing that out. I've started adding ExportMap {
path: '/usr/src/app/askdarcel-web/app/init.jsx',
namespace: Map {},
reexports: Map {},
dependencies: Set {},
imports:
Map {
'/usr/src/app/askdarcel-web/node_modules/react/index.js' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] },
'/usr/src/app/askdarcel-web/node_modules/react-dom/index.js' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] },
'/usr/src/app/askdarcel-web/node_modules/react-router-dom/esm/react-router-dom.js' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] },
'/usr/src/app/askdarcel-web/app/routes.jsx' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] } },
errors: [],
mtime: 2020-01-27T01:06:00.000Z }
ExportMap {
path: '/usr/src/app/askdarcel-web/app/routes.jsx',
namespace: Map { 'default' => {} },
reexports: Map {},
dependencies: Set {},
imports:
Map {
'/usr/src/app/askdarcel-web/node_modules/react/index.js' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] },
'/usr/src/app/askdarcel-web/node_modules/react-router-dom/esm/react-router-dom.js' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] },
'/usr/src/app/askdarcel-web/app/pages/About/index.js' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] } },
errors: [],
mtime: 2020-01-27T01:06:00.000Z }
ExportMap {
path: '/usr/src/app/askdarcel-web/app/pages/About/index.js',
namespace: Map {},
reexports:
Map {
'default' => { local: 'default', getImport: [Function: getImport] } },
dependencies: Set {},
imports: Map {},
errors: [],
mtime: 2020-01-26T19:46:48.000Z }
ExportMap {
path: '/usr/src/app/askdarcel-web/app/pages/About/About.jsx',
namespace: Map { 'default' => {} },
reexports: Map {},
dependencies: Set {},
imports:
Map {
'/usr/src/app/askdarcel-web/node_modules/react/index.js' => { getter: [Function],
source: [Object],
importedSpecifiers: [Set] } },
errors: [],
mtime: 2020-01-27T01:06:00.000Z } I'm having a little bit of difficulty trying to tell if the above output is correct, since I don't know what the precise definition of each attribute of I'm willing to attempt to submit a fix, but I think I need help determining if the bug is in the |
I'm not really sure :-) maybe start with PR with a failing test, and we can iterate on it together? |
Sounds good to me. I'm a bit busy the next couple of days, but I'll have some time to work on this this weekend, if not earlier. |
@ljharb -- any updates on getting what @richardxia worked on into the next release? 😄 |
I've been really interested in using the
import/no-unused-modules
rule in one of my React projects, but it seems to be incorrectly reporting an error when it sees theexport { default } from 'foo'
syntax:/usr/src/app/app/pages/About/index.js 1:1 error exported declaration 'default' not used within other modules import/no-unused-modules
It's been a bit tricky for me to reproduce with a smaller example, as it seems to be somewhat reliant on the Babel and Webpack plugins, but I have been able to produce a branch of my project with 95% of the files removed and still demonstrate the issue. I think I've gotten the problem narrowed to the following four files in that branch:
Any help I could get with this would be greatly appreciated. If there's a way for me to dump out extra logging information, I'd be willing to attach it here.
Here are the versions of relevant packages, and you can check out the package.json in the branch I linked to for the full details:
On the branch I linked to, you should be able to reproduce the problem with the following commands:
git clone https://github.com/ShelterTechSF/askdarcel-web.git -b test-unused-modules cd askdarcel-web npm install npm run lint
The text was updated successfully, but these errors were encountered: