Open Arkkimaagi opened 8 years ago
In addition, the syntax should be set so that stylelint gets the file format properly. This is how I get it working better from command line:
$ stylelint --syntax=less sample.less
Sadly I have no idea how to pass the syntax information trough sublimelinter
Any suggestions on getting this working are really welcome, as this is stopping me from linting some .less files alltogether.
I was able to get better support for LESS by hacking the stylelint_wrapper.js and linter.py like this:
linter.py:
syntax = ('css', 'css3', 'sass', 'scss', 'postcss', 'less')
stylelint_wrapper.js:
var syntax = "css";
if(/\.less$/.test(process.argv[2])){
syntax = "less"
}else if(/\.scss$/.test(process.argv[2])){
syntax = "scss"
}else if(/\.sss$/.test(process.argv[2])){
syntax = "sugarss"
}
var lint = child_process.spawnSync("node", [cliLocation, process.argv[2], "--syntax", syntax]);
It's an ugly fix, and as such does not warrant a pull request, but it shows that it can be done. Feel free to extrapolate from this ugly hack. :)
For some reason linter.py seems to be missing the .less file extension:
if I add it myself, stylelint seems to work as wanted on .less files too.