Merge pull request #238 from TouchInstinct/fix/redundant_boolean_condition

disable comments evaluation for redundant_boolean_condition rule
This commit is contained in:
Ivan Smolin 2020-12-14 13:47:43 +03:00 committed by GitHub
commit 95e915c003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -220,6 +220,26 @@ custom_rules:
regex: "(== true)|(== false)|(!= true)|(!= false)"
message: "Comparing a boolean to true is redundant (use `?? false` for optionals), and `!`-syntax is preferred over comparing to false."
severity: error
match_kinds:
- argument
- attribute.builtin
- attribute.id
- buildconfig.id
- buildconfig.keyword
- identifier
- keyword
- number
- objectliteral
- parameter
- placeholder
# - string # all except string literals
# - comment # and comments
# - comment.mark
# - comment.url
# - doccomment
# - doccomment.field
- string_interpolation_anchor
- typeidentifier
redundant_ternary_operator:
name: "Redundant Ternary Operator"