Giter Club home page Giter Club logo

Comments (8)

jwilsson avatar jwilsson commented on September 28, 2024

This should be fixed in 6.3.3.

from lesshint.

deanc avatar deanc commented on September 28, 2024

Thank you @jwilsson . I will test as soon as yarn spots the new version.

from lesshint.

deanc avatar deanc commented on September 28, 2024

@jwilsson I'm pretty sure I upgraded (yarn upgrade lesshint - although I am using it through the gulp plugin). I checked yarn.lock and saw 6.3.3 in there, so it looks to be installed. But i'm still getting the errors, but now in different places.

The example in the original post is fine. But this now gives an error:

.something {
  display: block;
  .font-size(18);
  .fontMedium;
}

Gives the error:

Warning: test.less: line 3, col 3, newlineAfterBlock: All blocks should be followed by a new line.

I also see lots of weird newlineAfterBlock errors where I clearly don't have a mixin in use.

For example in my variables.less:

@columnWidth: 60px;
@gutterWidth: 57px;

@desktop: 1400px;
@tablet: 1024px;
@mobile: 720px;

// colors
@bodyBackground: #F4F2EF;
@bodyForeground: #373737;

@norr3Blue: #175E6F;

@green: #4FA389;
@orange: #FF9662;
@pink: #FFBCBD;
@yellow: #FFDD84;

@tabletBreakPoint: @tablet - 1px;

Error: Warning: variables.less: line 1, col 1, newlineAfterBlock: All blocks should be followed by a new line.

from lesshint.

jwilsson avatar jwilsson commented on September 28, 2024

@deanc Please check with 6.3.5, that should take care of both issues.

I decided to refactor the whole rule, hence the new errors. Thanks for working through them with me!

from lesshint.

deanc avatar deanc commented on September 28, 2024

Thanks @jwilsson - I'm still getting some related issues. Here's another test-case:

@sectionPadding: 8em;

.homepage-section {
    padding-left: 15%;
    display: flex;
    width: 100%;
    max-width: @desktop;
    margin: 0 auto;
    position: relative;

    .side {
        width: 200px;
        padding: @sectionPadding 2em;
        outline: 1px solid red;

        .label {
            transform: rotate(90deg);
            transform-origin: 0;
            .font-size(24);
        }
    }
    .main {
        position: relative;
        flex: 1;

        > p:last-child {
          margin-bottom: 0;
        }
    }
}

Note how it's correctly reporting. As soon as I add a new line it gives this instead: Warning: test.less: line 22, col 4, trailingWhitespace: There shouldn't be any trailing whitespace.

from lesshint.

deanc avatar deanc commented on September 28, 2024

Here's another case where it has issues:

@import 'base/variables';
@import 'base/mixins';
@import 'base/typography';

Gives:

Warning: test.less: line 1, col 1, newlineAfterBlock: All blocks should be followed by a new line.
Warning: test.less: line 2, col 1, newlineAfterBlock: All blocks should be followed by a new line.

from lesshint.

jwilsson avatar jwilsson commented on September 28, 2024

@deanc Your first case might be correct though (GitHub seems to strip trailing whitespace), are there any trailing whitespace on that line?

The second case is definitely a bug, though. I'll take a look.

from lesshint.

jwilsson avatar jwilsson commented on September 28, 2024

@deanc With 6.3.6 @import s shouldn't be reported anymore.

from lesshint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.