Closed wellyshen closed 6 years ago
Don't suppose you got any further with this? Getting the same error and can't seem to fix.
Same here - I'm not sure if it's just not finding the .stylelintrc
file or what.
Not a fix by any stretch but have added:
stylelint._options.configFile = '/Users/msnow345/Documents/Sites/Site-name/.stylelintrc'
to line 25 of getConfigForFile.js in the stylelint module in my node_modules just to monkey patch it so it works for me for now until I can look at it further.
A quick check suggests the config is found by contrib-stylelint, but that it never finds it's way to the stylelint module as it is processed, all of the options it expects to receive are undefined. I'l take a proper look at it later tonight and hopefully sort an actual fix.
There's #41 pull request that does not have this issue and fixes more bugs but we're still waiting for it to be merged
@aziz Good job !
I have the same problem. I suppose that the reason is the value of @ argument in command for linter. If turn on the debug mode the command to lint is:
['/usr/bin/node', 'HOME_DIRECTORY/.config/sublime-text-3/Packages/SublimeLinter-contrib-stylelint/stylelint_wrapper.js', '@', '--config', 'PROJECT_DIRECTORY/.stylelintrc']
HOME_DIRECTORY
and PROJECT_DIRECTORY
are paths
When using stylelint v 7.1.0
the value of @
argument is relative to PROJECT_DIRECTORY
, ex. ../../../../../tmp/SublimeLinter3-USER/test.css
But in stylelint v 7.4.2
the value of @ is absolute - /tmp/SublimeLinter3-USER/test.css
So there is no .stylelintrc
in /tmp
folder and linter is not able to process file.
@msnow345 thanks, the temporary workaround works for me!
@andreyjamer seems stylelint@7.5.0 fixed this 😃
For temporary fix add this to SublimeLinter.sublime-settings
{
"user": {
"linters": {
"stylelint": {
"@disable": false,
"args": ["--config", "/Users/username/path/to/.stylelintrc"],
"chdir": "${project}",
"excludes": []
}
}
}
}
@WesleydeSouza Yes, bug is fixed.
I still get this message on my OS X installation and do not know how to fix it?
SublimeLinter: WARNING: stylelint output:
Error: No configuration provided for ...
Hi I use the stylelint 7.4.2, but it doesn't work and I receive the following error on the console log of Sublime Text 3 debug mode:
Here's my .stylelintrc: