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
object-curly-spacing with line comment #11902
object-curly-spacing with line comment #11902
Comments
I can reproduce this bug: Reproduction Link. |
It does seem to me like the rule should ignore white space around comments after the opening brace and before the closing brace when there are line breaks. |
Ignore the brace regardless of the options if the first non-comment token is on another line? |
This is a regression in 6.x, it did pass in 5.x. I suspect 67c08b6 introducted the regression. |
I don't think this is a bug, the rule now works with comments same as with all other tokens. Nevertheless, there is already a precedent for this particular exception, e.g. /*eslint space-in-parens: ["error", "never"]*/
var foo = ( // No errors. The option is 'never', but spaces between '(' and '//' are allowed
bar
); The above is the only exception, the following are still errors: /*eslint space-in-parens: ["error", "always"]*/
var foo = (//
bar
);
/*eslint space-in-parens: ["error", "always"]*/
var foo = (/**/
bar
);
/*eslint space-in-parens: ["error", "always"]*/
var foo = (
bar
/**/);
/*eslint space-in-parens: ["error", "never"]*/
var foo = ( /**/
bar
);
/*eslint space-in-parens: ["error", "never"]*/
var foo = (
bar
/**/ ); I think it's okay to allow only this particular exception ( |
I'm working on this. |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
ESLint should pass without error
What actually happened? Please include the actual, raw output from ESLint.
ESLint output error:
1:9 error There should be no space after '{' object-curly-spacing
Note
Maybe there should an option for this rule, to allow space after the
{
if trailing comment exists?The text was updated successfully, but these errors were encountered: