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

Avoid unnecessary optional chaining in autofix for no-get rule when using useOptionalChaining option #1286

Merged
merged 1 commit into from
Aug 24, 2021

Commits on Aug 24, 2021

  1. Improve no-get with useOptionalChaining - infer when nesting is not o…

    …ptional when autofixing
    
      this.get('foo.bar').baz // will error if either foo or bar is nullish "baz of undefined"
      this.foo?.bar?.baz      // (previous behavior) evaluates to `undefined`
      this.foo.bar.baz        // (updated behavior)  errors with either "bar of undefined" or "baz of undefined"
    
    This maintains the behavior more closely when a nested chain contains a nullish value.
    raycohen committed Aug 24, 2021
    Configuration menu
    Copy the full SHA
    4c2366c View commit details
    Browse the repository at this point in the history