Giter Site home page Giter Site logo

Comments (12)

Arcanemagus avatar Arcanemagus commented on May 30, 2024

Do you have an example file to test trigger this? Or does it happen for you on every file?

from linter-stylelint.

sambev avatar sambev commented on May 30, 2024

I do use postcss syntax for most of my files but it will happen on any kind of css file

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 30, 2024

I'm not able to reproduce this, do you have a file that you can share that triggers this?

If not, when you run into this can you put a breakpoint in linter-stylelint right before it returns its messages and see if any of the ranges are invalid?

from linter-stylelint.

1000ch avatar 1000ch commented on May 30, 2024

@sambev Would you paste CSS example that reproduce this problem?

from linter-stylelint.

sambev avatar sambev commented on May 30, 2024

@1000ch Sure.

.test-list {
    background-color: red;
}

@Arcanemagus I'll try to get into the error a bit more on Monday and post the results. Thanks!

from linter-stylelint.

sambev avatar sambev commented on May 30, 2024

@Arcanemagus looks like my ranges are indeed invalid.
screen shot 2015-11-30 at 9 36 18 am

The errors look to be errors with my stylelintrc e.g. I had 'long' as a value for color-hex-case. I am working on fixing them (I can inspect the message objects before the exception).

from linter-stylelint.

sambev avatar sambev commented on May 30, 2024

It looks like after I cleaned up the errors in my stylelintrc file, it's working great.

It seems that with errors in the stylelintrc there is no line, column, rule, or severity with the warning, which kind of makes sense. Not sure what the right fix for this would be. Could we just put dummy values (1, 1, 'misconfigured .stylelintrc', 'critical')?

{line: undefined, column: undefined, rule: undefined, severity: undefined, text: "Expected option value for rule "string-quotes""}

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 30, 2024

Yea, that's what is done with other linters, we just create a dummy range encompassing the first line of the file.

from linter-stylelint.

satazor avatar satazor commented on May 30, 2024

@Arcanemagus I was just hit by this issue.. I had errors in my stylelint that led to this. Do you accept a PR which mocks the line, column, etc?

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 30, 2024

Of course 😉

from linter-stylelint.

satazor avatar satazor commented on May 30, 2024

@Arcanemagus this is actually more complex than it seems.

There are three kind of errors that might happen:

1 - Invalid syntax of .stylelintrc which cosmic config will detected (this is showing a error notification atm)
2 - Error thrown by stylelint when a fatal error exists, e.g. specifying "extends" pointing to an invalid module (this is being ignored atm)
3 - The actual error described here, where we have a rule with an invalid option that causes line and column to be undefined

How does the other linters deal with 1? Looking at the source code of some of them, I think they simply return a promise that will fail, which causes a error notification to popup. Imho we should do something similar or perhaps show a custom error notification. We are already kind of doing this.

2 needs to be fixed so that all errors thrown by stylelint are handled properly, perhaps display a error notification similar to 1.

3 needs to handle line and column being undefined and display the error at the beginning of the file as suggested.

Thoughts?

from linter-stylelint.

satazor avatar satazor commented on May 30, 2024

This issue can now be closed

from linter-stylelint.

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.