Skip to content
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

[strict-boolean-expressions] Add ignore-rhs option #755

Closed
glen-84 opened this issue Jul 24, 2019 · 2 comments
Closed

[strict-boolean-expressions] Add ignore-rhs option #755

glen-84 opened this issue Jul 24, 2019 · 2 comments
Labels
enhancement: plugin rule option New rule option for an existing eslint-plugin rule has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@glen-84
Copy link
Contributor

glen-84 commented Jul 24, 2019

Repro

{
  "rules": {
    "@typescript-eslint/strict-boolean-expressions": "error"
  }
}
// OR
function valueOrDefault(a?: string) {
    return a || "the default";
}

// AND
const condition = true;
condition && valueOrDefault();

Expected Result

No error (with an option or options).

Actual Result

Error: Unexpected non-boolean in conditional. (twice)

Additional Info

TSLint has an ignore-rhs option (see documentation).

It might make sense to also consider this issue.

#698 would also be required (at least for the first example).

Other links:

Versions

package version
@typescript-eslint/eslint-plugin 1.13.0
@typescript-eslint/parser 1.13.0
TypeScript 3.4.5
ESLint 6.1.0
node 10.16.0
npm 6.9.0
@glen-84 glen-84 added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jul 24, 2019
@bradzacher
Copy link
Member

#691

@bradzacher bradzacher added enhancement: plugin rule option New rule option for an existing eslint-plugin rule has pr there is a PR raised to close this and removed triage Waiting for maintainers to take a look labels Jul 24, 2019
@JamesHenry
Copy link
Member

The PR has been merged

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: plugin rule option New rule option for an existing eslint-plugin rule has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

3 participants