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

Resolve .jsx? to .tsx? and force the .jsx? extensions

Open
#2,776 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Hello!

Thank you for this great library!

However, I can't really figure out how to configure it in ESM TypeScript React project.

I would like the ESLint to report (and autofix) missing .js and .jsx extensions, however, it forces me to use the .ts(x) extensions instead.

In other words I want:

import { Component } from './component' to be corrected to
import { Component } from './component.jsx'

import { util } from './util' to be corrected to
import { util } from './util.js'

import { Component } from './component.tsx' and
import { util } from './util.ts'
should raise error.

Thanks!

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

The issue names no specific file, test, or rule entry point; start by locating the ESLint configuration and extension-resolution logic involved in import autofixes. Reproduce the listed JavaScript and TypeScript import examples, then verify that missing .js/.jsx extensions are autofixed while .ts/.tsx extensions are reported.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.