Skip to content

lint: disable-next-line on max-params doesn't work when placed before function declaration #10115

@paul-sachs

Description

@paul-sachs

The disable-next-line directive doesn't seem to span large enough to cover the full function declaration. The following code snippets should not trigger lint errors:

// eslint-disable-next-line max-params
function someMaxParamsFunction(
  param1: number,
  param2: number,
  param3: number,
  param4: number,
  param5: number,
  param6: number
) {

}

A workaround is to put the disable-next-line directive before the list of params instead but this doesn't read as nicely and is at odds with how eslint handles this exact scenario.

function someMaxParamsFunction(
  // eslint-disable-next-line max-params
  param1: number,
  param2: number,
  param3: number,
  param4: number,
  param5: number,
  param6: number
) {

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions