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.

newlineAfterBlock with nested blocks

See original GitHub issue

Hello,

if got problems to resolve the following warning(s)

Warning: app.less: line 1636, col 5, newlineAfterBlock: All blocks should be followed by a new line.
Warning: app.less: line 1641, col 3, newlineAfterBlock: All blocks should be followed by a new line.
Warning: app.less: line 1644, col 5, newlineAfterBlock: All blocks should be followed by a new line.
Warning: app.less: line 1649, col 3, newlineAfterBlock: All blocks should be followed by a new line.
Warning: app.less: line 1652, col 5, newlineAfterBlock: All blocks should be followed by a new line.
Warning: app.less: line 1657, col 3, newlineAfterBlock: All blocks should be followed by a new line.
Warning: app.less: line 1660, col 5, newlineAfterBlock: All blocks should be followed by a new line.

It works not on nested blocks for me. Here is my less source: (starting from line 1631)

/* Animations */
[ui-view] {
  &.ng-enter {
    opacity: 0;
    transition: 0.25s linear all;
    &.ng-enter-active {
      opacity: 1;
    }
  }

  &.ng-add {
    opacity: 0;
    transition: 0.25s linear all;
    &.ng-add-active {
      opacity: 1;
    }
  }

  &.ng-leave {
    opacity: 1;
    transition: 0.25s linear all;
    &.ng-leave-active {
      opacity: 0;
    }
  }

  &.ng-remove {
    opacity: 1;
    transition: 0.25s linear all;
    &.ng-remove-active {
      opacity: 0;
    }
  }
}

I found nothing about nested formatting in your documentation, so I tried some cases but always got

newlineAfterBlock: All blocks should be followed by a new line.

or

trailingWhitespace: There should't be any trailing whitespace.

How should the less code structured to remove the warning? Or is it a bug?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jwilssoncommented, Oct 10, 2016

I’ve got a proposed fix in #264 which should fix @tkazec’s issue. @solidevolution could you check with that code as well?

0reactions
tkazeccommented, Oct 11, 2016

Can confirm the same, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - Stylelint - new line before first nested block - Stack Overflow
The following adds new lines to all nested blocks: "rule-empty-line-before": [ "never-multi-line", { "except": ["inside-block"] } ], css. ...
Read more >
block-opening-brace-newline-after - Stylelint
Require a newline after the opening brace of blocks. Refer to combining rules for more information on using this rule with block-opening-brace-newline-before ...
Read more >
Empty line around nesting blocks of the same indentation #823
@joallard It seems rubocop allows nested blocks without newlines by default. I am facing this issue too but couldn't find a solution for...
Read more >
Rationale - Prettier
Empty lines at the start and end of blocks (and whole files) are removed. ... And if you'd like to go multiline again,...
Read more >
Style Guide - CS 61BL Summer 2022
However, you may separate them with a newline followed by blanks (for ... Indent code by the basic indentation step for each block...
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