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

Lints vue files but doesn't report to sublime linter #46

Open scottsandersdev opened 7 years ago

scottsandersdev commented 7 years ago

I have stylelint enabled on a vue js project, which combines the js, html, and css into one .vue file. If I run style lint from the command line (using the stylelint-processor-html processor) it will lint the files, but it isn't reporting them actively to sublimelinter, so I can't see anything in the gutter while working on my projects. Is there a setting anywhere to have these vue files reported to sublime linter?

woble commented 7 years ago

https://github.com/kungfusheep/SublimeLinter-contrib-stylelint/pull/49 makes it work so it seems.

dcc82 commented 7 years ago

The same issue happens to the "" tag in the HTML file. It just doesn't lint anything. Has anyone found a solution?

woble commented 7 years ago

@dcc82 See my previous reply. The changes to linter.py applied in that PR solve the linting problem in the buffer.

scottsandersdev commented 7 years ago

@woble I just tried this fix and it still isn't reporting the error.

Just to make the issue a little more clear, if I follow the steps in this thread to lint .vue files it WILL work - using stylelint from the command line (i.e. - npm run lint:vue-styles, which runs stylelint 'src/*/.vue' --syntax scss').

HOWEVER, if I want the errors reported back to sublime while typing in the editor, with the normal graphical feedback I see in normal css files, nothing happens.

So I know that stylelint is capable of linting the file, but this plugin isn't doing it's job of reporting the error live back to sublimelinter

dcc82 commented 7 years ago

@woble The fix doesn't seem to resolve the issue.

I'm having the same issue as @scottsandersdev described. It doesn't work for *.vue files and I thought it might be a configuration issue on my side. Then I was curious to see if it works for HTML files with "" tags embedded. Surprisingly, it doesn't work either.

However, if I run "stylelint xxx.vue or xxx.html" from the command line, it works.

woble commented 7 years ago

Can you see if it's outputting anything in SublimeLinter debug mode (Tools > SublimeLinter > Debug Mode)? If it's linting, it should return a JSON object.

dcc82 commented 7 years ago

I got it working. Just added 'html' to line23: syntax = ('css', 'css3' ...) in linter.py. It seemed that html wasn't included by default. It also fixed the issue with vue files. Cheers!

scottsandersdev commented 7 years ago

@dcc82 I have an interesting problem concerning your fix - for some reason, just putting html in there didn't work for me, putting in vue did get it to work, BUT only on top level vue files. Anything that's 2 folder levels deep isn't getting noticed. In my screen shot, only the top file (App.vue) is getting picked up. The file on the bottom isn't and it is 2 folders deeper past App.vue

@woble ya debug is on and no wasn't returning an object. It is now, but only on top level files. Eslint is successfully working on all files

s

niksy commented 3 years ago

This is still problem. Has anyone managed to fix this?