tests-always-included / pretty-js

Beautify and pretty print JavaScript and JSON
Other
21 stars 4 forks source link

Shouldn't have a space between a variable and unary ++/-- operators #10

Closed jacekradko closed 9 years ago

jacekradko commented 9 years ago

There shouldn't be a space between a variable and the unary ++/-- operators.

i++;
--i;

Prints to

i ++;
-- i;

Here is a failing scenario for this:

{
  "input": "i++; --i;",
  "output": "i++;\n--i;"
}
jacekradko commented 9 years ago

Alternately, there should be an option to remove those spaces.

fidian commented 9 years ago

I'm all for the option. Any suggestions for the name before I make something up?

jacekradko commented 9 years ago

Nope. I defer to your good judgement.

fidian commented 9 years ago

Option now exists. Let me know if the code isn't doing what you'd expect.