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

"Use default import syntax to import" #1338

Closed
lemoustachiste opened this issue Jul 25, 2019 · 2 comments

Comments

@lemoustachiste
Copy link

commented Jul 25, 2019

What version of standard?
13.0.1

What operating system, Node.js, and npm version?
Any

What's happening
I am using some imports of the sort:

import { default as MyComponent } from './MyComponentContainer';

which I think make sense in the context of what I am doing. Upgrade from 12.0.1 to 13.0.1 throws an error:

2:21  error  Use default import syntax to import 'MyComponent'

I don't really want to because then it would not abstract the layer on top of my component.
I am trying to disable eslint from crying here, but I can't seem to find the rule behind that (tried no-named-as-default and no-useless-rename), and it does not seem listed in the changelog for the new version.

Could you point me to the right rule?

Thanks

@dtudury

This comment has been minimized.

Copy link

commented Jul 28, 2019

if you run standard with -v it gives you

Use default import syntax to import 'MyComponent'. (import/no-named-default)

so I guess import/no-named-default is the rule? sorry, I don't understand your motivation for disabling it but maybe searching that term will move you towards where you want to be 😄

@feross feross added the question label Jul 28, 2019

@feross

This comment has been minimized.

Copy link
Member

commented Jul 28, 2019

I believe your code equivalent to this:

import MyComponent from './MyComponentContainer'

which seems much nicer than what you've got there now.

@feross feross closed this Jul 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.