Add "multiline-const", "multiline-let" and "multiline-var" STATEMENT_TYPEs to padding-line-between-statements rule
See original GitHub issueWhat rule do you want to change? padding-line-between-statements
Does this change cause the rule to produce more or fewer warnings? More
How will the change be implemented? (New option, new default behavior, etc.)? New accepted values for prev
and next
configuration options
Please provide some example code that this change will affect:
const bouya = { hey: "ho" };
const kasha = {
tik: "tok",
onda: "clock"
};
What does the rule currently do for this code? The rule is unable to differentiate single-line and multi-line const
, let
and var
statements.
What will the rule do after it’s changed? The rule will offer the possibility to treat aforementioned cases differently, e.g. enforce blank lines around a multi-line variable declaration but not around a single-line one.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:17 (17 by maintainers)
Top Results From Across the Web
JavaScript Multiline String – How to Create Multi Line Strings ...
In this article, you will learn three different ways to create multi-line strings in JavaScript. I will first explain the basics of strings ......
Read more >Creating multiline strings in JavaScript - Stack Overflow
As the first answer mentions, with ES6/Babel, you can now create multi-line strings simply by using backticks: const htmlString = `Say hello to...
Read more >How to Create Multi-Line String with Template Literals
So template literals will output as it appears, spaces and all! Because of that, be mindful of your blank spaces or lines. const...
Read more >How to Create Multiline Strings in Go - freshman.tech
Creating a multiline string is quite straightforward in Go. This article will show you how it's done.
Read more >Multiline string literals should not be used - SonarSource Rules
TypeScript static code analysis. Unique rules to find Bugs, Vulnerabilities, Security Hotspots, and Code Smells in your TYPESCRIPT code.
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
To me, it seems confusing to have a type called
var
that actually means “single-line var statement” (even if we do it after a breaking change). What if we added something likesingleline-var
and keptvar
as-is?So
var
would match both single-line and multiline statements, andsingleline-var
andmultiline-var
would be added to allow for more specific targetting? That would be fine by me and would indeed avoid introducing a BC break. @platinumazure @not-an-aardvark Do you want me to update the PR accordingly?