We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
prefer-consecutive-conditions
When comparing a variable code below will be easier to understand.
if(0.1<foo<0.5) { }
But JavasScript and TypeScript can't. The alternative is to write code like:
if(0.1<foo && foo<0.5) { }
const flag = foo > 0.1 && foo < 0.5; const flag = foo > 0.1 && 0.5 > foo; const flag = 0.1 < foo && 0.5 > foo; if(foo > 0.1 && foo < 0.5) {} if(foo > 0.1 && 0.5 > foo) {} if(0.1 < foo && 0.5 > foo) {}
const flag = 0.1 < foo && foo < 0.5; if(0.1 < foo && foo < 0.5){}
No response
The text was updated successfully, but these errors were encountered:
consistent-consecutive-conditions
I'm going to pass on this. In my opinion, this results in less readable code.
Sorry, something went wrong.
No branches or pull requests
Description
When comparing a variable code below will be easier to understand.
But JavasScript and TypeScript can't. The alternative is to write code like:
Fail
Pass
Proposed rule name
prefer-consecutive-conditions
Additional Info
No response
The text was updated successfully, but these errors were encountered: