# eslint-plugin-padding-ex

> An ESLint plugin regarding any and all spacing between statements

Latest version **1.0.1** (published 2022-08-10) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-padding-ex
pnpm add eslint-plugin-padding-ex
yarn add eslint-plugin-padding-ex
bun add eslint-plugin-padding-ex
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-08-10 |
| First published | 2022-08-10 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 69.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jun-sheaf |
| Maintainers | photon79 |
| Keywords | eslint, eslintplugin, padding, eslint-padding, spacing |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-padding-ex
- Repository: https://github.com/Photon79/eslint-plugin-padding-ex
- Homepage: https://github.com/Photon79/eslint-plugin-padding-ex#readme
- Issues: https://github.com/Photon79/eslint-plugin-padding-ex/issues
- npm.io page: https://npm.io/package/eslint-plugin-padding-ex

## Dependencies (1)

- [@typescript-eslint/utils](https://npm.io/package/@typescript-eslint/utils.md) ^5.33.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-08-10
- 1.0.0 — 2022-08-10

## README

# `eslint-plugin-padding`

This rule allows/disallows spacing between two given statements. Spacing generally helps
readability. This rule is a generalized version of the
[`eslint/padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements)
rule and can also be used to replace
[eslint/lines-between-class-members](https://eslint.org/docs/rules/lines-between-class-members).

### Syntax

```json
{
    "padding/spacing": [
        "error",
        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
        ...
    ]
}
```

- `LINEBREAK_TYPE` is one of the following.

  - `"any"` just ignores the statement pair.
  - `"never"` disallows blank lines.
  - `"always"` requires one or more blank lines. Note it does not count lines that comments exist as
    blank lines. te it does not count lines that comments exist as blank lines.

- `STATEMENT_TYPE` is one (or an array) of the following:

  1. A space-delimited list of keyword (e.g. `"const"`, `"export const"`, or `"class"`)
  2. One of the following:

     - `"*"` is wildcard. This matches any statements.
     - `"block-like"` - block like statements. This matches statements that the last token is the
       closing brace of blocks; e.g. `{ }`, `if (a) { }`, and `while (a) { }`. Also matches immediately
       invoked function expression statements.
     - `"exports"` - `export` statements of CommonJS; e.g. `module.exports = 0`,
       `module.exports.foo = 1`, and `exports.foo = 2`.
     - `"require"` - `require` statements of CommonJS; e.g. `const foo = require("foo")`.
     - `"directive"` - directive prologues. This matches directives; e.g. `"use strict"`.
     - `"iife"` - immediately invoked function expression statements. This matches calls on a function
       expression, optionally prefixed with a unary operator.
  - An object of the form

    ```json
    {
      "type": NODE_TYPE | undefined,
      "keyword": KEYWORD | undefined,
      "inline": boolean | undefined
      "comment": boolean | 'line' | 'block' | undefined
    }
    ```

    where

    - `NODE_TYPE` is the name of an `ESTree` node type, e.g. `"FunctionDeclaration"`. You can use an
      [`AST explorer`](https://astexplorer.net) to get the name of a particular node.
    - `KEYWORD` is one (or an array) of either (i) or (ii).
    - `"inline"` is a flag that denotes the node must span multiple lines (`false`) or a single
      line (`true`)
    - `"comment"` specifies the particular node has a comment before it. String options declare a specific type.

## When Not To Use It

If you don't want to notify warnings about linebreaks, then it's safe to disable this rule.

<sup>Taken with ❤️
[from ESLint core](https://eslint.org/docs/rules/padding-line-between-statements#require-or-disallow-padding-lines-between-statements-padding-line-between-statements)</sup>

---
_Source: https://npm.io/package/eslint-plugin-padding-ex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
