Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with rule unknown-less-functions #95

Open
szegi opened this issue Mar 27, 2018 · 5 comments
Open

Problem with rule unknown-less-functions #95

szegi opened this issue Mar 27, 2018 · 5 comments
Labels

Comments

@szegi
Copy link

szegi commented Mar 27, 2018

I started using this plugin and i see that it found an issue
with "extend" function

.maine-layout--selected:extend(.maine-layout) {
    color: @text-color-grey;
    .status-new, .status-old, .status-ignore {
        color: @text-color-grey;
    }
}

but it doesnt see problem with

.client-library__some-data {
    &:extend(.client-list__some-data);
}

from what i read, extend is less function from some time
http://lesscss.org/features/#extend-feature

@racodond
Copy link
Owner

Hi,

Which version of the plugin are you running?

David

@szegi
Copy link
Author

szegi commented Mar 28, 2018

right now version 4.14

@racodond
Copy link
Owner

racodond commented Apr 1, 2018

Hi,

I cannot reproduce the issue.
Could you please provide the entire file as well a screenshot of the issue?

Thank you

David

@agabrys
Copy link

agabrys commented Apr 10, 2018

Hello @racodond,
I wrote a code which allows to reproduce the error:

unknown-less-functions

The file is compiled successfully.

Environment:

  • CSS / SCSS / Less plugin: 4.15
  • SonarQube: 7.0

Example file:
https://github.com/agabrys/sonarqube-falsepositives/blob/master/src/main/less/d20180410/unknown-less-functions.less

Project:
https://github.com/agabrys/sonarqube-falsepositives

Build:
mvn clean package sonar

Best Regards

@racodond racodond added the bug label Apr 13, 2018
@racodond
Copy link
Owner

Thanks for the reproducer @agabrys!

It's a tricky bug related to at-rule parsing. The violation here is a side-effect from that parsing issue.
keyword: @media
prelude:

(max-width: 768px) {
    .navtab-info--dates {
        padding-left: 1%;
    }
}

.customization-form__variation-data, .customization-form__variation-menu {
    display: inline-block;
}

.client-library__some-data {
    &:extend(.client-list__some-data);
}

.variation-layout--selected:extend(.variation-layout) {
    color: #000;
    .status-active, .status-inactive, .status-ignore {
        color: #000;
    }
}

block: none

instead of

keyword: @media
prelude: (max-width: 768px)
block:

{
    .navtab-info--dates {
        padding-left: 1%;
    }
}

.customization-form__variation-data, .customization-form__variation-menu {
    display: inline-block;
}

.client-library__some-data {
    &:extend(.client-list__some-data);
}

.variation-layout--selected:extend(.variation-layout) {
    color: #000;
    .status-active, .status-inactive, .status-ignore {
        color: #000;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants