Comments (12)
Do you have an example file to test trigger this? Or does it happen for you on every file?
from linter-stylelint.
I do use postcss syntax for most of my files but it will happen on any kind of css file
from linter-stylelint.
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.
@sambev Would you paste CSS example that reproduce this problem?
from linter-stylelint.
@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.
@Arcanemagus looks like my ranges are indeed invalid.
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.
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.
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.
@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.
Of course
from linter-stylelint.
@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.
This issue can now be closed
from linter-stylelint.
Related Issues (20)
- don't fix "color-hex-case": "lower" rule in rgba functinos. HOT 1
- Uncaught Error: Cannot find module 'sb-fs' HOT 2
- Error and stack trace while trying to run stylelint on a file HOT 1
- Uncaught RangeError: path should be a `path.relative()`d string, but got "../../../../duncan/dev/central/web-ui/src/components/common/Component.md" HOT 1
- Don't work with .sass files HOT 2
- EBADF: Bad File Descriptor error HOT 3
- stylelint version way out of date and incompatible with current stylelint rules HOT 4
- How can I get "Possible Errors" to show up as errors and "Stylistic Issues" to show up as warnings? HOT 3
- Provide configfile option from settings?
- Inline and/or manual fix integration? HOT 1
- Crash - Error running stylelint Error: Column start (11) greater than line length (0) for line 8 HOT 1
- stylelint.config.js file is ignored
- Cannot destructure property `isPathValid` of 'undefined' or 'null'. HOT 3
- Plugin not working with stylelint-config-sass-guidelines HOT 2
- Update to latest stylelint HOT 5
- Cannot find module 'atom' (crashes fuzzy-finder)
- Error on line 1 HOT 1
- Dependency Dashboard
- Getting error in Atom about static/index.json? HOT 3
- Stylelint Plugin is not picking up nested syntax configrations
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 linter-stylelint.