Skip to content

Rule suggestion: no variable declarations and assignments together [$50] #2606

@bedney

Description

@bedney

I am wanting a (stylistic) rule where this would be disallowed:

var x = 2;

But this is fine:

var x;
x = 2;

In other words, variable declarations and variable assignments have to be broken into 2 pieces.

Is there already such a rule and I missed it?

Thanks!

Did you help close this issue? Go claim the $50 bounty on Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbountySomeone has posted a bounty for this issue on BountySourceruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions