Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/othree/eslint-plugin-pep8-blank-lines
An ESLint blank line rule supports rule for different level. Inspired by PEP8.
https://github.com/othree/eslint-plugin-pep8-blank-lines
blank-line eslint eslint-plugin
Last synced: about 1 month ago
JSON representation
An ESLint blank line rule supports rule for different level. Inspired by PEP8.
- Host: GitHub
- URL: https://github.com/othree/eslint-plugin-pep8-blank-lines
- Owner: othree
- License: mit
- Created: 2018-04-24T05:24:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-03T06:06:53.000Z (over 5 years ago)
- Last Synced: 2024-08-10T23:23:30.003Z (3 months ago)
- Topics: blank-line, eslint, eslint-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/eslint-plugin-pep8-blank-lines
- Size: 152 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-pep8-blank-lines
[![CircleCI](https://circleci.com/gh/othree/eslint-plugin-pep8-blank-lines.svg?style=svg)](https://circleci.com/gh/othree/eslint-plugin-pep8-blank-lines)
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.
```sh
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:```json
{
"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
}
}
```[PEP8]:https://www.python.org/dev/peps/pep-0008/#blank-lines
[standard]:https://standardjs.com/