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.

🐞 BUG: `padding-line-between-statements` & `lines-around-comment` rules conflict with each other

See original GitHub issue

Environment

Node version: v16.5 npm version: - Local ESLint version: v7.32 Global ESLint version: Same Operating System: Linux

What parser are you using?

Default (Espree)

What did you do?

Config

'padding-line-between-statements' : [
	// Disallow empty lines between consecutive variable declarations
	{
		blankLine : 'never',
		prev      : [
			'singleline-let',
			'singleline-const',
			'singleline-var',
		],
		next      : [
			'singleline-let',
			'singleline-const',
			'singleline-var',
		],
	},
]

// Require empty line before comments
'lines-around-comment' : [
	{
		beforeBlockComment         : true,
		beforeLineComment          : true,
		applyDefaultIgnorePatterns : false,
	},
],

Example

// Works
const apple = 'Apple'
const cat   = 'Cat'

// Produces lint errors when there is a space between these two declarations & also when, there is none.

// Fruit
const apple = 'Apple'

// Animal
const cat   = 'Cat'

What did you expect to happen?

lines-around-comment rule should take precedence.

What actually happened?

Both rules conflict with each other.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
floskercommented, Nov 21, 2021

@bfelbo No, haven’t added that one. I changed my config (and padded-block rule), that seemed to satisfy my needs.

0reactions
bfelbocommented, Nov 20, 2021

@flosker did you create a rule to include comment as an additional STATEMENT_TYPE?

If so, would be awesome if you could share 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rule 1.7 Conflict of Interest: Current Clients - Comment
[11] When lawyers representing different clients in the same matter or in substantially related matters are closely related by blood or marriage, there...
Read more >
Rule 1.7 Conflict of Interest: Current Clients
(Rule Approved by the Supreme Court, Effective November 1, 2018). (a) A lawyer shall not, without informed written consent* from each client and....
Read more >
rule 19-301.7. conflict of interest - State Government Sites
For specific Rules regarding certain conflicts of interest, see Rule 19-301.8 (1.8). ... Whether clients are aligned directly against each other within the ......
Read more >
Ten Simple Rules for avoiding and resolving conflicts ... - NCBI
During the course of our personal and professional lives, we spend a significant amount of time communicating with others.
Read more >
Supreme Court Rules - Conflict of Interest: Current Clients
For former client conflicts of interest, see Rule 4-1.9. ... Whether clients are aligned directly against each other within the meaning of ...
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