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): [no-unnec-cond] check optional chaining #1315

Commits on Dec 14, 2019

  1. feat(eslint-plugin): add checks for unnecessary optional chains

    This adds type checking around the the new optional-chaining feature. With this, it becomes invalid to start an optional chain when the base value is known to be not-nullish.
    
    ```js
    // Good
    declare const foo: string | null;
    declare const bar: null : (() => {});
    foo?.length;
    foo?.slice();
    bar?.();
    
    // Bad
    declare const baz: string;
    declare const qux: (() => {});
    baz?.length;
    baz?.slice();
    baz.slice?.();
    qux?.();
    ```
    jridgewell committed Dec 14, 2019
    Copy the full SHA
    9d9dee1 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2019

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