Storybook: Support Request: Support storysource to Prettier v1.13.0

Created on 28 May 2018  路  6Comments  路  Source: storybookjs/storybook

Request Support Prettier v1.13.0

Prittier default parser option changed babylon to empty and if settting empty, ouput error.

See: https://prettier.io/blog/2018/05/23/1.13.0.html#don-t-default-to-the-javascript-parser-4528-by-duailibe

Steps to reproduce

New create using storysource project and run.

Out this error:

Error: No parser and no file path given, couldn't infer a parser.

platform and version

  • Mac 10.12.6
  • Node.js v8.9.4

  • "@storybook/vue@^3.4.6"

  • "@storybook/addon-storysource@^3.4.6"

Where to start

https://github.com/storybooks/storybook/blob/master/addons/storysource/src/loader/default-options.js

I tried add parser: 'babylon' in default option. And it works.
But I do not know if this modification alone is enough.

Add:
prettier changed output from error to warning in 1.13.1

Most helpful comment

But if this commit is enough

That was a temporary solution until your PR gets merged

All 6 comments

Referencing the related prettier issue.

https://github.com/prettier/prettier/issues/4567

Should we close this?

@igor-dv
I think this need fix. But there's no rush.
Because Prettier changed to warning, but will change again error in the future.

Now this is output:

No parser and no filepath given, using 'babylon' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.

And, the structure of the parser has changed in 1.13
see: https://github.com/storybooks/storybook/pull/3660#issuecomment-393102700 (sorry i made a mistaken. this is incorrect https://github.com/storybooks/storybook/pull/3659)

But if this commit is enough (lock Prettier version forever) , don't need it.

But if this commit is enough

That was a temporary solution until your PR gets merged

It was merged, I close this.

@Hypnosphi
Thanks for reviewing many times :bow:

Released as 4.0.0-alpha.9

Was this page helpful?
0 / 5 - 0 ratings

Related issues

purplecones picture purplecones  路  3Comments

MrOrz picture MrOrz  路  3Comments

Jonovono picture Jonovono  路  3Comments

shilman picture shilman  路  3Comments

rpersaud picture rpersaud  路  3Comments