Comments (11)
Hi @HiperSoke,
Thanks for your feedback!
Is this code snippet part of an SCSS or CSS file?
Thank you
David
from sonar-css-plugin.
Hi racodond,
Thanks for your fast answer. That code snippet its part of a css file.
Regards.
from sonar-css-plugin.
I changed the /deep/ combinator to ::ng-deep as is the one that we should use for Angular 4 projects and seems that is isnt supported by the plugin, at least it can process the whole file so I can see other issues. I think that maybe you could add ::ng-deep as a deprecated combinator.
Check this url: https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep
Regards.
from sonar-css-plugin.
I changed the /deep/ combinator to ::ng-deep as is the one that we should use for Angular 4 projects and seems that is isnt supported by the plugin
/deep/
is considered as a CSS combinator. Thus, in CSS it cannot be the first element of a selector. Hence, the parse error you get.
Unlike CSS, it is possible to have a CSS combinator as first element of a selector in SCSS. Hence the support of /deep/
in SCSS when it is the first element of a selector.
I'm not familiar with /deep/
. Thus, it is really possible to have it as first element of a selector? If so, it'll require a change in the grammar.
::ng-deep
is considered as a pseudo-element, that's why it is properly parsed.
I think that maybe you could add ::ng-deep as a deprecated combinator
OK. ::ng-deep
is considered as a pseudo-element for now. Does it make sense to mark it as obsolete/deprecated in rule "Obsolete pseudo-elements and pseudo-classes should not be used". Or doesn't it make sense to consider it as a pseudo-element in an Anglular context? And it should really be considered as combinator in terms of wording?
from sonar-css-plugin.
I'm not an CSS expert, but I saw in a few examples that you can use /deep/ at the begining of an CSS file (checking the documentation of DevExtreme suit for Angular projects),
.
About the ::ng-deep I saw that other development teams are cosidering it as an pseudo-element. So for me looks fine to add it to that "Obsolete pseudo-elements and pseudo-classes should not be used" rule.
Regards.
from sonar-css-plugin.
I'm not an CSS expert, but I saw in a few examples that you can use /deep/ at the begining of an CSS file (checking the documentation of DevExtreme suit for Angular projects)
OK, I'll add support to this syntax.
.
About the ::ng-deep I saw that other development teams are cosidering it as an pseudo-element. So for me looks fine to add it to that "Obsolete pseudo-elements and pseudo-classes should not be used" rule.
OK. I created a dedicated issue: #45
from sonar-css-plugin.
just my two cents:
from what i read /deep/ support will be removed from chrome as its semantically incorrect and ::ng-deep is angular specific replacement...
in this light im not sure the resolution you come to is correct :)
from sonar-css-plugin.
Hi @vaclav-dvorak,
I'm not sure to understand.
You agree with "OK. I created a dedicated issue: #45"?
But you do not agree with "OK, I'll add support to this syntax."?
Even if it is deprecated, "/deep/" syntax usage should not lead to a crash while analyzing a CSS file with SonarQube. The parser should be able to parse this syntax (even if it is not widely used and will be less and less).
David
from sonar-css-plugin.
Also created new issue: #47
from sonar-css-plugin.
Sorry for not being clear.
From what i read it feels to me that /deep/ should be in deprecated list and ::ng-deep shouldn't (as its angulars response for dropping of /deep/ support).
Even though I feel that your statement : "/deep/ is considered as a CSS combinator. Thus, in CSS it cannot be the first element of a selector." is correct i don't know if its strict truth. It makes sense for parser to be able to parse it for sure.
from sonar-css-plugin.
OK. Got it.
From what i read it feels to me that /deep/ should be in deprecated list and ::ng-deep shouldn't (as its angulars response for dropping of /deep/ support).
They plan to drop support of ::ng-deep
as well. See https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep
The shadow-piercing descendant combinator is deprecated and support is being removed from major browsers and tools. As such we plan to drop support in Angular (for all 3 of /deep/, >>> and ::ng-deep). Until then ::ng-deep should be preferred for a broader compatibility with the tools.
Even though I feel that your statement : "/deep/ is considered as a CSS combinator. Thus, in CSS it cannot be the first element of a selector." is correct i don't know if its strict truth. It makes sense for parser to be able to parse it for sure.
OK
from sonar-css-plugin.
Related Issues (20)
- Change or disable rules HOT 1
- user-select css property HOT 9
- Add parameter to 'experimental-xxx-usage' rules to flag some properties/@-rules/pseudos/functions/identifiers as non-experimental
- Parse error in at-rule prelude with non-quoted URL
- Support CSS Fonts Module Level 4 HOT 2
- `MissingNewLineAtEndOfFileCheck` should skip empty files HOT 3
- Unknown type selectors - exclusion HOT 3
- Please add support for Angular Material HOT 3
- How to flag some pseudo elements as non-experimental? HOT 2
- the plugin can not be updated via the marketplace of the sonar HOT 1
- Cannot enable both this plugin and the built-in "SonarCSS" plugin HOT 2
- Naming convention HOT 2
- Parent selector (&) not supported in variable declaration HOT 4
- box-shadow considered experimental HOT 4
- validate-property-value: false-positive on `background-color` value format HOT 1
- Throws an error with special characters HOT 1
- SCSS parser failure (S2260): parser does not support identifiers starting with "-#" HOT 2
- FP css:validate-property-value on filter HOT 6
- Exclude the file type css HOT 1
- link to "quick try" doesn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonar-css-plugin.