max-mapper / standard-format

converts your code into Standard JavaScript Format
264 stars 59 forks source link

adding unneeded semicolon & breaks standard #174

Closed stephenmathieson closed 7 years ago

stephenmathieson commented 8 years ago

looks like an extra semi is being added when fat arrow function's params are wrapped with parens:

~/dev/src/github.com/segmentio/app on canary [!?] ∴ cat x.js
export default () => <div onSomething={(x) => y(x)}><foo /></div>

~/dev/src/github.com/segmentio/app on canary [!?] ∴ ./node_modules/.bin/standard-format x.js > y.js

~/dev/src/github.com/segmentio/app on canary [!?] ∴ ./node_modules/.bin/standard y.js
standard: Use JavaScript Standard Style (http://standardjs.com) 
  /Users/stephenmathieson/dev/src/github.com/segmentio/app/y.js:1:40: Parsing error: Unexpected token ;

~/dev/src/github.com/segmentio/app on canary [!?] ∴ cat y.js 
export default () => <div onSomething={;(x) => y(x)}>
                       <foo />
                     </div>
carbureted commented 8 years ago

+1, makes the formatter unusable for me :(

carbureted commented 8 years ago

It looks to me like the problem is probably best addressed in https://github.com/millermedeiros/esformatter-semicolon-first

millermedeiros commented 8 years ago

just released esformatter-semicolon-first@1.2.0 with the fix!

feross commented 8 years ago

Thanks!

carbureted commented 8 years ago

Feross, is the updated package working for you? I'm still getting the same bug when used in standard-format, but not when the esformatter-semicolon-first package is used independently. I may be making some dumb mistake, though.

feross commented 8 years ago

@carbureted Yeah, you're right -- it's not working for me either.

Sidenote: @maxogden -- can you please add @millermedeiros to this repo?

feross commented 8 years ago

Extra sidenote: @carbureted you might try using standard --fix (part of the latest standard beta (npm install standard@beta) instead of standard-format.

carbureted commented 8 years ago

@feross standard --fix is working for me, thanks!

feross commented 7 years ago

You should use standard --fix instead of this package. standard-format isn't being actively maintained anymore.