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

Inferred Import Fails But Explicit Import Succeeds

Open
#738 0 comments 0 reactions 0 assignees View on GitHub
help wanted package: resolver/webpack
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Explicity passing my webpack resolve object means ESLint can correctly resolve aliased paths:

.eslint.js
```
"settings": {
"import/resolver": {
"webpack": {
"config": {
"resolve": {
"modules": ["app", "node_modules"],
"extensions": [".js", ".jsx", ".css"],
"alias": {
"component-styles": "css/components",
},
}
}
}
}
}
```

However using configuration that infers paths fails:

.eslint.js
```
"settings": {
"import/resolver": "webpack"
}
```

or:

.eslint.js
```
"settings": {
"import/resolver": {
"webpack": {
"config": "webpack.config.js"
}
}
}
```

In both cases, paths aren't discovered

Webpack 2.2.0
eslint-plugin-import 2.2.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two inferred configurations in .eslint.js, comparing them with the explicit webpack resolve object shown in the issue. Trace how the webpack resolver discovers configuration and aliases; done means both inferred forms resolve the same aliased paths successfully.

Written by the indexing model from the issue text.

Assessment

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