Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.38 KB

padding-line-between-statements.md

File metadata and controls

48 lines (38 loc) · 1.38 KB

require or disallow padding lines between statements (padding-line-between-statements)

Rule Details

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

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

How to use

{
  // note you must disable the base rule as it can report incorrect errors
  "padding-line-between-statements": "off",
  "@typescript-eslint/padding-line-between-statements": [
    "error",
    {
      "blankLine": "always",
      "prev": "var",
      "next": "return"
    }
  ]
}
{
  // Example - Add blank lines before interface and type definitions.
  // note you must disable the base rule as it can report incorrect errors
  "padding-line-between-statements": "off",
  "@typescript-eslint/padding-line-between-statements": [
    "error",
    {
      "blankLine": "always",
      "prev": "*",
      "next": ["interface", "type"]
    }
  ]
}

Options

See eslint/padding-line-between-statements options.

Note - In addition to options provided by ESLint, we have also added options for interface and type.

Taken with ❤️ from ESLint core