Skip to content

[no-unnecessary-condition] optional chaining clarification #1977

Closed
@TomPridham

Description

@TomPridham

i just want some clarification on this bullet point in https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md .

Base values of optional chain expressions

does that mean it will only check the first value in a chain?
e.g. foo?.bar
or will it continue to check down the chain but stop at qux?
e.g. foo?.bar?.baz?.qux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomerspackage: 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