title: PHP vs. JavaScript switch indentation
body: <p>While I realize that each language has its own convention for indentation, I can't help but be annoyed with something I've recently discovered.  Consider this code from the PHP manual:</p>
  
  <pre><code>switch ($i) {
      case "apple":
          echo "i is apple";
          break;
      case "bar":
          echo "i is bar";
          break;
      case "cake":
          echo "i is cake";
          break;
  }
  </code></pre>
  
  <p>Notice that each case is indented from the switch statement.  This makes sense, as the code is easier to read and the body of the block is contained one level inside of it.</p>
  
  <p>However, when I test the equivalent JavaScript switch statement in JSLint:</p>
  
  <pre><code>switch (i) {
      case "apple":
          alert("i is apple");
          break;
      case "bar":
          alert("i is bar");
          break;
      case "cake":
          alert("i is cake");
          break;
  }
  </code></pre>
  
  <p>...it displays an error telling me that it should appear like this instead:</p>
  
  <pre><code>switch (i) {
  case "apple":
      alert("i is apple");
      break;
  case "bar":
      alert("i is bar");
      break;
  case "cake":
      alert("i is cake");
      break;
  }
  </code></pre>
  
  <p>It seems counterintuitive, as each case is now inline with the switch block itself.  I can't imagine any reason why this would be considered better, much less trigger an error.</p>
  
  <p>Is JSLint in err, or is it just following convention?  If the latter is true, why wouldn't the convention be to indent for clarity?</p>