emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 169b1f4 028/271: Set JSLint options to not care.


From: Jackson Ray Hamilton
Subject: [elpa] master 169b1f4 028/271: Set JSLint options to not care.
Date: Thu, 05 Feb 2015 18:29:32 +0000

branch: master
commit 169b1f4503392904c96bdcb7845edda0a488288d
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Set JSLint options to not care.
---
 scripts/tokenizer.js |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/scripts/tokenizer.js b/scripts/tokenizer.js
index a95c3b2..4d6a913 100644
--- a/scripts/tokenizer.js
+++ b/scripts/tokenizer.js
@@ -3,6 +3,29 @@
 var JSLINT = require('./jslint'),
     util = require('util'),
 
+    // Use the most permissive set of options to increase the likelihood of a
+    // successful lint. Anything else should be a syntax error.
+    jslintOptions = {
+        ass: true,
+        bitwise: true,
+        continue: true,
+        eqeq: true,
+        evil: true,
+        forin: true,
+        maxerr: Infinity,
+        newcap: true,
+        nomen: true,
+        plusplus: true,
+        regexp: true,
+        unparam: true,
+        sloppy: true,
+        stupid: true,
+        sub: true,
+        todo: true,
+        vars: true,
+        white: true
+    },
+
     // Accumulated input.
     whole = '',
 
@@ -39,7 +62,7 @@ process.stdin.on('end', function () {
     var data, globals, totals, out, i, tokens, length, cap, token, origin, 
level, total;
 
     // Generate a syntax tree for the input.
-    JSLINT(whole);
+    JSLINT(whole, jslintOptions);
     data = JSLINT.data();
 
     globals = data.global;
@@ -69,7 +92,7 @@ process.stdin.on('end', function () {
         // Globality is not indicated by origin function.
         if (token.kind !== 'function' &&
                 (token.identifier &&
-                 globals.indexOf(token.string) > -1)) {
+                globals.indexOf(token.string) > -1)) {
             level = 0;
         } else {
             level = origin.function.level;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]