Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

option.todo

  • Loading branch information...
commit 49284afd8869b29bfbabaac079aba4de418e125a 1 parent d3dcb36
Douglas Crockford authored July 11, 2012
33  jslint.html
@@ -231,18 +231,6 @@
231 231
         Directive</h1><textarea rows="8" readonly=true ></textarea>
232 232
     </fieldset>
233 233
     <fieldset id=JSLINT_OPTIONS><button>clear options</button><h1>Options</h1>
234  
-        <div class=tristate>Assume...
235  
-          <div title=browser><button></button><var></var> a browser</div>
236  
-          <div title=devel><button></button><var></var> console,alert,&nbsp;...</div>
237  
-          <div title=node><button></button><var></var> <a href="http://nodejs.org/">Node.js</a></div>
238  
-          <div title=rhino><button></button><var></var> <a href="http://www.mozilla.org/rhino/">Rhino</a></div>
239  
-          <div title=windows><button></button><var></var> Windows</div>
240  
-          <br>
241  
-          <div title=passfail><button></button><var></var> Stop on first error</div>
242  
-          <br>
243  
-          <div title=safe><button></button><var></var> Safe Subset</div>
244  
-          <div title=adsafe><button></button><var></var> Verify&nbsp;<a href="http://www.ADsafe.org">ADsafe</a></div>
245  
-        </div>
246 234
         <div class=tristate>Tolerate...
247 235
           <div title=bitwise><button></button><var></var> bitwise operators</div>
248 236
           <div title=continue><button></button><var></var> continue </div>
@@ -252,22 +240,39 @@
252 240
           <div title=evil><button></button><var></var> eval </div>
253 241
           <div title=forin><button></button><var></var> <a href="http://yuiblog.com/blog/2006/09/26/for-in-intrigue/">unfiltered</a> for  in </div>
254 242
           <div title=newcap><button></button><var></var> uncapitalized constructors</div>
  243
+        </div>
  244
+        <div class=tristate>Tolerate...
255 245
           <div title=nomen><button></button><var></var> dangling _ in identifiers</div>
256 246
           <div title=plusplus><button></button><var></var> ++&nbsp;and&nbsp;-- </div>
257 247
           <div title=regexp><button></button><var></var> .&nbsp;and&nbsp;[^ ... ]&nbsp;in&nbsp;/RegExp/</div>
258  
-        </div>
259  
-        <div class=tristate>Tolerate...
260 248
           <div title=undef><button></button><var></var> misordered definitions</div>
261 249
           <div title=unparam><button></button><var></var> unused parameters</div>
262 250
           <div title=sloppy><button></button><var></var> missing&nbsp;'use strict'&nbsp;pragma</div>
263 251
           <div title=stupid><button></button><var></var> stupidity</div>
264 252
           <div title=sub><button></button><var></var> inefficient subscripting</div>
  253
+        </div>
  254
+        <div class=tristate>Tolerate...
  255
+          <div title=todo><button></button><var></var> TODO comments</div>
265 256
           <div title=vars><button></button><var></var> many var statements per function</div>
266 257
           <div title=white><button></button><var></var> messy white space</div>
267 258
           <div title=css><button></button><var></var> CSS workarounds</div>
268 259
           <div title=cap><button></button><var></var> HTML case</div>
269 260
           <div title=on><button></button><var></var> HTML event handlers</div>
270 261
           <div title=fragment><button></button><var></var> HTML fragments</div>
  262
+          <div>&nbsp;</div>
  263
+          <div>&nbsp;</div>
  264
+        </div>
  265
+        <div class=tristate>Assume...
  266
+          <div title=browser><button></button><var></var> a browser</div>
  267
+          <div title=devel><button></button><var></var> console,alert,&nbsp;...</div>
  268
+          <div title=node><button></button><var></var> <a href="http://nodejs.org/">Node.js</a></div>
  269
+          <div title=rhino><button></button><var></var> <a href="http://www.mozilla.org/rhino/">Rhino</a></div>
  270
