is a microblog
home archives search feed blogroll

Rules I Don’t Like On StandardJS


function name (arg) { ... }   // ✓ ok
function name(arg) { ... }    // ✗ avoid

The latter looks better.


window.alert('hi')   // ✓ ok
window.alert('hi');  // ✗ avoid

Again, the latter looks better. I’m too used to semicolons.


var obj = {
  message: 'hello',   // ✗ avoid

Trailing commas are useful for shorter diffs.


Even though there are some rules I don’t like, I am still going to use it vanilla-style. It’s important to have a consistent code style in a project. It’s a hard thing to enforce when multiple developers work in the same codebase. This npm package makes it a much easier goal to achieve.

To install standard, run the following command.

npm install standard --save-dev

To fix your code style, run the following command.

standard --fix


Posted on 2018-02-22   #javascript  

← Next post    ·    Previous post →