Skip to content

@stylistic/js/

padding-line-between-statements

This rule extends the base padding-line-between-statements rule.

It adds support for TypeScript constructs such as enum, interface and type.

Options

In addition to options provided by ESLint, the following options can be used as statement types:

  • enum
  • interface
  • type
  • function-overload

For example, to add blank lines before enums, interfaces and type definitions:

jsonc
{
  "@stylistic/padding-line-between-statements": [
    "error",
    {
      "blankLine": "always",
      "prev": "*",
      "next": ["enum", "interface", "type"]
    }
  ]
}

To avoid blank lines between function overloads and the function body:

jsonc
{
  "@stylistic/padding-line-between-statements": [
    "error",
    {
      "blankLine": "never",
      "prev": "function-overload",
      "next": "function"
    }
  ]
}

Released under the MIT License.