Multiline expressions in padding-line-between-statements rule
See original GitHub issueTell us about your environment
- ESLint Version: 4.9.0
- Node Version: 6.11.3
- npm Version: 3.10.10
What parser (default, Babel-ESLint, etc.) are you using? AirBnb Please show your full configuration:
Configuration
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script"
},
"env": {
"node": true
},
"extends": "airbnb-base",
"rules": {
"arrow-parens": ["error", "always"],
"comma-dangle": ["error", "never"],
"consistent-return": "off",
"indent": ["error", 2],
"max-len": ["error", 200],
"no-multiple-empty-lines": ["error", {"max": 1, "maxEOF": 1}],
"no-plusplus": "off",
"no-underscore-dangle": ["off"],
"no-use-before-define": ["error", { "functions": false }],
"object-shorthand": ["off"],
"padding-line-between-statements": ["error",
{"blankLine": "always", "prev": "block", "next": "*"},
{"blankLine": "always", "prev": "function", "next": "*"},
{"blankLine": "always", "prev": "block", "next":"*"},
{"blankLine": "always", "prev": ["cjs-export"], "next": "*"},
{"blankLine": "always", "prev": ["*"], "next": "cjs-export"}
],
"strict": ["error", "global"]
}
}
What did you do? Please include the actual source code causing the issue. Would it be or is it already possible to distinguish multiline from single line expressions in the padding-line-between-statements rule? For example:
Distinguish this:
someArray.forEach((x) => doSomething(x));
From this:
someArray.forEach((x) => {
doSomething(x);
doAnotherThing(x);
});
What did you expect to happen? I would like to be able to identify multiline expressions in order to enforce blank lines between them and certain other statements.
What actually happened? Please include the actual, raw output from ESLint. No ability to distinguish multi line expressions from single line expressions.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:10 (6 by maintainers)
Top Results From Across the Web
padding-line-between-statements - Pluggable JavaScript Linter
This rule requires or disallows blank lines between the given 2 kinds of statements. Properly blank lines help developers to understand the code....
Read more >padding-line-between-statements - Rules - ESLint
This rule requires or disallows blank lines between the given 2 kinds of statements. Properly blank lines help developers to understand the code....
Read more >padding-line-between-statements | typescript-eslint
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 ....
Read more >vue/padding-line-between-tags
Rule Details #. This rule requires or disallows newlines between sibling HTML tags.
Read more >require or disallow an empty line between class members ...
This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
great! I’ll champion this, marked as
accepted
.It looks like this was also proposed in https://github.com/eslint/eslint/pull/8668 but no one on the team ended up championing the proposal. We can see if anyone is interested in supporting it this time around.