Git Product home page Git Product logo

Comments (6)

javifm86 avatar javifm86 commented on July 17, 2024 1

Wow I made a mistake, I had in VSCode html default formatter different than prettier. Now itΒ΄s working like a charm. Thanks for your help and for the plugin!

from prettier-plugin-go-template.

NiklasPor avatar NiklasPor commented on July 17, 2024

Hey, the VSCode warning is normal – because it's a parser provided by a template_

I tried it with exactly your versions and it worked perfectly fine for me.
Could you also tell me which version of VSCode & which version of the Prettier Extension inside VSCode you're using?

And a reproduction repository would also be very nice if you find some time πŸ˜„


Also is your .prettierrc file placed at root level?

If so you should be able to open the output terminal and look at the prettier logs:

image

They should mention go-template.

from prettier-plugin-go-template.

NiklasPor avatar NiklasPor commented on July 17, 2024

Happy to hear that! πŸ‘

from prettier-plugin-go-template.

inwardmovement avatar inwardmovement commented on July 17, 2024

Hi, how can I provide the go-template parser? Is it an extension or... ?
I have the same error.

image

VSCode: 1.52.1
Prettier: 5.8.0

from prettier-plugin-go-template.

javifm86 avatar javifm86 commented on July 17, 2024

You must install on your project prettier-plugin-go-template and enable it on .prettierrc file for html files:

{
  "printWidth": 80,
  "tabWidth": 2,
  "trailingComma": "none",
  "singleQuote": true,
  **"overrides": [
    {
      "files": ["*.html"],
      "options": {
        "parser": "go-template"
      }
    }
  ]**
}

Make sure on VSCode prettier is your default formatter for HTML files.

from prettier-plugin-go-template.

NiklasPor avatar NiklasPor commented on July 17, 2024

Yes, just like @javifm86 said. You must:

  1. install prettier locally: npm install --save-dev prettier
  2. install the extension: npm install --save-dev prettier-plugin-go-template
  3. adjust the .prettierrc according to the README.md

from prettier-plugin-go-template.

Related Issues (20)

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.