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.

Lines between variable/property/any assignments

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? Less and more warnings

How will the change be implemented? (New option, new default behavior, etc.)? New option

Please provide some example code that this change will affect:

constructor() {
  this.a = 1;
  this.b = 2; // Expect new line after this assignment
  this.method();
}
method(){
  let c = 3;

  if(this.a === 1){
    c = 4; // Expect new line after this assignment
    console.log(c);
  }
}

What does the rule currently do for this code? It doesn’t have any configuration for variable or property assignments

What will the rule do after it’s changed?

constructor() {
  this.a = 1;
  this.b = 2;

  this.method();
}
method(){
  let c = 3;

  if(this.a === 1){
    c = 4;

    console.log(c);
  }
}

Are you willing to submit a pull request to implement this change? Not right now but if it’s needed, I can.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kaicataldocommented, Jun 1, 2020

Thanks for your understanding. This proposal would fall under this category:

Stylistic rules are frozen - we won’t be adding any more options to stylistic rules. We’ve learned that there’s no way to satisfy everyone’s personal preferences, and most of the rules already have a lot of difficult-to-understand options. Stylistic rules are those related to spacing, conventions, and generally anything that does not highlight an error or a better way to do something.

1reaction
kaicataldocommented, Jun 1, 2020

Since the API of stylistic rules are now frozen (please see here for more details), we won’t be able to accept this proposal. Thanks for wanting to help improve the project!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Explain the difference between single-line assignment of ...
Although the definition of assignment implies that overlaps between the left-hand side and the right-hand side are 'simultaneous' (for example a ...
Read more >
Allow two empty lines between imports and assignments #340
At @plone we created our own styleguide and decided that between imports and code there should be 2 blank lines, to clearly mark...
Read more >
Assignment #416: Shapes, Patterns, Textures and Lines
Find shapes, patterns, textures and lines in nature and then creatively weave them into your landscapes or make them the main subject.
Read more >
HTML Templates: Blue Lines - TCU Online
The Blue Lines Template set has a white background, blue and black text and icons and blue bars across the top and bottom...
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