import-js/eslint-import-resolver-typescript

Force .js for all imports

tpluscode opened this issue · 3 comments

I'm migrating my node ts project to ESM and now I need to change all imports to be explicitly /\.js$/

Would be nice to have a setting to enforce

I'm not sure to understand totally, but I think maybe you want an eslint rule to enforce that, and it's not responsibility of this resolver.

Here's what I mean

// not OK
import { foo } from './bar'
import { bar } from './baz'

// OK
import { foo } from './bar.js'
import { bar } from './baz/index.js'

So this would be responsibility of eslint-plugin-import? Rule import/extensions comes close

Yeah, please raise a new feature request there instead.