github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2,153
    • 199
  • Source
  • Commits
  • Network (199)
  • Graphs
  • Tree: 950b5d6

click here to add a description

click here to add a homepage

  • Switch Branches (3)
    • master
    • mobile
    • omgrequire
  • Switch Tags (41)
    • 1.4rc1
    • 1.4a2
    • 1.4a1
    • 1.4.2
    • 1.4.1
    • 1.4
    • 1.3rc1
    • 1.3b2
    • 1.3b1
    • 1.3.2
    • 1.3.1rc1
    • 1.3.1
    • 1.3
    • 1.2.6
    • 1.2.5
    • 1.2.4b
    • 1.2.4a
    • 1.2.4
    • 1.2.3b
    • 1.2.3a
    • 1.2.3
    • 1.2.2b2
    • 1.2.2b
    • 1.2.2
    • 1.2.1
    • 1.2
    • 1.1b
    • 1.1a
    • 1.1.4
    • 1.1.3a
    • 1.1.3.1
    • 1.1.3
    • 1.1.2
    • 1.1.1
    • 1.1
    • 1.0a
    • 1.0.4
    • 1.0.3
    • 1.0.2
    • 1.0.1
    • 1.0
  • Comments
Sending Request…

jQuery JavaScript Library — Read more

  Cancel

http://jquery.com/

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added in integrated JSLint checking against the jQuery source. Just run 
'make lint' to see the result.
jeresig (author)
Mon Mar 01 18:51:44 -0800 2010
commit  950b5d64a27994db1697eb4e605f5ea48ad8021b
tree    3c436dffcca5714af3194d278a3f61cb485f6801
parent  dcf0fa5048ef2379d551f29ffa29b14ec5ee09d5
M Makefile 11 ••••
M README.md 4 ••••
A build/js.jar 0
A build/jslint-check.js 36 •••••
A build/jslint.js 5,500 •••••
Txt Makefile
  • View file @ 950b5d6
... ...
@@ -29,11 +29,12 @@ JQ_MIN = ${DIST_DIR}/jquery.min.js
29 29
 JQ_VER = `cat version.txt`
30 30
 VER = sed s/@VERSION/${JQ_VER}/
31 31
 
  32
+RHINO = java -jar ${BUILD_DIR}/js.jar
32 33
 MINJAR = java -jar ${BUILD_DIR}/google-compiler-20091218.jar
33 34
 
34 35
 DATE=`git log -1 | grep Date: | sed 's/[^:]*: *//'`
35 36
 
36  
-all: jquery min
  37
+all: jquery lint min
37 38
   @@echo "jQuery build complete."
38 39
 
39 40
 ${DIST_DIR}:
... ...
@@ -49,7 +50,7 @@ init:
49 50
 jquery: ${DIST_DIR} selector ${JQ}
50 51
 jq: ${DIST_DIR} ${JQ}
51 52
 
52  
-${JQ}: ${MODULES}
  53
+${JQ}: selector ${MODULES}
53 54
   @@echo "Building" ${JQ}
54 55
 
55 56
   @@mkdir -p ${DIST_DIR}
... ...
@@ -58,10 +59,14 @@ ${JQ}: ${MODULES}
58 59
     sed 's/Date:./&'"${DATE}"'/' | \
59 60
     ${VER} > ${JQ};
60 61
 
61  
-selector: init
  62
+selector: ${DIST_DIR} init
62 63
   @@echo "Building selector code from Sizzle"
63 64
   @@sed '/EXPOSE/r src/sizzle-jquery.js' src/sizzle/sizzle.js > src/selector.js
64 65
 
  66
+lint: ${JQ}
  67
+  @@echo "Checking jQuery against JSLint..."
  68
+  @@${RHINO} build/jslint-check.js
  69
+
65 70
 min: ${JQ_MIN}
66 71
 
67 72
 ${JQ_MIN}: ${JQ}
Txt README.md
  • View file @ 950b5d6
... ...
@@ -36,6 +36,10 @@ Makes: ./dist/jquery.js
36 36
 A compressed version of jQuery (made the Closure Compiler).  
37 37
 Makes: ./dist/jquery.min.js
38 38
 
  39
+`make lint`
  40
+
  41
+Tests a build of jQuery against JSLint, looking for potential errors or bits of confusing code.
  42
+
39 43
 `make selector`
40 44
 
41 45
 Builds the selector library for jQuery from Sizzle.  
Txt build/js.jar
  • View file @ 950b5d6
Binary file not shown
Txt build/jslint-check.js
  • View file @ 950b5d6
... ...
@@ -0,0 +1,36 @@
  1
+load("build/jslint.js");
  2
+
  3
+var src = readFile("dist/jquery.js");
  4
+
  5
+JSLINT(src, { evil: true, forin: true });
  6
+
  7
+// All of the following are known issues that we think are 'ok'
  8
+// (in contradiction with JSLint) more information here:
  9
+// http://docs.jquery.com/JQuery_Core_Style_Guidelines
  10
+var ok = {
  11
+  "Expected an identifier and instead saw 'undefined' (a reserved word).": true,
  12
+  "Use '===' to compare with 'null'.": true,
  13
+  "Use '!==' to compare with 'null'.": true,
  14
+  "Expected an assignment or function call and instead saw an expression.": true,
  15
+  "Expected a 'break' statement before 'case'.": true
  16
+
  17
+};
  18
+
  19
+var e = JSLINT.errors, found = 0, w;
  20
+
  21
+for ( var i = 0; i < e.length; i++ ) {
  22
+  w = e[i];
  23
+
  24
+  if ( !ok[ w.reason ] ) {
  25
+    found++;
  26
+    print( "\n" + w.evidence + "\n" );
  27
+    print( "    Problem at line " + w.line + " character " + w.character + ": " + w.reason );
  28
+  }
  29
+}
  30
+
  31
+if ( found > 0 ) {
  32
+  print( "\n" + found + " Error(s) found." );
  33
+
  34
+} else {
  35
+  print( "JSLint check passed." );
  36
+}
Txt build/jslint.js
  • View file @ 950b5d6
5500 additions, 0 deletions not shown

0 notes on commit 950b5d6

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server