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

`import/extensions` flagging when default package export is a json file

Open
#759 3 comments 1 reaction 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

I have a package with a default export of `index.json` instead of `index.js`. When I try to import this package:
```
import foo from 'json-package';
```
`import/extensions` complains about the lack of an extensions. This doesn't seem like desired behavior.

fyi: @ljharb

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `import/extensions` report with a package whose default export is `index.json` and the shown import. Read the rule's handling of package entry points and compare it with the expected behavior for JavaScript exports. Done means the valid JSON package import is handled correctly and existing extension checks remain covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, 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.