Home Download Buy Blog Forum Support

(V2 only) JavaScript Google Closure Linter Build

(V2 only) JavaScript Google Closure Linter Build

Postby jbrooksuk on Tue Feb 01, 2011 11:00 am

Hey all,

I use this build file to test my JavaScript code against Google Closure Linter standards :)
Code: Select all
{
   "cmd": ["gjslint", "$file"],
   "file_regex": "^Line ([0-9]*), E:([-0-9]*): (.*)",
   "selector": "source.js"
}

I'm going to change this in the future to also include Google Closure Compiler.

Cheers,
James

Updates
Added capture for negative error numbers. (First time I've had one)
Last edited by jbrooksuk on Tue Feb 01, 2011 1:46 pm, edited 2 times in total.
jbrooksuk
 
Posts: 782
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: JavaScript Google Closure Linter Build

Postby n00ge on Tue Feb 01, 2011 12:23 pm

Thanks. This will be handy.

I know this is for v2 but for any new people it might make sense to keep the version number in the post title to differentiate.
http://twitter.com/n00ge
Sublime Text 3 dev builds | OS X 10.8.2 & Ubuntu 13.04
n00ge
 
Posts: 140
Joined: Mon Oct 05, 2009 1:23 am

Re: JavaScript Google Closure Linter Build

Postby n00ge on Tue Feb 01, 2011 12:25 pm

Or even better. Maybe jon can setup a new topic under the forums for v2 plugins?
http://twitter.com/n00ge
Sublime Text 3 dev builds | OS X 10.8.2 & Ubuntu 13.04
n00ge
 
Posts: 140
Joined: Mon Oct 05, 2009 1:23 am

Re: JavaScript Google Closure Linter Build

Postby jbrooksuk on Tue Feb 01, 2011 1:06 pm

n00ge wrote:Thanks. This will be handy.

I know this is for v2 but for any new people it might make sense to keep the version number in the post title to differentiate.

Cheers n00ge :)

I changed the title by the way!
jbrooksuk
 
Posts: 782
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: (V2 only) JavaScript Google Closure Linter Build

Postby westy on Fri Mar 18, 2011 10:37 am

Updated this to match line numbers in the output, so can click on the errors.

Also using a patch that enables rules to be turned off, since I don't agree with line lengths of 80: http://codereview.appspot.com/4291044/

Code: Select all
{
   "cmd": ["C:\\Python27\\Scripts\\gjslint", "--ignore_errors", "110", "$file"],
   "file_regex": "FILE[ ]*:[ ]*(.*) ",
   "line_regex": "^Line ([0-9]*), E:.*",
   "selector": "source.js"
}


Works much better now I think.
Would be nice to run against a whole project and get the matching working but not sure if that's possible; this good enough for me for the moment.

Cheers,
Westy
westy
 
Posts: 6
Joined: Mon Feb 21, 2011 10:22 am

Re: (V2 only) JavaScript Google Closure Linter Build

Postby tobz.nz on Thu Aug 18, 2011 9:25 am

Here's a build script I made to run Google Closure to compress javascript files.

Create a new files in "packages/Google Closure/Google Closure.sublime-build"
Code: Select all
{
   "cmd": ["java", "-jar", "${packages}/Google Closure/compiler.jar", "--js", "$file", "--js_output_file", "${file_base_name}.min.${file_extension}"],
   "selector": "source.js"
}

then download the Google Closure binary from http://code.google.com/closure/compiler/ and unzip into the packages/Google Closure folder.
Restart SB2 and your done.

Running the build process will create a new file called your_file_name.min.js
tobz.nz
 
Posts: 3
Joined: Mon Jul 04, 2011 8:45 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 13 guests