Force .js for all imports
tpluscode opened this issue · 3 comments
tpluscode commented
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
JounQin commented
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.
tpluscode commented
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
JounQin commented
Yeah, please raise a new feature request there instead.