Skip to content

Suggestion for indent rule #26

@Avaq

Description

@Avaq

We recently started using add (21) (21) style call expressions at work, and I came up with the following indent rule to facilitate it:

{"indent": ["error", 2, {
  "ignoredNodes": ["CallExpression[callee.type='CallExpression']"]
}]}

The magic is in the ignoreNodes rule. It says that any CallExpression calling another CallExpression doesn't need to follow indentation rules.

There are many other directives that can be added to the indent rule options to further customize the rules, but they are not relevant to this example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions