Reputation: 1106
I have installed Sublimelinter through this site: SublimeLinter 3. I'm on a debian machine.
I basically have installed the following plugins: SublimeLinter 3, SublimeLinter-html-tidy, SublimeLinter-csslint, SublimeLinter-jshint and SublimeLinter-php. Everything works fine if I'm writing only PHP or only JavaScript on a file. But when I develop JavaScript that has some PHP code in it, I get some errors on the lines that has the PHP code.
Is this supposed to happen? Is there a way where the SublimeLinter detects what is JavaScript and what is PHP in the same file? So that it doesn't show the PHP linter errors if the sublime text syntax is set to JavaScript.
Here is a screenshot of my Sublime Text:
Upvotes: 3
Views: 458
Reputation: 246
I think that's possible if you use a linter that has more than one "selector": then it can lint embedded languages (see the Sublime Linter documentation). But that should probably happen automatically wherever possible.
Have you identified which linter the undesirable errors come from? If your file is a php file, then the php linter may be the culprit, if it can only understand php code and thus misinterprets the Javascript code. I think what you want is only possible if the php linter is programmed to do so.
Upvotes: 1