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
[New] jsx-indent-props
: add ignoreTernaryOperator
option
#2846
Conversation
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.
Let's pick an option name where absence and false
are the same.
How about, ignoreTernaryOperator
that defaults to false?
docs/rules/jsx-indent-props.md
Outdated
Note that using the `"first"` option allows very inconsistent indentation unless you also enable a rule that enforces the position of the first prop. | ||
If second parameter is an object, it can be used to specify the indent mode as well as if the indent level is increased by a `?` operator `:` (default is `true`). |
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.
If second parameter is an object, it can be used to specify the indent mode as well as if the indent level is increased by a `?` operator `:` (default is `true`). | |
If the second parameter is an object, it can be used to specify the indent mode as well as if the indent level is increased by a `?`or `:` operator (default is `true`). |
tests/lib/rules/jsx-indent-props.js
Outdated
code: [ | ||
'{this.props.test', | ||
' ? <span', | ||
' className="value"', | ||
' some={{aaa}}', | ||
' />', | ||
' : null}' | ||
].join('\n'), |
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.
code: [ | |
'{this.props.test', | |
' ? <span', | |
' className="value"', | |
' some={{aaa}}', | |
' />', | |
' : null}' | |
].join('\n'), | |
code: [ | |
'{this.props.test', | |
' ? <span', | |
' className="value"', | |
' some={{aaa}}', | |
' />', | |
' : null}' | |
].join('\n'), |
i think that with increaseByTernaryOperator
set to true
, this should be what's valid, no?
Good idea, I've changed it that way and adjusted documentation and tests. |
increaseByTernaryOperator
option for jsx-indent-props
jsx-indent-props
: add ignoreTernaryOperator
option
No description provided.