+          <div title=windows><button></button><var></var> Windows</div>
  271
+          <br>
  272
+          <div title=passfail><button></button><var></var> Stop on first error</div>
  273
+          <br>
  274
+          <div title=safe><button></button><var></var> Safe Subset</div>
  275
+          <div title=adsafe><button></button><var></var> Verify&nbsp;<a href="http://www.ADsafe.org">ADsafe</a></div>
271 276
         </div>
272 277
         <div>
273 278
             <input id=JSLINT_INDENT type=text title=indent value="" autocomplete=off>
41  jslint.js
... ...
@@ -1,5 +1,5 @@
1 1
 // jslint.js
2  
-// 2012-05-09
  2
+// 2012-07-10
3 3
 
4 4
 // Copyright (c) 2002 Douglas Crockford  (www.JSLint.com)
5 5
 
@@ -292,19 +292,19 @@
292 292
     style, styleproperty, sub, subscript, substr, sup, supplant, sync_a, t,
293 293
     table, 'table-layout', tag_a_in_b, tbody, td, test, 'text-align',
294 294
     'text-decoration', 'text-indent', 'text-shadow', 'text-transform', textarea,
295  
-    tfoot, th, thead, third, thru, time, title, toLowerCase, toString,
296  
-    toUpperCase, token, too_long, too_many, top, tr, trailing_decimal_a, tree,
297  
-    tt, tty, tv, type, u, ul, unclosed, unclosed_comment, unclosed_regexp, undef,
298  
-    undefined, unescaped_a, unexpected_a, unexpected_char_a_b,
299  
-    unexpected_comment, unexpected_else, unexpected_label_a,
300  
-    unexpected_property_a, unexpected_space_a_b, 'unicode-bidi',
301  
-    unnecessary_initialize, unnecessary_use, unparam, unreachable_a_b,
302  
-    unrecognized_style_attribute_a, unrecognized_tag_a, unsafe, unused, url,
303  
-    urls, use_array, use_braces, use_charAt, use_object, use_or, use_param,
304  
-    used_before_a, var, var_a_not, vars, 'vertical-align', video, visibility,
305  
-    was, weird_assignment, weird_condition, weird_new, weird_program,
306  
-    weird_relation, weird_ternary, white, 'white-space', width, windows,
307  
-    'word-spacing', 'word-wrap', wrap, wrap_immediate, wrap_regexp,
  295
+    tfoot, th, thead, third, thru, time, title, todo, todo_comment, toLowerCase,
  296
+    toString, toUpperCase, token, too_long, too_many, top, tr,
  297
+    trailing_decimal_a, tree, tt, tty, tv, type, u, ul, unclosed,
  298
+    unclosed_comment, unclosed_regexp, undef, undefined, unescaped_a,
  299
+    unexpected_a, unexpected_char_a_b, unexpected_comment, unexpected_else,
  300
+    unexpected_label_a, unexpected_property_a, unexpected_space_a_b,
  301
+    'unicode-bidi', unnecessary_initialize, unnecessary_use, unparam,
  302
+    unreachable_a_b, unrecognized_style_attribute_a, unrecognized_tag_a, unsafe,
  303
+    unused, url, urls, use_array, use_braces, use_charAt, use_object, use_or,
  304
+    use_param, used_before_a, var, var_a_not, vars, 'vertical-align', video,
  305
+    visibility, was, weird_assignment, weird_condition, weird_new,
  306
+    weird_program, weird_relation, weird_ternary, white, 'white-space', width,
  307
+    windows, 'word-spacing', 'word-wrap', wrap, wrap_immediate, wrap_regexp,
308 308
     write_is_wrong, writeable, 'z-index'
309 309
 */
310 310
 
