Sublime Forum

SublimeLinter

#12

I added a new ā€œload-saveā€ mode, see the README.

0 Likes

#13

Perfect, thank you!

0 Likes

#14

ā€œload-saveā€ mode is great!!! Thank you very much =)

0 Likes

#15

[quote=ā€œdlpriceā€]Very odd. I put:

    "sublimelinter_executable_map":
    {
        "php": "C:/xampp/php/php"
    }

into every occurrence of Base File.sublime-settings I could find (default, user, and the one in sublimelinter). Figured this would help me determine which Base File it was expecting to find it in. I put a ā€œprint mapā€ statement in the module_utils.py to see what was happening and to make sure it wasnā€™t just me putting in an invalid path, and, unfortunately, it consistently shows ā€œNoneā€.

My original thought was it was something screwy about using ā€œBase Fileā€ in the sublimelinter folder, since changing the name of the file from ā€œBase File.sublime-settingsā€ to ā€œSublimeLinter.sublime-settingsā€, and then adjusting the module_utils.py file to reflect the same resolved the issue. But with you being able to get work makes things just that much more confusing. Thanks for checking.[/quote]

Iā€™ve tested this on windows and it does require some workaround. I finally got it working by editing both ā€œPackages\SublimeLinter\Base File.sublime-settingsā€ and ā€œPackages\User\Base File.sublime-settingsā€ā€¦

With Packages\SublimeLinter\Base File.sublime-settings you must edit the portion where it says ā€œsublimelinter_executable_mapā€ by adding the necessary path. In my case where I have my php executable using XAMPP installation on D:/DEVIGN/xampp/php/php.exe I used:

    "sublimelinter_executable_map":
    {
        "php": "d:/devign/xampp/php/php"
    },

With Packages\User\Base File.sublime-settings you must insert the whole script (as seen above). On my case where I inserted it after my colors scheme setting it looks like this:

{
    "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",

    "sublimelinter_executable_map":
    {
        "php": "d:/devign/xampp/php/php"
    }
}

note: to avoid errors add a comma after the previous setting line before adding the script, and then make sure there is no comma between the last inserted setting script and the closing curly brace.

0 Likes

#16

Iā€™ve tested this on windows and it does require some workaround. I finally got it working by editing both ā€œPackages\SublimeLinter\Base File.sublime-settingsā€ and ā€œPackages\User\Base File.sublime-settingsā€ā€¦

I can guarantee if you provide the correct path and donā€™t have any missing/extra commas in Packages\User\Base File.sublime-settings it will work correctly without modifying the default.

0 Likes

#17

Hello

I cant get my SublimeLinter plugin to work :confused: This is what i get in my console when i save javascript file. Iā€™ve installed node.js. Iā€™m using Windows 7

Writing file /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings with encoding UTF-8 reloading /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings Unable to open /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/User/JSON.sublime-settings Writing file /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings with encoding UTF-8 reloading /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings Traceback (most recent call last): File ".\SublimeLinter.py", line 259, in _callback File ".\SublimeLinter.py", line 242, in _update_view File ".\SublimeLinter.py", line 72, in background_run File ".\SublimeLinter.py", line 87, in run_once File ".\sublimelinter\modules\base_linter.py", line 270, in run File ".\sublimelinter\modules\javascript.py", line 53, in parse_errors File ".\json\__init__.py", line 307, in loads File ".\json\decoder.py", line 319, in decode File ".\json\decoder.py", line 338, in raw_decode ValueError: No JSON object could be decoded Writing file /C/Users/Sosnowsd/Work/patient-registry/lib/admin/client/tpl/doctor.tpl.js with encoding UTF-8 Traceback (most recent call last): File ".\sublime_plugin.py", line 139, in on_post_save File ".\SublimeLinter.py", line 520, in on_post_save File ".\SublimeLinter.py", line 72, in background_run File ".\SublimeLinter.py", line 87, in run_once File ".\sublimelinter\modules\base_linter.py", line 270, in run File ".\sublimelinter\modules\javascript.py", line 53, in parse_errors File ".\json\__init__.py", line 307, in loads File ".\json\decoder.py", line 319, in decode File ".\json\decoder.py", line 338, in raw_decode ValueError: No JSON object could be decoded

What is more strange, is that on the other machine, itā€™s working :confused: I have no other plugins installed.

0 Likes

#18

You installed the latest node via the Windows installer?

0 Likes

#19

Yes, of course. And it is added to PATH. Editor configuration is default, not changed

0 Likes

#20

I love the idea of a built in linter in Sublime but have run into a bit of a problem.
Iā€™ve been sniffing around in the source code and googled for a half day but canā€™t find anything anywhere, which makes me think that it might be impossible today. Could also be my google-fu that is weak so close to the holiday. :smiley:
Is there a way to configure a project so SublimeLinter understands that some javascript variables are global and should not be errors in such a way that is implied on JSHint.com,

var result = JSHINT(source, options, globals);
/*global DISQUS:true, jQuery:false */

Is there a setting which takes care of this? Example below.
example.sublime-project

{ "settings": { "SublimeLinter": { "jshint_options": { // enforcing "eqeqeq": true, "immed": true, "trailing": true, "strict": true, // relaxing "evil": true, "es5": true, "regexdash": true, "sub": true, // environment "browser": true, "devel": true, "wsh": false }, // global "jshint_global": { "sp": true, "exports": true } } } }

Cheers,
gabbon

0 Likes

#21

Currently there is no facility to specify globals via the settings. If wouldnā€™t be hard to implement, add a ticket to the issue tracker on github. You can put the declaration directly in your source code at the top:

/*global DISQUS:true, jQuery:false */
0 Likes

#22

How to force run linter in ruby without warnings check? Like ā€œruby -cā€.

0 Likes

#23

Look for ā€œlint_argsā€ in the README.

0 Likes

#24

One of the options, ā€œpredefā€, can be an array of names, which will be used to declare global variables, or an object whose keys are used as global names, with a boolean value that determines if they are assignable.

0 Likes

#25

The trick is that you need to provide the path of your php install to both the sublimelinter_executable_map and the sublimelinter_syntax_map (notice one is executable and the other is syntax). So in my case Iā€™ve got it installed in my xammp directory on a windoz 7 64 box. So leave the default settings folder alone and add the following to your preferences > file settings > user

"sublimelinter_executable_map": { "php": "c:/xampp/php/php" }, "sublimelinter_syntax_map": { "php": "c:/xampp/php/php" }
Put a comma in before the last entry and make sure the whole thing is in curly braces. You need both of these rules for it to work.

[quote=ā€œaparajitaā€]>Iā€™ve tested this on windows and it does require some workaround. I finally got it working by editing both ā€œPackages\SublimeLinter\Base File.sublime-settingsā€ and ā€œPackages\User\Base File.sublime-settingsā€ā€¦

I can guarantee if you provide the correct path and donā€™t have any missing/extra commas in Packages\User\Base File.sublime-settings it will work correctly without modifying the default.[/quote]

0 Likes

#26

sublimelinter_syntax_map has nothing to do with the executable. It is mapping to a .tmLanguage file, which is not in the php binary distribution, but in the ST2 Packages directory. So I canā€™t see how that has anything to do with it working or now working, especially since you are providing a path to your php install.

0 Likes

#27

ctrl+alt+e and ctrl+alt+shift+e seem to be broken, Iā€™ve tried adding the bindings to my user settings and still it doesnā€™t work.

0 Likes

#28

Please folks, always give your full configuration information (platform, versions, etc) and sample files when reporting something.

0 Likes

#29

Windows 7
Dev build 2156
Package List

  • Bracket Highlighter

  • Djaneiro

  • HMTL5

  • Jinja2

  • jQuery Snippets Pack

  • nginx

  • Nodejs

  • Package Control

  • Placeholders

  • Prefixr

  • SideBarEnhancements

  • Sublime Tweet

  • SublimeCodeIntel

  • SublimeLinter

  • SublimePaster

  • SublimeWebColors

  • Tag

  • Theme - Soda

  • Wordpress

  • Zen Coding

Aside from that itā€™s stock with the exception of opening/closing the sidebar being bound to ctrl+5, I havenā€™t changed any settings across any of these plugins or the preinstalled ones.

0 Likes

#30

[quote=ā€œwilly1234x1ā€]
Package List

  • Bracket Highlighter

  • Djaneiro

  • HMTL5

  • Jinja2

  • jQuery Snippets Pack

  • nginx

  • Nodejs

  • Package Control

  • Placeholders

  • Prefixr

  • SideBarEnhancements

  • Sublime Tweet

  • SublimeCodeIntel

  • SublimeLinter

  • SublimePaster

  • SublimeWebColors

  • Tag

  • Theme - Soda

  • Wordpress

  • Zen Coding

Aside from that itā€™s stock[/quote]

Yes, aside from that page long list of plugins, itā€™s stock. :laughing:

Anyway, I am seeing major weirdness with SublimeLinter on Windows in the latest build of ST2. I am not seeing the same symptoms on other platforms, so it seems to be a Windows-only issue. Iā€™ll look into it some more.

0 Likes

#31

You still didnā€™t give me any sample files. There are 8 different linters, it would help if I knew under what circumstances next/previous error is not working.

0 Likes