Skip to content
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/namespace doesn't work with export namespace statements #2161

Closed
NickHeiner opened this issue Jul 21, 2021 · 8 comments
Closed

import/namespace doesn't work with export namespace statements #2161

NickHeiner opened this issue Jul 21, 2021 · 8 comments
Labels

Comments

@NickHeiner
Copy link

There's a chance that I'm misunderstanding the syntax and everything is fine.

// upstream.js
export const a = 1;

// middle.js
export * as myName from './upstream'

// downstream.js
import * as middle from './middle';

// 3:20 error  'myName' not found in imported namespace 'middle'  import/namespace
console.log(middle.myName);

I believe that middle.myName is valid, and should not be flagged as an error.

Using version 2.23.4.

@ljharb
Copy link
Member

ljharb commented Jul 21, 2021

I agree, this should be valid.

@ljharb
Copy link
Member

ljharb commented Aug 12, 2021

Hmm, my test case passes for this one locally. Can you try v2.24.0?

@NickHeiner
Copy link
Author

Hmm, it still is happening for me using v2.24.0. Repro repo: https://github.com/NickHeiner/repro-eslint-plugin-import-2161. Run yarn test to see the issue.

@ljharb
Copy link
Member

ljharb commented Aug 13, 2021

That calls into https://artifacts.netflix.net/api/npm/npm-netflix/eslint/- which i can't access, but i think i can update the yarn.lock to point to npm.

@NickHeiner
Copy link
Author

🤦 AMATEUR HOUR OVER HERE.

I updated the yarn.lock file.

@ljharb
Copy link
Member

ljharb commented Aug 13, 2021

definitely can repro it with your repo; the exact same copy of eslint-plugin-import can't repro it yet in the tests :-(

@NickHeiner
Copy link
Author

Ah, it's so tricky when that happens!

ljharb added a commit to ljharb/eslint-plugin-import that referenced this issue Aug 18, 2021
@ljharb ljharb closed this as completed in 3ff4d77 Aug 18, 2021
@ljharb
Copy link
Member

ljharb commented Aug 19, 2021

Released in v2.24.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants