import-js / import-js/eslint-plugin-import
[import/extensions] Should detect if a relative import is from an ESM before error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
According node documentation, in ESM, file extensions are mandatory, with default value for this rule, it breaks Node native behavior.
There is in the same documentation a detailed explanation of how to detect if a module is CJS or ESM.
Originally posted by @klarkc in https://github.com/benmosher/eslint-plugin-import/issues/928#issuecomment-849916859
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the import/extensions rule and compare its current behavior with Node's ESM documentation, especially the sections on mandatory file extensions and CommonJS namespaces. Determine how the rule can identify whether a relative import is ESM before reporting an error; done means native ESM behavior is not incorrectly rejected while the default rule behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100