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

`block-scoped-var` shows an error while using es6 classes #2280

Closed
eTorAken opened this issue Apr 10, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@eTorAken
Copy link
Contributor

commented Apr 10, 2015

We are trying to eslint a file written in es6:

class MyClass {
  // some code
}

export default MyClass;

And we got this error: warning "MyClass" used outside of binding context block-scoped-var at the line corresponding to export default MyClass;.

Is this a bug, or did we forget something? We are using v0.18.0

@nzakas

This comment has been minimized.

Copy link
Member

commented Apr 10, 2015

Looks like a bug.

@nzakas

This comment has been minimized.

Copy link
Member

commented Apr 11, 2015

Working on this.

@nzakas nzakas closed this in 035b38a Apr 11, 2015

nzakas added a commit that referenced this issue Apr 11, 2015

Merge pull request #2285 from eslint/issue2280
Fix: block-scoped-var to work with classes (fixes #2280)
@sijovijayan

This comment has been minimized.

Copy link

commented Oct 28, 2015

Hi,
I got a wanning when i used the following code to export multiple classes with first class as default.

148:21  warning  "default" used outside of binding context  block-scoped-var

When i using the following code.

export { Editable as default, EditableMyTeam };

My project is reactjs based project, I'm using Eslint with babel. How to fix it ?

@mysticatea

This comment has been minimized.

Copy link
Member

commented Oct 28, 2015

@sajinshrestha I could not reproduce that in the online demo.

image

@eslint eslint bot locked and limited conversation to collaborators Feb 7, 2018

@eslint eslint bot added the archived due to age label Feb 7, 2018

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