Skip to content

[strict-boolean-expressions] Allow any #754

Closed
@glen-84

Description

@glen-84

Repro

{
  "rules": {
    "@typescript-eslint/strict-boolean-expressions": "error"
  }
}
const x: any;

if (x) {}

Expected Result

No error (at least with an option).

Actual Result

Error: Unexpected non-boolean in conditional.

Additional Info

TSLint seems to ignore any.

Implementation choices:

  • Ignore any always (should rather be handled by no implicit/explicit any)
  • Option allowAny, defaulting to true.
  • Option allowAny, defaulting to false.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement: plugin rule optionNew rule option for an existing eslint-plugin rulegood first issueGood for newcomershas prthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions