Code Monkey home page Code Monkey logo

lesslint's Issues

_escapeNonEndOfLineSemicolon returns NULL and thus drop content to validate (bypass all rules)

I have a freaking issue i can't manage to solve and thus need more brain juices.

I have the following style.less file:

.f{background: url(t.png); padding: 0; border: 0; width: 0px; height: 0px;}

.skewX(){

}

Lesslint returns no error, despite there are errors :

*line 1: 
   - Closing bracket must be on its own line
   - No need to specify units when a value is 0
   - One property per line max
   - Use one space before an opening bracket: {
line 4: 
   - Use one space before an opening bracket: {
   - This line should be indented with 2 tabs
line 6, This line should be indented with 1 tab

It is because in this case _escapeNonEndOfLineSemicolon returns NULL and "clear" all content to validate so of course there is no error with an empty file.

The issue is with the pattern used:

#\((?:(?:.*)(;)(?:.*))*\)#e

Test code:

$content    =   '.f{background: url(t.png); padding: 0; border: 0; width: 0px; height: 0px;}';

var_dump(preg_match('#\((?:(?:.*)(;)(?:.*))*\)#', $content));

=> bool(false) (wut?) :

Now removes any of the padding/border/height property:

.f{background: url(t.png); padding: 0; border: 0; height: 0px;}

.skewX(){

}

=> works, leesslint finds errors.

$content    =   '.f{background: url(t.png); padding: 0; border: 0; height: 0px;}';

var_dump(preg_match('#\((?:(?:.*)(;)(?:.*))*\)#', $content));

=> int(0) (wut?²)

You can try with another propery after background with the same result.

I'm unable to figure out the issue, looks like an internal php bug.

What is the purpose of _escapeNonEndOfLineSemicolon ?

My test:

php /usr/local/webtools/lesslint/lesslint-fix.php /usr/local/webtools/lesslint/test/rules.json /home/server/htdocs/projects/tests/test-ksimonst/tk/public/assets/front/css/style.less

Couldn't commit lesshat's new keyframes mixin

.keyframes(~'animationName, 0%{ transform: scale(1.5); color: blue; } 100%{ transform: scale(2); color: red }');

As we have to write all keys & CSS properties in one single string for this mixin, LESSlint blocking commit with following errors:

Thrown errors => Closing bracket must be on its own line
=> No need to specify units when a value is 0

Don't understand how to use

lesslint rules.json /path/to/less/folder/ /path/to/file.less
    --exclude=file.less,lib.less
    --recursive

I don't understand the last 2 args. Are the 2 mandatory? Can I just indicate one (folder OR file?)

Thanks

Kevin89

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.