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

object-curly-spacing and object destructuring in function parameters with flow types #18

Closed
hzoo opened this issue Oct 13, 2015 · 8 comments

Comments

@hzoo
Copy link
Member

hzoo commented Oct 13, 2015

type Data = {
  type: string;
  payload: Object
};

export function test({type, payload}: Data) {
  console.log(type, payload);
}

There should be no space before 'Data'

Ref babel/babel-eslint#185

zaygraveyard added a commit to zaygraveyard/eslint-plugin-babel that referenced this issue Dec 20, 2015
zaygraveyard added a commit to zaygraveyard/eslint-plugin-babel that referenced this issue Dec 20, 2015
* issue18:
  Update: Add tests to check the issue babel#18
zaygraveyard added a commit to zaygraveyard/eslint-plugin-babel that referenced this issue Dec 20, 2015
@zaygraveyard
Copy link
Contributor

And all tests from PR #40 pass so the problem might be resolved.
Can anyone check?

zaygraveyard added a commit to zaygraveyard/eslint-plugin-babel that referenced this issue Dec 20, 2015
* issue18:
  Update: Add tests to check the issue babel#18
jquense added a commit that referenced this issue Dec 21, 2015
Update: Add tests to check the issue #18
@sstur
Copy link

sstur commented Jul 14, 2016

As far as I can tell, this problem is not resolved. This false positive still occurs in eslint@3.0.1 + babel-eslint@6.1.2 + eslint-plugin-babel@3.3.0

screenshot 2016-07-14 15 40 20

screenshot 2016-07-14 15 43 29

@zaygraveyard
Copy link
Contributor

@sstur Thank you, I'll check it this false positive ASAP.

@zaygraveyard
Copy link
Contributor

@sstur I was unable to reproduce this case I used eslint@3.1.0 + babel-eslint@6.1.2 + eslint-plugin-babel@3.3.0.
Can you provide a full example (full source code with the corresponding .eslintrc) that will reproduce this issue?
Thank you

@sstur
Copy link

sstur commented Jul 16, 2016

Sure, will do! I'll try to come up with the simplest code required to repro.

@sstur
Copy link

sstur commented Jul 16, 2016

OK, here goes:
https://github.com/sstur/example/blob/master/example.js

If you clone that repo, npm install and then npm run lint it should illustrate it perfectly.

Let me know if you need anything else..

@zaygraveyard
Copy link
Contributor

Thank you.
It seems you are activating the wrong rule object-curly-spacing is the eslint rule and babel/object-curly-spacing is the eslint-plugin-babel one.
Let me know if this fixes your issue.

@sstur
Copy link

sstur commented Aug 15, 2016

Yes! This fixes it. Thanks!

The part I missed is obvious in the readme:

enable all the rules you would like to use (remember to disable the original ones as well!)

I appreciate your help.

@danez danez closed this as completed Aug 15, 2016
nicolo-ribaudo pushed a commit to babel/babel that referenced this issue Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants