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

feat(eslint-plugin): add no-unnecessary-condition rule #699

Merged
merged 13 commits into from Sep 12, 2019

Commits on Sep 4, 2019

  1. feat(eslint-plugin): [no-unnecessary-condition] add rule

    Adds a no-unnecessary-condition, a rule that uses type information to determine if a condition is necessary. Any condition that's indicated by types to always be truthy or falsy is considered to be unnecessary. Essentially a stronger version of no-constant-condition from core eslint.
    
    For example:
    
    ```ts
    const items = ['foo', 'bar'];
    if(items) { } // Error: items is always truthy
    ```
    Retsam committed Sep 4, 2019
    Copy the full SHA
    5ec23e1 View commit details
    Browse the repository at this point in the history
  2. docs(eslint-plugin): document as related to strict-boolean-expressions

    Since no-unnecessary-conditions and strict-boolean-expressions play similar roles but with different levels of strictness, mark them as related to each other in their docs
    Retsam committed Sep 4, 2019
    Copy the full SHA
    0719da8 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    9cbe4d8 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    c2a8217 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    2d6e759 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2019

  1. Copy the full SHA
    36d5f5c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    5df4788 View commit details
    Browse the repository at this point in the history
  3. feat(estlint-plugin): check BooleanExpressions in no-constant-condition

    If both sides of a boolean expression are literals, the condition is unnecessary
    Retsam committed Sep 6, 2019
    Copy the full SHA
    be3dd52 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2019

  1. Fixes from code review

    Co-Authored-By: Brad Zacher <brad.zacher@gmail.com>
    Retsam and bradzacher committed Sep 7, 2019
    Copy the full SHA
    5183fb6 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    e43ed9b View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2019

  1. fix formatting

    bradzacher committed Sep 8, 2019
    Copy the full SHA
    17f0e25 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2019

  1. Copy the full SHA
    d55a6f4 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2019

  1. Copy the full SHA
    20958a2 View commit details
    Browse the repository at this point in the history