Code Monkey home page Code Monkey logo

Comments (2)

meteorlxy avatar meteorlxy commented on May 17, 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 #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.

from eslint-plugin-prettier-vue.

JounQin avatar JounQin commented on May 17, 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.

from eslint-plugin-prettier-vue.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.