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

Parser babel-flow not sorting imports #47

Closed
wityan opened this issue Apr 13, 2021 · 4 comments
Closed

Parser babel-flow not sorting imports #47

wityan opened this issue Apr 13, 2021 · 4 comments

Comments

@wityan
Copy link

wityan commented Apr 13, 2021

Hei
(Its the same issue as in #6)

I have just tested this in the current Version and I think it is not working any longer. I have created a Repository to demonstrate it, here the link https://github.com/wityan/prettier-import-example-error.

In src/index.jsx the common import should come before the test import.

Is there an error in my config or is something not working anymore?

@byara
Copy link
Collaborator

byara commented Apr 14, 2021

Hey @wityan , thanks for reporting this. We still support flow but you only have to use flow in your .prettierrc file.
Hope this helps.

@wityan
Copy link
Author

wityan commented Apr 14, 2021

@byara so you mean by using experimentalBabelParserPluginsList: ["flow"] ?

@byara
Copy link
Collaborator

byara commented Apr 14, 2021

Not really, just the following in your rc file ("parser": "flow"):

{
  "parser": "flow",
  "printWidth": 80,
  "tabWidth": 4,
  "trailingComma": "all",
  "singleQuote": true,
  "jsxBracketSameLine": true,
  "semi": true,
  "importOrder": ["^common/(.*)$", "^test/(.*)$"],
  "importOrderSeparation": true
}

@wityan
Copy link
Author

wityan commented Apr 14, 2021

Works!
Thnkas @byara

@wityan wityan closed this as completed Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants