Skip to content

No 'Variable Referenced Before Assignment' Rule? #1660

Open
@Vacant0mens

Description

@Vacant0mens

From what I can tell, there's no linting rule to check if a variable is null or unassigned when it's being referenced. This would be super helpful to avoid nullref errors when running a script or module. I know there's a "variable assigned but not referenced/used" rule, but that's kind of the opposite of what I'm looking for.

I know this functionality exists in pylint for python, but I sorely miss this when working with PowerShell.

Does this exist? If so, how does one enable it?

Apologies if there is already an issue for this somewhere. I couldn't find one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions