Resolve .jsx? to .tsx? and force the .jsx? extensions
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!
Are the files actually present on disk with those extensions?
If not, this is a duplicate of #2729 and should be closed.
@ljharb I believe that the inability of import/extensions to map .js imports to .ts files on disk (and .jsx to .tsx, etc) is the same issue as @phryneas clarified over here in the other repo eslint-import-resolver-typescript:
- https://github.com/import-js/eslint-import-resolver-typescript/issues/233#issuecomment-1627833938
Seems like there's also a PR open for that here in the eslint-plugin-import repo:
- https://github.com/import-js/eslint-plugin-import/pull/2813
So maybe it's good to keep this current issue (2776) open until 2813 is landed, since the other issue in the eslint-plugin-import repo (#2729) has been closed.