question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add "multiline-const", "multiline-let" and "multiline-var" STATEMENT_TYPEs to padding-line-between-statements rule

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
not-an-aardvarkcommented, Oct 30, 2018

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 like singleline-var and kept var as-is?

1reaction
neemzycommented, Nov 2, 2018

So var would match both single-line and multiline statements, and singleline-var and multiline-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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found