helixbass / prettier-plugin-coffeescript

Prettier Coffeescript Plugin
MIT License
37 stars 1 forks source link

Formatting: parenthesize comprehension as postfix conditional #167

Open helixbass opened 4 years ago

helixbass commented 4 years ago

Eg this:

throw new Error 'b' unless elm? for elm in elms

should get explicit parentheses to make it more obvious that it's not doing what you expected:

throw new Error 'b' unless (elm? for elm in elms)

See https://github.com/jashkenas/coffeescript/issues/5309, https://github.com/helixbass/eslint-plugin-coffee/issues/37