Giter Site home page Giter Site logo

duplicateCheck looks buggy about stylint HOT 11 CLOSED

simenb avatar simenb commented on July 1, 2024
duplicateCheck looks buggy

from stylint.

Comments (11)

rossPatton avatar rossPatton commented on July 1, 2024

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.

PalleZingmark avatar PalleZingmark commented on July 1, 2024

Thank you, toggling duplicates is now working as intended. 👍

from stylint.

rossPatton avatar rossPatton commented on July 1, 2024

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.

PalleZingmark avatar PalleZingmark commented on July 1, 2024

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.

rossPatton avatar rossPatton commented on July 1, 2024

So, i still couldn't replicate this. Maybe post your config? Are you using tabs or spaces for indenting?

from stylint.

PalleZingmark avatar PalleZingmark commented on July 1, 2024

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.

rossPatton avatar rossPatton commented on July 1, 2024

@PalleZingmark hey so, i was eventually able to replicate the issue and hopefully 0.8.8 fixes it.

Let me know!

from stylint.

lin-hun avatar lin-hun commented on July 1, 2024

.....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.

rossPatton avatar rossPatton commented on July 1, 2024

@lin-hun thx for reporting: was able to duplicate, try upgrading to 0.8.9 and see if that fixes it.

from stylint.

lin-hun avatar lin-hun commented on July 1, 2024

=w= duplicates works well

from stylint.

rossPatton avatar rossPatton commented on July 1, 2024

+1 cool, gonna close this now

from stylint.

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.