Eugene Shmorgun
Eugene Shmorgun

Reputation: 2075

Error with SublimeLinter in SublimeText 2

I'm trying to use SublimeLinter in SublimeText2. Packages is installed, node.exe too, the path to node.exe is correct:

{
    "sublimelinter_executable_map": {
        "javascript":"C:\\Program Files\\nodejs\\node.exe",
        "css":"C:\\Program Files\\nodejs\\node.exe"
    }
}

write simple code:

function foo(){
    x != hg
    а = р
    в  hghhgg
}

save and no linter messages! At the same time in console I see the error:

Traceback (most recent call last):
File ".\sublime_plugin.py", line 190, in on_post_save
File ".\sublime_plugin.py", line 154, in run_timed_function
File ".\sublime_plugin.py", line 189, in <lambda>
File ".\SublimeLinter.py", line 744, in on_post_save
File ".\SublimeLinter.py", line 611, in reload_view_module
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 9: ordinal not in range(128)

OS: Win7 32bit

Upvotes: 0

Views: 1729

Answers (2)

Joe Bergevin
Joe Bergevin

Reputation: 3268

Per the SublimeLinter Default Settings (prefs>pkg settings>sublimelinter>settings-default), the "sublimelinter_executable_map" value is only used for specifying the perl/php/ruby path. So using it for the js and css paths won't help, and may even break it.

Here is how I set up linting for JavaSript:

  • Install jslint using Package Control (see wbond.com)

    Follow all pre-req's and installation instructions found here.

  • In User - Settings for SublimeLinter: { "sublimelinter": true, "javascript_linter": "jslint" }
You can also use jshint instead, just a matter of preference.

Upvotes: 3

Hal
Hal

Reputation: 1009

The uppercase B on line 4 of the sample code is a Unicode character, not an ASCII character. SublimeLinter looks like it's expecting ASCII data, so the reader fails when it hits the Unicode byte.

If you put the character and a normal B side by side, you can easily see the difference:

в B

Upvotes: 2

Related Questions