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

Errors when importing external ES6 module as well as internal module (webpack resolver)

Open
#661 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug package: resolver/webpack
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

There seems to be a strange issue with eslint-import-resolver-webpack where when importing an internal module (webpack resolve alias) in conjunction with an external ES6 module (not transpiled).

import { get } from 'lodash-es'; // external es6 module
import Thing from 'app/components/Thing'; // internal module
import anotherThing from './relative/path'; // relative path

When this occurs, there are a bunch of errors on the lodash-es import complaining: Resolve error: Unexpected reserved word.
The internal module also has an error complaining that 'app' should be listed in the project's dependencies.

Removing either the external es6 module or the internal module fixes both of these errors, however.

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

Reproduce the issue with the shown lodash-es, webpack alias, and relative imports using eslint-import-resolver-webpack. Trace why resolving the external ES6 module triggers both the reserved-word and dependency errors; done means all three imports resolve without either error.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript, webpack
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.