@@ -516,12 +516,12 @@ var JSLINT = (function () {
516 516
             expected_type_a: "Expected a type, and instead saw {a}.",
517 517
             for_if: "The body of a for in should be wrapped in an if " +
518 518
                 "statement to filter unwanted properties from the prototype.",
519  
-            function_block: "Function statements should not be placed in blocks. " +
  519
+            function_block: "Function statements should not be placed in blocks." +
520 520
                 "Use a function expression or move the statement to the top of " +
521 521
                 "the outer function.",
522 522
             function_eval: "The Function constructor is eval.",
523 523
             function_loop: "Don't make functions within a loop.",
524  
-            function_statement: "Function statements are not invocable. " +
  524
+            function_statement: "Function statements are not invocable." +
525 525
                 "Wrap the whole function invocation in parens.",
526 526
             function_strict: "Use the function form of 'use strict'.",
527 527
             html_confusion_a: "HTML confusion in regular expression '<{a}'.",
@@ -566,12 +566,13 @@ var JSLINT = (function () {
566 566
             scanned_a_b: "{a} ({b}% scanned).",
567 567
             slash_equal: "A regular expression literal can be confused with '/='.",
568 568
             statement_block: "Expected to see a statement and instead saw a block.",
569  
-            stopping: "Stopping. ",
  569
+            stopping: "Stopping.",
570 570
             strange_loop: "Strange loop.",
571 571
             strict: "Strict violation.",
572 572
             subscript: "['{a}'] is better written in dot notation.",
573 573
             sync_a: "Unexpected sync method: '{a}'.",
574 574
             tag_a_in_b: "A '<{a}>' must be within '<{b}>'.",
  575
+            todo_comment: "Unexpected TODO comment.",
575 576
             too_long: "Line too long.",
576 577
             too_many: "Too many errors.",
577 578
             trailing_decimal_a: "A trailing decimal point can be confused " +
@@ -939,6 +940,8 @@ var JSLINT = (function () {
939 940
 // style
940 941
         sx = /^\s*([{}:#%.=,>+\[\]@()"';]|[*$\^~]=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/,
941 942
         ssx = /^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/,
  943
+// comment todo
  944
+        tox = /^\s*to\s*do/i,
942 945
 // token
943 946
         tx = /^\s*([(){}\[\]\?.,:;'"~#@`]|={1,3}|\/(\*(jslint|properties|property|members?|globals?)?|=|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|[\^%]=?|&[&=]?|\|[|=]?|>{1,3}=?|<(?:[\/=!]|\!(\[|--)?|<=?)?|\!={0,2}|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+(?:[xX][0-9a-fA-F]+|\.[0-9]*)?(?:[eE][+\-]?[0-9]+)?)/,
944 947
 // url badness
@@ -1410,6 +1413,8 @@ var JSLINT = (function () {
1410 1413
                 warn_at('unexpected_a', line, character, '<\/');
1411 1414
             } else if (option.safe && ax.test(snippet)) {
1412 1415
                 warn_at('dangerous_comment', line, character);
  1416
+            } else if (!option.todo && tox.test(snippet)) {
  1417
+                warn_at('todo_comment', line, character);
1413 1418
             }
1414 1419
         }
1415 1420
 
@@ -6394,7 +6399,7 @@ klass:              do {
6394 6399
 
6395 6400
     itself.jslint = itself;
6396 6401
 
6397  
-    itself.edition = '2012-05-09';
  6402
+    itself.edition = '2012-07-10';
6398 6403
 
6399 6404
     return itself;
6400 6405
 }());
6  lint.html
@@ -692,6 +692,12 @@ <h1 id=options>Options</h1>
692 692
       better expressed in dot notation.</td>
693 693
   </tr>
694 694
   <tr>
  695
+    <td>Tolerate TODO comments<br>
  696
+    </td>
  697
+    <td><code>todo</code></td>
  698
+    <td><code>true</code> if comments starting with <code>TODO</code> should be allowed.</td>
  699
+  </tr>
  700
+  <tr>
695 701
     <td> Tolerate misordered definitions </td>
696 702
     <td><code>undef</code></td>
697 703
     <td><code>true</code> if variables and functions need not be declared before used.</td>

1 note on commit 49284af

Hans Walfisch

+1 for the TODO option

Please sign in to comment.
Something went wrong with that request. Please try again.