Hacker News new | ask | show | jobs
by hmsimha 4116 days ago
Looks pretty cool, but it supports a very limited set of styles. It's not really comparable to rubocop, nor is it able to enforce conformance to any of the popular style guides in full. In fact, at a glance it appears to make decisions about your code that fly in the face of many of the popular style guides (double spaces for indentation and no freaking semicolons [seriously?]).

The auto-formatting option does not clarify which of these it enforces, and one of these isn't even a style rule (always handle the err parameter in node.js).

To really rub it in, it also makes it very clear that there is no configuration! Deal with it in a way that strikes me as uncomfortably smug.

I appreciate you sharing, and I could see this being useful for running over a codebase. I might use it to convert all tabs to double spaces (since that's my preference anyway) and check to make sure there are no unused declared variables, but that might be the extent of it. But to be honest, reading the documentation here has made me really want to see a community-developed tool inspired by Rubocop.

1 comments

That there is no configuration is kind of the point. Close the door on the bike shed and attempt to popularize a conventional style.

If you want more control, use ESlint or jslint or jshint and define your own rules.

The problem is this is incompatible with the current state of the JS ecosystem. NPM packages need to follow the npm style guide (though standard appears at a glance to be closer to this than anything else). jQuery modules need to follow the jQuery style guide. Many projects may already use another style guide. A large chunk of open-source javascript follows a style guide that standard is incompatible with, and new projects often have to adhere to the style guide of the platform they target as well. It would be much more useful to have a code analysis and correction tool that could enforce the rules of a target style guide.