import-js/eslint-plugin-import

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

Open

#759 opened on Mar 1, 2017

View on GitHub
 (3 comments) (1 reaction) (0 assignees)JavaScript (1,540 forks)batch import
bughelp wanted

Repository metrics

Stars
 (4,946 stars)
PR merge metrics
 (Avg merge 138d 22h) (3 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