multiline-ternary doesn't check parentheses
See original GitHub issueTell us about your environment
- ESLint Version: v7.0.0-alpha.3
- Node Version: v12.14.0
- npm Version: v6.13.4
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
Configuration
module.exports = {
parserOptions: {
ecmaVersion: 2015
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
/*eslint multiline-ternary: ["error", "always"] */
(a
) ? b
: c;
eslint index.js
What did you expect to happen?
It might be expected that parentheses should be treated as a part of the node, so in this case the rule should report that there’s a missing newline between test and consequent.
Some rules work that way (e.g., array-element-newline
), some don’t (function-call-argument-newline
), so I’m not sure if this is a bug.
What actually happened? Please include the actual, raw output from ESLint.
no errors
Are you willing to submit a pull request to fix this bug?
yes
The example was with "always"
, but the same issue exists with "always-multiline"
and "never"
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Yes, if this is a bug the same logic would apply to the check between consequent and alternate…
I think this should be an error as well, right !