Skip to content

New rule: LHS of nullish coalescing operator (??) should be nullable #16

@bondo

Description

@bondo

This should give a linting error

const x = 42 ?? 60;

and this

async function foo(): Promise<number|null> {
  return null;
}
async function bar(): Promise<number|null> {
  return foo() ?? 42;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions