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

'no-unresolved' always additionally causes false positive 'extensions'

Open
#2,153 1 comment 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

This is more of a low-priority FYI, given that `no-unresolved` always gets fixed right away, so the issue is inconsequential.

![image](https://user-images.githubusercontent.com/497926/125773310-c49a2956-2cc4-493e-99ec-7bed552393ad.png)

I haven't specified `import/extensions` rule and thus the default `"never"` should be in effect.
That's how it behaves, **except** when there's an actual (legitimate) issue with import resolution.

From `.eslintrc`:
```
"parser": "@babel/eslint-parser",
"extends": "airbnb",
...
"import/no-named-as-default": 1,
"import/order": "off",
"import/prefer-default-export": "off",
```

From `devDependencies`:
```
"@babel/eslint-parser": "^7.14.7",
"eslint": "^7.30.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-import-resolver-webpack": "^0.13.1",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-react": "^7.24.0",
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with the provided .eslintrc and devDependencies, focusing on the interaction between no-unresolved and the default import/extensions setting. Inspect the plugin entry points for those rules and add or update a regression test showing that a legitimate resolution failure does not also produce a false extensions report.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.