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
Rule change: no-extra-boolean-cast should catch more cases #12137
Comments
👍 from me for the enhancement in general. If accepted, this should probably be an option rather than default behavior, until the next major release. The same could apply to |
I prefer this is as default behavior personally. |
I guess if it is default immediately or not, depends on if it is seen as breaking behaviour? |
As a reminder, we do need a team member to champion this rule proposal (assign to themselves) before we can mark this issue as accepted. Would anyone from the team like to champion this rule? Regarding default behavior or not: If the proposal here is to change the default behavior, then this is a breaking change and a PR cannot be merged until the next major release. If we want the functionality available before then, we need to have this behavior behind an option with the default behavior unchanged. |
I'll champion this and there are already 3 other 👍, so marked as accepted! This feature has to be behind an option at the moment. The option applies to both Any ideas for the name, maybe @Standard8 would you like to submit a PR to implement this option? |
I'll be happy to, but realistically, it is going to be a couple of weeks before I get time to write it. |
Sounds good to me! It's perfectly fine whenever you get time. |
If @Standard8 doesn't have the time to work on this, I would be happy to! |
@jmoore914 Please do, I'm still struggling to spare the time for this. |
#12734) * Working rule, updated documentation * New: Added enforceForLogicalOperands option to no-extra-boolean-cast (fixes #12137) * Add default for schema option; renamed functions for clarity; pass fewer parameters to functions; check precedence in fixer * Removed extra variable from function; fixed function name; fixed precedence check; added additional example * Updated documentation * Removed outdated legacy code method * Added additional tests * Renamed function * Added additional test; updated documentation * Switched docs examples order; fixed comments in rule; added test for inserting space * Fixed accidentally edited lines
…#12137) (eslint#12734) * Working rule, updated documentation * New: Added enforceForLogicalOperands option to no-extra-boolean-cast (fixes eslint#12137) * Add default for schema option; renamed functions for clarity; pass fewer parameters to functions; check precedence in fixer * Removed extra variable from function; fixed function name; fixed precedence check; added additional example * Updated documentation * Removed outdated legacy code method * Added additional tests * Renamed function * Added additional test; updated documentation * Switched docs examples order; fixed comments in rule; added test for inserting space * Fixed accidentally edited lines
What rule do you want to change?
no-extra-boolean-cast
Does this change cause the rule to produce more or fewer warnings?
More
How will the change be implemented? (New option, new default behavior, etc.)?
New default behavior
Please provide some example code that this change will affect:
What does the rule currently do for this code?
No errors
What will the rule do after it's changed?
Throw a
Redundant double negation
error.Are you willing to submit a pull request to implement this change?
Possibly, depends what time I get.
The text was updated successfully, but these errors were encountered: