Urara-Blog/node_modules/.pnpm-store/v3/files/87/bc3cb57ab8ab338c2892e75f997977ea72fb7e46a258f07e99e05861a787c656adf45d9d54d99f39c8c73cd939c8c9827033faf58ce80ffb09274d204ea720
2022-08-14 01:14:53 +08:00

60 lines
1.6 KiB
Text

---
description: 'Require or disallow padding lines between statements.'
---
> 🛑 This file is source code, not the primary documentation location! 🛑
>
> See **https://typescript-eslint.io/rules/padding-line-between-statements** for documentation.
## Rule Details
This rule extends the base [`eslint/padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) rule.
**It adds support for TypeScript constructs such as `interface` and `type`.**
## How to Use
```jsonc
{
// 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"
}
]
}
```
```jsonc
{
// 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](https://eslint.org/docs/rules/padding-line-between-statements#options).
In addition to options provided by ESLint, `interface` and `type` can be used as statement types.
**Note:** ESLint `cjs-export` and `cjs-import` statement types are renamed to `exports` and `require` respectively.
<sup>
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/padding-line-between-statements.md)
</sup>