Skip to content

Add a linter to check that arguments after an argument with default value have a default value as well #450

@paulponcet

Description

@paulponcet

It seems good practice to avoid arguments without a default value if a preceding argument already has a default value:

# Bad
function(x, y = 1, z) {
  # some code
}

# Good
function(x, y = 1, z = 0) {
  # some code
}

# Good as well
function(x, z, y = 1) {
  # some code
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions