<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>piouPiouM&#039;s dev&#187; Archives pour le tag JSLint – piouPiouM&#039;s dev</title>
	<atom:link href="http://pioupioum.fr/tag/jslint/feed/" rel="self" type="application/rss+xml" />
	<link>http://pioupioum.fr</link>
	<description>Bloc-note d&#039;un développeur web</description>
	<lastBuildDate>Fri, 23 Dec 2011 23:41:36 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Une console JSLint pour aider vos validations JavaScript</title>
		<link>http://pioupioum.fr/developpement/jslint-console-rhino.html</link>
		<comments>http://pioupioum.fr/developpement/jslint-console-rhino.html#comments</comments>
		<pubDate>Thu, 03 Jun 2010 20:07:49 +0000</pubDate>
		<dc:creator>piouPiouM</dc:creator>
				<category><![CDATA[Développement Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSLint]]></category>
		<category><![CDATA[licence MIT]]></category>
		<category><![CDATA[Rhino]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://pioupioum.fr/?p=395</guid>
		<description><![CDATA[J&#8217;ai pris l&#8217;habitude de valider mon code JavaScript à l&#8217;aide de JSLint. Outil d&#8217;analyse statique de code, JSLint permet de m&#8217;assurer du niveau de qualité de mon code avant toute déploiement en production.

Cependant la console accompagnant l&#8217;outil ne me convenait pas, et ce pour plusieurs raisons&#160;:


L&#8217;élément window n&#8217;est pas défini via les options passées à [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>J&#8217;ai pris l&#8217;habitude de valider mon code <a href="http://pioupioum.fr/tag/javascript/" title="Archives pour le tag JavaScript – piouPiouM&#039;s dev">JavaScript</a> à l&#8217;aide de <strong><a href="http://www.jslint.com/" title="JSLint, The JavaScript Code Quality Tool">JSLint</a></strong>. Outil d&#8217;<a href="http://fr.wikipedia.org/wiki/Analyse_statique_de_programmes" title="Analyse statique de programmes - Wikipédia">analyse statique</a> de code, <strong>JSLint</strong> permet de m&#8217;assurer du niveau de qualité de mon code avant toute déploiement en production.</p>

<p>Cependant la <a href="http://www.jslint.com/rhino/rhino.js">console</a> accompagnant l&#8217;outil ne me convenait pas, et ce pour plusieurs raisons&#160;:</p>

<ol>
<li>L&#8217;élément <code>window</code> n&#8217;est pas défini <em>via</em> les options passées à <code>JSLINT</code> ce qui m&#8217;oblige à le déclarer, à l&#8217;aide de l&#8217;instruction <code>/*@global</code>, dans une majorité de mes scripts.</li>
<li>Dans le même esprit, j&#8217;utilise couramment certaines options — comme <code>browser: true</code> — non présentes dans l&#8217;appel à <code>JSLINT</code>.</li>
<li>La présentation du résultat ne me convient guère.</li>
</ol>

<p>Vous trouverez dans les lignes qui suivent la console que j&#8217;utilise en remplacement.</p>

<p><span id="more-395"></span></p>

<h2>Table des matières</h2>

<ol>
<li><a href="#source">Code source</a></li>
<li><a href="#prerequis">Prérequis</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="changelog">Historique des versions et changelog</a></li>
</ol>

<h2 id="source">Code source</h2>

<div class="box file-js">
    <a href="http://static.pioupioum.fr/code/jslint-console.js" title="Télécharger"><span>jslint-console.js (4&nbsp;Ko)</span></a>
</div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/*global JSLINT */</span>
<span style="color: #009966; font-style: italic;">/*jslint white: true, rhino: true */</span>
<span style="color: #006600; font-style: italic;">/**
 * @fileOverview Provides a JSLint console for Rhino.
 * &lt;p&gt;Usage: &lt;code&gt;java -jar lib/js.jar lib/jslint-console.js lib/fulljslint.js src/testFile1.js src/testFile2.js&lt;/code&gt;&lt;/p&gt;
 * @author Mehdi Kabab &lt;http://pioupioum.fr/&gt;
 * @version 0.1.1 (2010-06-24)
 */</span>
<span style="color: #006600; font-style: italic;">/**
 * @license Copyright (c) 2010 Mehdi Kabab &lt;http://pioupioum.fr/&gt;.
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the &quot;Software&quot;), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Loads the JSLint script given as first argument.</span>
load<span style="color: #009900;">&#40;</span>arguments.<span style="color: #660066;">splice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>scripts<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span>
        indentLen <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">/**
     * Returns the string repeated multiplier times.
     * @param {Number} multiplier Number of time the string should be repeated.
     * @this {String}
     * @return Returns the repeated string.
     * @type String
     * @addon
     */</span>
    String.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">repeat</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>multiplier<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span> <span style="color: #339933;">&gt;</span> multiplier<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            multiplier <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">+</span> multiplier<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">/**
     * Cleans evidence message and assign &lt;code&gt;identLen&lt;/code&gt;.
     * @private
     * @param {String} str The full message.
     * @param {String} p1 Possible identation.
     * @param {String} p2 The message content.
     * @returns The message content
     * @type String
     */</span>
    <span style="color: #003366; font-weight: bold;">function</span> cleanEvidence<span style="color: #009900;">&#40;</span>str<span style="color: #339933;">,</span> p1<span style="color: #339933;">,</span> p2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        indentLen <span style="color: #339933;">=</span> p1.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> p2<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #006600; font-style: italic;">// cleanEvidence</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">/**
     * Check quality code of the given script.
     * @private
     * @param {String} jsfile File to check.
     * @requires JSLINT
     * @requires String#repeat()
     */</span>
    <span style="color: #003366; font-weight: bold;">function</span> lint<span style="color: #009900;">&#40;</span>jsfile<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span>
            input<span style="color: #339933;">,</span>
            e<span style="color: #339933;">,</span>
            errLen<span style="color: #339933;">,</span>
            errTag <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;[ERROR] &quot;</span><span style="color: #339933;">,</span>
            found <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Running JSLint on: &quot;</span> <span style="color: #339933;">+</span> jsfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        input <span style="color: #339933;">=</span> readFile<span style="color: #009900;">&#40;</span>jsfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>input<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span>errTag <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;Couldn't open file.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            quit<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>JSLINT<span style="color: #009900;">&#40;</span>input<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> browser<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> rhino<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> laxbreak<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            onevar<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> undef<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> nomen<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> eqeqeq<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> bitwise<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            regexp<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> newcap<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            predef<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'window'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'escape'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'unescape'</span><span style="color: #009900;">&#93;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> errLen <span style="color: #339933;">=</span> JSLINT.<span style="color: #660066;">errors</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> errLen<span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                e <span style="color: #339933;">=</span> JSLINT.<span style="color: #660066;">errors</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    found <span style="color: #339933;">+=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;% scanned).&quot;</span> <span style="color: #339933;">!==</span> e.<span style="color: #660066;">reason</span>.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">11</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span>errTag <span style="color: #339933;">+</span> e.<span style="color: #660066;">reason</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\.$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span>
                            <span style="color: #3366CC;">&quot; on line &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">line</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; character &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">character</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #339933;">!==</span> e.<span style="color: #660066;">evidence</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; &quot;</span>.<span style="color: #660066;">repeat</span><span style="color: #009900;">&#40;</span>errTag.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span>
                                <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">evidence</span> <span style="color: #339933;">||</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^(\s*)(\S*(\s+\S+)*)\s*$/</span><span style="color: #339933;">,</span> cleanEvidence<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                            <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; &quot;</span>.<span style="color: #660066;">repeat</span><span style="color: #009900;">&#40;</span>errTag.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span>
                                <span style="color: #3366CC;">&quot;.&quot;</span>.<span style="color: #660066;">repeat</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">character</span> <span style="color: #339933;">-</span> indentLen <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;^&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span>errTag <span style="color: #339933;">+</span> e.<span style="color: #660066;">reason</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;=&gt; &quot;</span> <span style="color: #339933;">+</span> found <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; error(s) found.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            quit<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;OK<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #006600; font-style: italic;">// lint</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>scripts<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Usage: jslint-console.js fulljslint.js file1.js[ file2.js]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        quit<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> scripts.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        lint<span style="color: #009900;">&#40;</span>scripts<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span>arguments<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<h2 id="prerequis">Prérequis</h2>

<p>Les prérequis sont simples&#160;:</p>

<ul>
<li><a href="http://www.mozilla.org/rhino/download.html" title="Rhino Downloads">Télécharger Rhino</a> et récupérer le fichier <code>js.jar</code>.</li>
<li>Récupérer la version <a href="http://www.jslint.com/rhino/fulljslint.js">complète</a> ou <a href="http://www.jslint.com/rhino/jslint.js">minifiée</a> de JSLint. Attention cependant, il vous faudra supprimer la fonction anonyme embarquée <code>rhino.js</code> (en fin de script).</li>
</ul>

<h2 id="usage">Usage</h2>

<p>Dans un shell, exécutez <code>jslint-console.js</code> à l&#8217;aide de <strong><a href="http://www.mozilla.org/rhino/" title="Rhino - JavaScript for Java">Rhino</a></strong>, comme suis&#160;:</p>

<pre>$ java -jar lib/rhino/js.jar lib/jslint/jslint-console.js lib/jslint/fulljslint.js src/*.js</pre>

<p>Ici, deux arguments sont passés à la <strong>console jslint</strong>&#160;:</p>

<ul>
<li>Le script JSLint, <code>lib/jslint/fulljslint.js</code>, à fournir en premier argument. Je ne le charge pas en dur dans <code>jslint-console.js</code> afin de conserver une souplesse d&#8217;implémentation (<em>via</em> une tâche <a href="http://pioupioum.fr/tag/ant/" title="Archives pour le tag ant – piouPiouM&#039;s dev">Ant</a> par exemple).</li>
<li>La liste des fichiers sources <strong>JavaScript</strong> à analyser.</li>
</ul>

<p>Voici un exemple de sortie de la console&#160;:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="" style="font-family:monospace;">$ java -jar lib/rhino/js-1.7R2.jar lib/jslint/jslint-console.js lib/jslint/fulljslint.js src/*.js
Running JSLint on: src/jsfile1.js
OK
&nbsp;
Running JSLint on: src/jsfile2.js
<span class="br0">&#91;</span>ERROR<span class="br0">&#93;</span> Expected '===' and instead saw '==' on line <span style="">52</span> character 23.
        if <span class="br0">&#40;</span>false == test<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        ..........^
<span class="br0">&#91;</span>ERROR<span class="br0">&#93;</span> Unexpected dangling '_' in '_ob' on line <span style="">74</span> character 17.
        var _ob = window.ob;
        ....^
<span class="br0">&#91;</span>ERROR<span class="br0">&#93;</span> 'ob' is not defined on line <span style="">80</span> character 39.
        if <span class="br0">&#40;</span>'function' !== typeof ob.getVariables<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        ..........................^
<span class="br0">&#91;</span>ERROR<span class="br0">&#93;</span> 'ob' is not defined on line <span style="">83</span> character 26.
        params = ob.getVariables<span class="br0">&#40;</span><span class="br0">&#41;</span>.sequence;
        .........^
=&gt; <span style="">4</span> error<span class="br0">&#40;</span>s<span class="br0">&#41;</span> found.</pre></td></tr></table></div>


<h2 id="changelog">Historique des versions et changelog</h2>

<h3>0.1.1 (2010-06-24)</h3>

<ul>
<li>Forcer un multiplieur positif dans String.prototype.repeat</li>
</ul>

<h3>0.1 (2010-06-03)</h3>

<ul>
<li>Version initiale.</li>
</ul>

<h3 class='related_post_title'>Continuez votre lecture sur des sujets similaires</h3>

<ul class='related_post'><li><a href='http://pioupioum.fr/developpement/javascript-array-intersection.html' title='JavaScript : optimiser le calcul de l&#8217;intersection de tableaux de grandes tailles'>JavaScript&#160;: optimiser le calcul de l&#8217;intersection de tableaux de grandes tailles</a></li><li><a href='http://pioupioum.fr/outils-astuces/facebook-application-add-page-tab-bookmarklet.html' title='Bookmarklet : ajout rapide d&#8217;application onglet à vos pages fan Facebook'>Bookmarklet&#160;: ajout rapide d&#8217;application onglet à vos pages fan Facebook</a></li><li><a href='http://pioupioum.fr/outils-astuces/license-helper-textmate-bundle.html' title='Bundle License Helper pour TextMate'>Bundle License Helper pour TextMate</a></li><li><a href='http://pioupioum.fr/snippets/textmate-commande-exporter-mots-word-wrap.html' title='TextMate : commande &laquo;&nbsp;Export words&nbsp;&raquo;'>TextMate&#160;: commande &laquo;&nbsp;Export words&nbsp;&raquo;</a></li><li><a href='http://pioupioum.fr/outils-astuces/textmate-convertir-couleur-hexadecimale-html-rgba.html' title='TextMate : convertir une couleur hexadécimale en notation RGBA'>TextMate&#160;: convertir une couleur hexadécimale en notation RGBA</a></li></ul>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://pioupioum.fr/developpement/jslint-console-rhino.html/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

