Comments (11)
Hey @PalleZingmark thanks for pointing this out.
So, really we got 2 issues here. Duplicates can't toggle and the actual check itself isn't working as intended.
Don't have a lot of time right now, so I just pushed up a quick fix for the toggle issue: if you update to the latest stylint you should be able to toggle duplicates off.
I'll take a longer look at false positives problem prolly tonight.
Thanks!
from stylint.
Thank you, toggling duplicates is now working as intended.
from stylint.
Hey, i wasn't able to replicate your issue, but I was able to make a few improvements to duplicates. I'd get the latest and see if they resolve your issue maybe?
I'm gonna close this issue out, i'll reopen if I can replicate it.
from stylint.
No, unfortunately it does not solve my issue.
I did some further tests, and while this throws a warning:
.foo {
.bar {
color: red;
}
}
This does not:
.foo {
.bar {
color: red;
}}
It also throws warnings if you're using BEM naming methodology, so it looks like the match pattern is somewhat off in the duplicateCheck.
.foo {
.foo-bar {
color: red;
}
}
from stylint.
So, i still couldn't replicate this. Maybe post your config? Are you using tabs or spaces for indenting?
from stylint.
stylint-test.styl
.foo {
.foo-bar {
color: red;
}
}
.stylintrc
{
"alphabetical": false,
"borderNone": true,
"brackets": false,
"colons": false,
"commaSpace": true,
"commentSpace": false,
"cssLiteral": false,
"duplicates": true,
"depthLimit": 4,
"efficient": true,
"enforceVarStyle": false,
"enforceBlockStyle": false,
"extendPref": false,
"globalDupe": false,
"indentSpaces": 2,
"leadingZero": false,
"maxWarnings": 10,
"mixed": true,
"namingConvention": "BEM",
"parenSpace": false,
"placeholders": false,
"semicolons": false,
"Whitespace": true,
"universal": false,
"valid": true,
"zeroUnits": true,
"zIndexDuplicates": false,
"zIndexNormalize": false
}
hmm, I can see some strange behavior.
If I just lint stylint-test.styl by itself, using the config above - it passes.
But if I @import it into my project - it fails.
Warning: duplicate property or selector, consider merging
File: ./app/assets/stylus/stylint-test.styl
Line: 5: }
I have no other classes named .foo or .foo-bar in my project, so it shouldn't throw a warning.
To make it pass, I need to do like this:
.foo {
.foo-bar {
color: red;
}}
from stylint.
@PalleZingmark hey so, i was eventually able to replicate the issue and hopefully 0.8.8 fixes it.
Let me know!
from stylint.
.....in 0.8.8,i set duplicates as true.but didnt throw a warning
my test code:
.some-class
margin 0
margin 5px
from stylint.
@lin-hun thx for reporting: was able to duplicate, try upgrading to 0.8.9 and see if that fixes it.
from stylint.
=w= duplicates works well
from stylint.
+1 cool, gonna close this now
from stylint.
Related Issues (20)
- bug(outdated): -webkit-text-stroke and unicode-bidi properties
- docs(outdated): outdated documentation in official site HOT 1
- Project still maintained? HOT 1
- Checkstyle Reporter
- VS Code Stylint Extension HOT 1
- ^[-1]:hover ^[-1..-1] - property is not valid
- feature_request(config): support config via .stylintrc.js (CommonJS export)
- Asterisk sometimes considered universal selector when used for multiplication
- Add support for "font-variation-settings" (variable fonts) HOT 1
- The .stylintrc file is ignored while using with syntastic in vim.
- Unable to support the Stylint Sublime Text plugin
- CLI support for multiple files HOT 2
- Hexadecimal spelling HOT 1
- bug(duplicates): false positives, if exists comments for Stylus selectors HOT 1
- Would you consider changing license to MIT? HOT 2
- duplicate property or selector, consider merging {block}
- CSS Grid Property is not valid HOT 1
- "valid" and "brackets": false positives on Stylus hashes
- Shareble config support
- Duplicate Warning when use mixin {block}
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 stylint.