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

Maintenance: merger into the upstream #38

Open
JounQin opened this issue Jan 14, 2024 · 2 comments
Open

Maintenance: merger into the upstream #38

JounQin opened this issue Jan 14, 2024 · 2 comments

Comments

@JounQin
Copy link

JounQin commented Jan 14, 2024

Hi @meteorlxy

I'm the current active maintainer of https://github.com/prettier/eslint-plugin-prettier, and just see this fork accidentally few days ago.

And I think about that is there any chance to merge this fork back into upstream? I believe that the custom blocks support is great for such frameworks commonly like Vue, Svelte, Astro, etc.

If you agree and want to raise a PR for upstream that'll be appreciated. Otherwise I'll think about how to implement such features in eslint-plugin-prettier.

I want us to collaborate together with @BPScott.

@meteorlxy
Copy link
Owner

meteorlxy commented Jan 14, 2024

Hi @JounQin . Thanks for your contribution to prettier & eslint ecosystem!

It would be nice for eslint-plugin-prettier to support those features natively. But I think this fork might not be an ideal implementation:

  • It still have some unresolved bugs like Issues with end of line for Vue SFC blocks with CLRF/LF #13 - simply splitting sfc into separate blocks will lose the file-level context.
  • The way it uses to process custom blocks is utilizing vue's sfc compiler. I'm afraid it's not suitable for other frameworks.
  • Maybe a prettier plugin could be a better choice?

Based on your knowledgement about prettier, I believe that you can find a better way to support similar features. Let me know if I could help anything.

@JounQin
Copy link
Author

JounQin commented Jan 14, 2024

It would be nice for eslint-plugin-prettier to support those features natively. But I think this fork might not be an ideal implementation:

  1. Try like this one: https://github.com/un-ts/prettier/blob/80e1909d40d0c2957a40e79f50be13054f27665c/packages/sql/src/index.ts#L106-L110, I can raise a PR for it
  2. I mean mark @vue/compiler-sfc as optional peer dependency, for other frameworks, we use other compiler/parser instead
  3. Yes, I was just talking with the author of https://github.com/Sec-ant/prettier-plugin-embed and custom blocks could be some kind of embed languages

Based on your knowledgement about prettier, I believe that you can find a better way to support similar features. Let me know if I could help anything.

Thanks, I do have some ideas as described above, I'm thinking what's the best choice or we may be able to support all choices.

The benefit of eslint-plugin-prettier is that it can be reported by tools like VSCode ESLint plugin, while VSCode prettier won't check the file on editing.

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