Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

no-invalid-this with ES7 class properties #12

Closed
hzoo opened this issue Aug 21, 2015 · 7 comments · Fixed by #101
Closed

no-invalid-this with ES7 class properties #12

hzoo opened this issue Aug 21, 2015 · 7 comments · Fixed by #101

Comments

@hzoo
Copy link
Member

hzoo commented Aug 21, 2015

class {
    toggleLocationActiveState = () => {
        this.props.onActivateLocation(this.props.id);
    }
}
curiosity:foo gajus$ eslint -v
v1.2.1
/foo/index.js
  13:9   error  Unexpected `this`                       no-invalid-this
  13:39  error  Unexpected `this`                       no-invalid-this

Ref babel/babel-eslint#173 @gajus

@hzoo hzoo changed the title no-invalid-this fails with ES7 class properties no-invalid-this with ES7 class properties Aug 24, 2015
@hzoo hzoo changed the title no-invalid-this with ES7 class properties no-invalid-this with ES7 class properties Aug 24, 2015
@ssorallen
Copy link
Contributor

How cutting edge does this plugin strive to be? Class instance fields are still in stage 1 proposal.

@hzoo
Copy link
Member Author

hzoo commented Jan 22, 2016

Whatever babel-eslint supports so stage-0 I suppose

@philostler
Copy link

So what's the status of this? This is really creating a lot of noise in my linting atm

@jquense
Copy link
Contributor

jquense commented Jan 31, 2016

@philostler PR's accepted :)

@philostler
Copy link

@jquense I would if I knew where to start. The eslint plugins are alien territory to me

@wmill
Copy link

wmill commented Sep 7, 2016

+1

mathieumg added a commit to mathieumg/eslint-plugin-babel that referenced this issue Oct 3, 2016
mathieumg added a commit to mathieumg/eslint-plugin-babel that referenced this issue Oct 3, 2016
mathieumg added a commit to mathieumg/eslint-plugin-babel that referenced this issue Oct 3, 2016
mathieumg added a commit to mathieumg/eslint-plugin-babel that referenced this issue Oct 3, 2016
@mathieumg
Copy link
Contributor

I implemented a very basic version in #101 if people want to try it and give feedback, thanks!

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

Successfully merging a pull request may close this issue.

6 participants