phpjs
Version:
56 lines (42 loc) • 1.34 kB
HTML
<!-- Generated by Rakefile:build -->
<strong>
<a href="http://brett-zamir.me" rel="nofollow">Brett Zamir</a>
</strong>
on 2010-01-20 10:49:22 <br />
JSLint, as good as it is, really needs more configuration options. I would venture a guess that maybe the reason is because the indents at the end are otherwise confusing:
<pre><code>switch(v) {
case 'a':
break;
default:
...lots of stuff here...
break;
// Might be tempting to put ending bracket here
// or add one here since the indent before this line
// is twice as much as the next
}
</code></pre>
That being said, I don't like all of JSLint's provisions, including this one, as well as even the one forbidding fall-throughs. There has to be room for different coding styles too. I bet Douglas Crockford may be open to patches which did allow configuration if someone submitted the patches...
<hr />
<strong>
</strong>
on 2010-01-19 07:31:39 <br />
For some reason, JSLint wants the cases of a switch statement to be lined up with the switch statement itself:
<pre><code>
switch (expression) {
case 1:
...
case 2:
...
}
</code></pre>
...instead of the more readable....
<pre><code>
switch (expression) {
case 1:
...
case 2:
...
}
</code></pre>
I don't understand why it wants this.
<hr />