2012-03-19 11 views
11

मैं वैश्विक कॉन्फ़िगरेशन को jshint कैसे पास करूं? मुझे दस्तावेज़ीकरण में जवाब नहीं मिला।मैं वैश्विक कॉन्फ़िगरेशन को jshint कैसे पास करूं?

मेरे कॉन्फ़िग फ़ाइल:

>type tests\jshint_options.js 
/*jshint globalstrict:true */ 

यह वही है मैं अब तक की कोशिश की है है:

>jshint myfile.js --config=tests\jshint_options.js 
myfile.js: line 1, col 1, Use the function form of "use strict". 
myfile.js: line 4, col 24, Unescaped '['. 
myfile.js: line 4, col 49, Unescaped '['. 

3 errors 

>jshint myfile.js --config tests\jshint_options.js 

node.js:201 
     throw e; // process.nextTick error, or 'error' event on first tick 
      ^
SyntaxError: Unexpected end of input 
    at Object.parse (native) 
    at _loadAndParseConfig (C:\Users\RONG\AppData\Roaming\npm\node_modules\jshint\lib\cli.js:28:18) 
    at Object.interpret (C:\Users\RONG\AppData\Roaming\npm\node_modules\jshint\lib\cli.js:114:22) 
    at Object.<anonymous> (C:\Users\RONG\AppData\Roaming\npm\node_modules\jshint\bin\hint:2:25) 
    at Module._compile (module.js:441:26) 
    at Object..js (module.js:459:10) 
    at Module.load (module.js:348:31) 
    at Function._load (module.js:308:12) 
    at Array.0 (module.js:479:10) 
    at EventEmitter._tickCallback (node.js:192:40) 

> 
+0

एफवाईआई ने इसे दस्तावेज करने के लिए एक मुद्दा खोला: https://github.com/jshint/jshint/issues/483 – ripper234

उत्तर

10

ज्यादा खुदाई के बाद, मैं इस helpful blog post कि reveled मिला ...

कि कॉन्फ़िगरेशन फ़ाइल JSON प्रारूप में है, जावास्क्रिप्ट टिप्पणियां नहीं!

{ 
    "supernew": true 
} 

पीएस

यह वास्तव में nodejs-jshint documentations में प्रलेखित है! यकीन नहीं है कि मुझे पहले क्यों नहीं मिला है।

संबंधित मुद्दे