SublimeLinter-contrib-stylelint icon indicating copy to clipboard operation
SublimeLinter-contrib-stylelint copied to clipboard

Lints vue files but doesn't report to sublime linter

Open scottsandersdev opened this issue 8 years ago • 9 comments

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?

scottsandersdev avatar Dec 05 '16 16:12 scottsandersdev

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

woble avatar Dec 28 '16 08:12 woble

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

dcc82 avatar Jan 04 '17 11:01 dcc82

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

woble avatar Jan 04 '17 15:01 woble

@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

scottsandersdev avatar Jan 04 '17 23:01 scottsandersdev

@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.

dcc82 avatar Jan 05 '17 00:01 dcc82

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.

woble avatar Jan 05 '17 07:01 woble

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!

dcc82 avatar Jan 05 '17 10:01 dcc82

@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

scottsandersdev avatar Jan 06 '17 16:01 scottsandersdev

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

niksy avatar Sep 01 '21 08:09 niksy