Skip to content

function body indentation false positive ("indent" rule) #3173

@feross

Description

@feross

With this code:

export function create (id, xfilter, rawType,
                        width=defaultWidth, height=defaultHeight,
                        footerHeight=defaultFooterHeight,
                        padding=defaultPadding) {
  // ... function body, indented two spaces
}

And this config:

"indent": [2, 2, { "indentSwitchCase": true }]

There is an unexpected error:

/t.js:6:2: Expected indentation of 24 characters.

I expect to be able to use 2 spaces indentation for the function body. The indentation of the function parameters should not effect the body.

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 discussionbugESLint is working incorrectlyruleRelates 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