Socket
Socket
Sign inDemoInstall

eslint-plugin-pep8-blank-lines

Package Overview
Dependencies
117
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-pep8-blank-lines

Ref: https://www.python.org/dev/peps/pep-0008/#blank-lines


Version published
Maintainers
1
Created

Readme

Source

eslint-plugin-pep8-blank-lines

CircleCI

An ESLint blank line rule supports rule for different level. Inspired by PEP8.

Now in Beta. Not widely test.

Why

The space between chapters and between paragraphs should be different make it have good readibility. I believe source code should too. But current ESLint rules can't have different blank line rule in different level of scope.

When I write Python and found the PEP8 coding style. I fall in love with this simple but elegant rule. Basically, it allows two blank line between top level classes or functions. So I can keep more spaces between top level objects. And I decide to implement it in ESLint.

Usage

Install

NPM install and save to dev dependency.

npm install --save-dev eslint-plugin-pep8-blank-lines

Configure

Sample eslintrc:

{
  "plugins": [
    "pep8-blank-lines",
  ],

  "rules": {
    "pep8-blank-lines/pep8-blank-lines": 2
  }
}

If your config based on other config style. You might need to disable some rule related to blank lines. Take standard for example:

{
  "extends": "standard",

  "plugins": [
    "pep8-blank-lines",
    "no-parameter-e"
  ],

  "rules": {
    "semi": [2, "always"],
    "no-extra-semi": 2,
    "comma-dangle": ["error", "always-multiline"],
    "no-multiple-empty-lines": 0,
    "pep8-blank-lines/pep8-blank-lines": 2,
    "no-parameter-e/no-parameter-e": 2
  }
}

Keywords

FAQs

Last updated on 03 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc