Comments (6)
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.
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:
They should mention go-template
.
from prettier-plugin-go-template.
Happy to hear that! π
from prettier-plugin-go-template.
Hi, how can I provide the go-template
parser? Is it an extension or... ?
I have the same error.
VSCode: 1.52.1
Prettier: 5.8.0
from prettier-plugin-go-template.
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.
Yes, just like @javifm86 said. You must:
- install prettier locally:
npm install --save-dev prettier
- install the extension:
npm install --save-dev prettier-plugin-go-template
- adjust the .prettierrc according to the README.md
from prettier-plugin-go-template.
Related Issues (20)
- Can't make it work in VSCode on gohtml with pnpm HOT 1
- Unintended whitespace is inserted into the value of an HTML attribute
- Upgrade prettier peer dependency to `^3.0.0` HOT 3
- Closing tag is spit on log tags and log lines HOT 2
- Nvim support check HOT 1
- support for Templ files HOT 1
- File with just text and go template command is not idempotent HOT 2
- Financial donations? HOT 1
- Different formatting result after formatting once HOT 2
- Idempotency bug w/ unclosed multiline string
- Error - Found invalid node block HOT 5
- Formatting fails for HTML custom elements HOT 5
- Error thrown when formatting dynamic HTML tag like `<h{{ .Level }}></h{{ .Level }}>`
- prettier print/embed are async now
- Lines containing variable definitions cause double-empty lines HOT 2
- confused by multiline comments containing syntax HOT 1
- prettier-ignore comments don't work for html fragments HOT 3
- fails on html tags using if/else HOT 2
- Migrate to Prettier v3 HOT 2
- Use With Pre-commit hooks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-plugin-go-template.