-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix jsx-curly-spacing: spacing around spread operator #610
Conversation
var first = context.getFirstToken(node); | ||
var last = sourceCode.getLastToken(node); | ||
var second = context.getTokenAfter(first); | ||
var penultimate = sourceCode.getTokenBefore(last); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just put these declarations inside the function to reduce copy pasting
code: '<App foo={bar/* comment */} {...baz/* comment */} />;', | ||
options: ['never'], | ||
parserOptions: parserOptions, | ||
parser: 'babel-eslint' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need the babel-eslint parser for jsx object spread? that should only be needed for JS object spread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, sorry, just copy pasted and modified this case https://github.com/yannickcr/eslint-plugin-react/blob/master/tests/lib/rules/jsx-curly-spacing.js#L81-L86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, i wouldn't expect that one to need it either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test case was added in #584, and it seems that the issue wasn't related to babel-eslint parser, so I think it is safe to remove them both
Merged, thanks! |
Fixes #606
Added two type of tests: