最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Google Closure Linter not working in Sublime Text 2 for Windows - Stack Overflow

programmeradmin0浏览0评论

Has anyone gotten the Google Closure Linter (gjslint) to work with Sublime Text 2 for Windows?

When I run it I get the following (via Tools menu or CTRL+SHIFT+J):

The filename, directory name, or volume label syntax is incorrect.

closure linter: ignored 0 errors.

My steps were as follows:

  • Installed Python 2.7
  • Installed Setup Tools for Easy Install
  • Installed the Closure Linter
  • Installed the ST2 Plugin

Out of the box, none of the features worked. However if I hard-code the path in the Default Settings I can get the fixjsstyle plugin to work:

{
    // Path to the gjslint.
    "gjslint_path": "/python27/scripts/gjslint",

    // Path to the fixjsstyle.
    "fixjsstyle_path": "/python27/scripts/fixjsstyle"
}

Can confirm they both exist:

C:\>dir c:\python27\scripts
 Volume in drive C is OSDisk
 Volume Serial Number is 36E3-7433

 Directory of c:\python27\scripts

...
06/29/2012  09:48 AM               304 fixjsstyle-script.py
06/29/2012  09:48 AM             7,168 fixjsstyle.exe
06/29/2012  09:48 AM               525 fixjsstyle.exe.manifest
06/29/2012  09:48 AM               298 gjslint-script.py
06/29/2012  09:48 AM             7,168 gjslint.exe
06/29/2012  09:48 AM               522 gjslint.exe.manifest
              17 File(s)         34,580 bytes
               2 Dir(s)  186,377,805,824 bytes free

It certainly sounds like a reference problem, I even tried copying the executables to the plugin directory, that didn't work either.

Edit: I should add that I did turn on the debug: true flag and nothing came up.

Has anyone gotten the Google Closure Linter (gjslint) to work with Sublime Text 2 for Windows?

When I run it I get the following (via Tools menu or CTRL+SHIFT+J):

The filename, directory name, or volume label syntax is incorrect.

closure linter: ignored 0 errors.

My steps were as follows:

  • Installed Python 2.7
  • Installed Setup Tools for Easy Install
  • Installed the Closure Linter
  • Installed the ST2 Plugin

Out of the box, none of the features worked. However if I hard-code the path in the Default Settings I can get the fixjsstyle plugin to work:

{
    // Path to the gjslint.
    "gjslint_path": "/python27/scripts/gjslint",

    // Path to the fixjsstyle.
    "fixjsstyle_path": "/python27/scripts/fixjsstyle"
}

Can confirm they both exist:

C:\>dir c:\python27\scripts
 Volume in drive C is OSDisk
 Volume Serial Number is 36E3-7433

 Directory of c:\python27\scripts

...
06/29/2012  09:48 AM               304 fixjsstyle-script.py
06/29/2012  09:48 AM             7,168 fixjsstyle.exe
06/29/2012  09:48 AM               525 fixjsstyle.exe.manifest
06/29/2012  09:48 AM               298 gjslint-script.py
06/29/2012  09:48 AM             7,168 gjslint.exe
06/29/2012  09:48 AM               522 gjslint.exe.manifest
              17 File(s)         34,580 bytes
               2 Dir(s)  186,377,805,824 bytes free

It certainly sounds like a reference problem, I even tried copying the executables to the plugin directory, that didn't work either.

Edit: I should add that I did turn on the debug: true flag and nothing came up.

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Jun 29, 2012 at 15:23 TerryTerry 14.2k9 gold badges57 silver badges84 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

I had the same issue on Windows 7. The only way i found to fix it was to remove the double quotes around the gjslint call

line 34 of gjslint.py inside the sublime package

original (not working):

cmd = '"' + s.get('gjslint_path', 'jslint') + '" ' + s.get('gjslint_flags', '') + ' "' + file_path + '"'

working :

cmd = '' + s.get('gjslint_path', 'jslint') + ' ' + s.get('gjslint_flags', '') + ' "' + file_path + '"'

Please make sure your gjslint path has not any spaces to make this work as it's the case for you.

If somebody has another solution, please share.

发布评论

评论列表(0)

  1. 暂无评论