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

Inherit from NodeLinter ? #18

Closed danielkcz closed 8 years ago

danielkcz commented 8 years ago

I am not an expert at this, but apparently this gives ability to use local installation of stylelint instead of relying on global ones. Shouldn't be that hard

kungfusheep commented 8 years ago

Hi - are you having an issue with using a stylelint local install? This is functionality the plugin has had from day 1, so I don't see any changes necessary in this area unless I'm missing something.

danielkcz commented 8 years ago

Hey, yes it's not working for me, mostly failing on that it cannot find 'postcss' module. I did some investigation in the stylelint_wrapper.js and apparently it doesn't receive --config in args thus it doesn't resolve cliLocation variable and goes to postcss solution. I am not sure where it tries to find that postcss module, but I have it installed in project and I tried global too.

Anyway I believe there is much more simple solution, I've sent PR #19 for that.

kungfusheep commented 8 years ago

Do you have a .stylelintrc file in your project directory? I'd expect that to be passed as the --config argument, which it then uses to help it find the correct node_modules folder.

On Wed, 9 Mar 2016 at 15:03, Daniel K. notifications@github.com wrote:

Hey, yes it's not working for me, mostly failing on that it cannot find 'postcss' module. I did some investigation in the stylelint_wrapper.js and apparently it doesn't receive --config in args thus it doesn't resolve cliLocation variable and goes to postcss solution. I am not sure where it tries to find that postcss module, but I have it installed in project and I tried global too.

Anyway I believe there is much more simple solution, I've sent PR #19 https://github.com/kungfusheep/SublimeLinter-contrib-stylelint/pull/19 for that.

— Reply to this email directly or view it on GitHub https://github.com/kungfusheep/SublimeLinter-contrib-stylelint/issues/18#issuecomment-194335135 .

danielkcz commented 8 years ago

Well I use .stylelintrc.yaml as that's supported by stylelint itself. That's probably for another issue, but it's not this case as I tried to modify linter.py to have this config_file = ('--config', '.stylelintrc.yaml', '~') but result was the same.

danielkcz commented 8 years ago

@kungfusheep So what do you think about it? Have you tried my PR with NodeLinter? I am using it and works quite well so far. I believe it's even faster as it doesn't need to execute Node wrapping process which executes linter.

kungfusheep commented 8 years ago

closing as per my comment on #19

insin commented 8 years ago

If NodeLinter isn't going to be used, could the wrapper script fall back to emulating NodeLinter's behaviour of searching for a node_modules/.bin/${linter} script and running that if a local version of stylelint can't be found in node_modules/?

This allows you to move all your linting config, dependencies and plugins into a single module which provides a bin script to proxy lint calls to the real linter - I make use of this for SublimeLinter-eslint (which uses NodeLinter) in this module and would like to do the same with whatever stylelint config I create (just discovered it!).

danielkcz commented 8 years ago

Yea, @kungfusheep obviously don't want to do any changes, but I don't care. I have my modifications to use NodeLinter and I am happy with it. Only hassle is when I need to reinstall sublime or something to apply that change again manually.