martinheidegger / hapiness-format

converts your code into Hapiness JavaScript Format
2 stars 2 forks source link

One line "If" cause formatter to format incorrectly #2

Open daniel-ro opened 8 years ago

daniel-ro commented 8 years ago

For example, this code:

// app.js
var obj = {
    a: 1,
    b: 2
};
var a = obj['a'] ? obj['a'] : obj['b'];

if (a) console.log('here');

run happiness app.js, no errors. run happiness-format -w app.js to format. run happiness app.js, raised: "Infix operators must be spaced" error.

My env: OS X 10.11.4

martinheidegger commented 8 years ago

thank you for reporting this. Unfortunately I do not see it as good for the community or myself to work on hapiness. If you wish to contribute see: #3

daniel-ro commented 8 years ago

Oops missed that.. maybe one day it will drive me crazy and I'll fix it.. thanks anyway