import-js / import-js/eslint-plugin-import

`export import X = Y` seems not being recognized and may trigger `import/namespace` false-positives

Open
#2,935 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement help wanted typescript
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Reproduction repo: https://github.com/chenxinyanc/eslint-import-uuid-test

Reproduction code

bar.ts
```ts
export const test = 123;
```

buzz.ts
```ts
import * as Bar from "./bar";

export import barTest = Bar.test;
```

index.ts
```ts
import * as Buzz from './buzz'; // No exported names found in module './buzz'. (eslint: import/namespace)

console.log(Buzz);
```

![image](https://github.com/import-js/eslint-plugin-import/assets/50703224/adcd876d-728d-46fe-83e1-9b3034c87a44)

Packages

```json
"devDependencies": {
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"eslint": "^8.55.0",
"eslint-plugin-import": "^2.29.0",
"tsc": "^2.0.4",
"typescript": "^5.3.3"
},
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and compare the exports in bar.ts and buzz.ts with the import/namespace diagnostic reported for index.ts. Trace how the rule handles `export import barTest = Bar.test`; done means the valid TypeScript export is recognized and the false-positive diagnostic is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.