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

False positive of `no-import-module-exports` on `module` variable defined in the module

Open
#2,181 18 comments 3 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

```js
import 'something'; // => Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi') import/no-import-module-exports

export const module = {};
module.foo = 42;
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue from the JavaScript example and trace the no-import-module-exports rule's handling of the locally defined module variable. Compare the diagnostic for this case with the rule's intended CommonJS module.exports or exports.bar cases. Done means the false positive is removed while genuine CommonJS export warnings remain covered.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.