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
key-spacing + align: 'value' + jsx objects becomes ugly sometimes #11414
key-spacing + align: 'value' + jsx objects becomes ugly sometimes #11414
Comments
thanks for the issue, I was able to repro it! |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
reopen as it is happening in latest eslint and default parser: I've created a mini demo |
@aladdin-add ({
a: 1, b: 3, c:4, // single line.
}); |
We decided to revert the PR that closed this due to a regression. @yeonjuan We would love to work with you on finding an alternate solution, if you'd like still to work on this! |
@kaicataldo const obj = {
key1: "value1", key2: "value2", // (1)
} The line (1) should be checked by a multiline option( But the |
The configuration options for this rule are really confusing 😬 I think your proposal makes sense and we should ignore aligning a line when it contains multiple properties. So these would be correct: /*eslint "key-spacing": [2, {
"singleLine": {
"beforeColon": false,
"afterColon": true
},
"multiLine": {
"beforeColon": true,
"afterColon": true,
"align": "colon"
}
}]*/
var obj = { one: 1, "two": 2, three: 3 };
var obj2 = {
"two" : 2,
three : 3
};
var obj2 = {
one : 1, "two" : 2, three : 3
}; Also curious what other team members think. |
👀 Look at the repo with minimal reproducible example (dependencies, config, source): https://github.com/a-x-/eslint-align-check
environment
parser: Babel-ESLint
minimal configuration: (full config has no sense never : )
source and command
source before eslint --fix ran
Expected: don't re-align objects in jsx curlies.
PR? I'm not sure, maybe I can.
The text was updated successfully, but these errors were encountered: