kungfusheep / SublimeLinter-contrib-stylelint

this repo is no longer maintained - please see https://github.com/SublimeLinter/SublimeLinter-stylelint
MIT License
116 stars 19 forks source link

ERROR: stylelint cannot locate 'stylelint' #47

Open kdmadej opened 7 years ago

kdmadej commented 7 years ago

If stylelint is installed as an implicit dependency via the yarn package manager the plugin fails with the following errors:

SublimeLinter: WARNING: stylelint deactivated, cannot locate local or global binary 
SublimeLinter: ERROR: stylelint cannot locate 'stylelint'

The reason is that when installed by yarn as an implicit dependency (I have a stylelint-webpack-plugin dependency in my package.json) a stylelint link is not added to the node_modules/.bin directory (doesn't happen if it's an explicit dep or when installed with npm).

From what I see in the changes introduced by the latest commit, the plugin no longer tries using the node_modules/stylelint/dist/cli.js (like the old wrapper used to do) but instead calls a stylelint command (disclaimer: I'm not too familiar with the mechanics of the NodeLinter class and this is just my assumption based on the code in linter.py), which obviously fails due to the lack of the symbolic link.

Is there any chance to add a fallback for using the cli.js in case of a missing stylelint executable?