Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force .js for all imports #80

Closed
tpluscode opened this issue Jul 29, 2021 · 3 comments
Closed

Force .js for all imports #80

tpluscode opened this issue Jul 29, 2021 · 3 comments

Comments

@tpluscode
Copy link

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
Copy link
Collaborator

JounQin commented Jul 29, 2021

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
Copy link
Author

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
Copy link
Collaborator

JounQin commented Jul 30, 2021

Yeah, please raise a new feature request there instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants