Home Download Buy Blog Forum Support

SublimeLinter

Re: SublimeLinter

Postby aparajita on Sun Oct 02, 2011 4:49 am

shaun wrote:I love this... but I wish I could turn off the outlining. It's a bit too distracting as I'm typing.


There are two options:

1. Turn off background linting (see the README).
2. Wait for a new version where I will implement a minimum delay, which will allow you to tell the linter to run only after a certain number of idle seconds has passed.

Would also be nice to have an option where it ran a lint on every Save operation.


Good idea, I will add this as an option.
aparajita
 
Posts: 177
Joined: Sun Jul 24, 2011 10:42 pm

Re: SublimeLinter

Postby aparajita on Sun Oct 02, 2011 3:24 pm

I added a new "load-save" mode, see the README.
aparajita
 
Posts: 177
Joined: Sun Jul 24, 2011 10:42 pm

Re: SublimeLinter

Postby shaun on Wed Oct 05, 2011 4:31 pm

Perfect, thank you!
shaun
 
Posts: 7
Joined: Fri Sep 30, 2011 4:52 pm

Re: SublimeLinter

Postby xavi on Thu Oct 06, 2011 12:28 am

"load-save" mode is great!!! Thank you very much =)
xavi
 
Posts: 24
Joined: Sat Jul 30, 2011 12:00 am

Re: SublimeLinter

Postby ryjayta on Thu Dec 08, 2011 6:06 am

dlprice wrote:Very odd. I put:

Code: Select all
   
    "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.


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:

Code: Select all
    "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:

Code: Select all
{
    "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.
ryjayta
 
Posts: 1
Joined: Thu Dec 08, 2011 5:45 am

Re: SublimeLinter

Postby aparajita on Sat Dec 10, 2011 12:17 am

>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.
aparajita
 
Posts: 177
Joined: Sun Jul 24, 2011 10:42 pm

Re: SublimeLinter

Postby wi3dzmin on Wed Dec 21, 2011 11:20 am

Hello

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

Code: Select all
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 :/ I have no other plugins installed.
wi3dzmin
 
Posts: 2
Joined: Wed Dec 21, 2011 11:14 am

Re: SublimeLinter

Postby aparajita on Wed Dec 21, 2011 4:31 pm

You installed the latest node via the Windows installer?
aparajita
 
Posts: 177
Joined: Sun Jul 24, 2011 10:42 pm

Re: SublimeLinter

Postby wi3dzmin on Thu Dec 22, 2011 8:54 am

Yes, of course. And it is added to PATH. Editor configuration is default, not changed
wi3dzmin
 
Posts: 2
Joined: Wed Dec 21, 2011 11:14 am

Impled globals and globals in SublimeLinter / Javascript

Postby gabbon on Thu Dec 22, 2011 2:17 pm

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. :D
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
Code: Select all
{
   "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
gabbon
 
Posts: 1
Joined: Thu Dec 22, 2011 2:03 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 7 guests