Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for prettier 1.8 #77

Closed
3 tasks done
mitermayer opened this issue Nov 8, 2017 · 5 comments · Fixed by #80
Closed
3 tasks done

Add support for prettier 1.8 #77

mitermayer opened this issue Nov 8, 2017 · 5 comments · Fixed by #80
Assignees

Comments

@mitermayer
Copy link
Member

mitermayer commented Nov 8, 2017

We should add support for prettier 1.8

  • Bump internal plugin dependency
  • Add support for markdown formatting
  • Update readme and docs
@mitermayer mitermayer self-assigned this Nov 8, 2017
@mitermayer
Copy link
Member Author

mitermayer commented Nov 8, 2017

latest version of prettier breaks vim-prettier error handling since they changed their default CLI error display

before was:


a.js: SyntaxError: Unexpected token (5:7)
  3 |  */
  4 | 
> 5 | const (a,b,c,asdasd) => {const b    =3}
    |       ^
  6 | 

now it is:

[error] a.js: SyntaxError: Unexpected token (5:7)
[error]   3 |  */
[error]   4 | 
[error] > 5 | const (a,b,c,asdasd) => {const b    =3}
[error]     |       ^
[error]   6 | 

changes like that makes upgrading prettier a breaking change for vim-prettier since it wont be able to support older versions of prettier.

its means now we have to handle this 3 types:

stdin: SyntaxError: Unexpected token (2:8)
file.ext: SyntaxError: Unexpected token (2:8)
[error] file.ext: SyntaxError: Unexpected token (2:8)

cc @lydell @azz

@mitermayer
Copy link
Member Author

prettier 1.8+ also caused #76

@lydell
Copy link
Member

lydell commented Nov 8, 2017

Why won’t you be able to support older versions of Prettier because of the error message change?

@mitermayer
Copy link
Member Author

Hi @lydell,

Why won’t you be able to support older versions of Prettier because of the error message change?

In that case it was not a problem since we were able to have one sigle regex to match them all (otherwise we would have to version check prettier on initialization to know which regex to use)

But due to the nature that vim-prettier uses the CLI API, simple changes like changing the message output can cause problems and unseen breaks

@lydell
Copy link
Member

lydell commented Nov 8, 2017

We should be more careful in the future, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants