Comments (10)
FYI [email protected]
also already includes Go specific ignore syntax:
<div>
{{/* prettier-ignore */}}
<script>
This
is
ignored
.
</script>
<span> But this is not </span>
</div>
All the contents of the ignored tag won't be formatted. Does this fulfill all of your needs? @jasikpark @apoorvmote
If something is not working with that syntax, please give me a specific example with input, output and expected sections. Also keep in mind that this plugin currently only supports HTML templates.
from prettier-plugin-go-template.
Have you tried a .prettyierignore
file? It worked for me in my own Hugo work.
https://prettier.io/docs/en/ignore.html
> cat .prettierignore
/public/
resources/_gen/
hugo_stats.json
from prettier-plugin-go-template.
Here is my .prettierignore
file
static
public
node_modules
resources/_gen/
hugo_stats.json
I got tired of waiting around and for code snippets I use gist.github.com
from prettier-plugin-go-template.
@apoorvmote so is this about files that are not handled by this plugin?
For *.ts
, * .md
the regular prettier plugin formatting is formatting your code.
If you want to exclude everything except for the HTML files you can do it with your .prettierignore
file:
prettier/prettier-vscode#578
from prettier-plugin-go-template.
Well even if it does work 100% there is another problem.
100% of my pages are written in amp
pages mostly talking about html
, jsx
and amp
itself. And even though the code snippet is inside <pre><code><button onClick={() => console.log('hello world')}>submit</button></code></pre>
the amp
runtime tries to execute html
inside <pre><code></code></pre>
on page load. So I couldn't use code snippets. I have no idea how amp.dev can show snippets without being executed.
So I switched everything to gist.github.com. And now I don't have this problem anymore. And since I am the only one having this issue. I will just close it.
from prettier-plugin-go-template.
@apoorvmote Could you reopen this issue but maybe make the title more specific to "<!-- prettier-ignore -->
doesn't work"?
I'm having the same issue, trying to use it with my hugo templates.
from prettier-plugin-go-template.
Good so I am not the only one who is having this issue.
from prettier-plugin-go-template.
That looks like it'd work for me! I'll have to try that out, thanks for all your hard work on this!
from prettier-plugin-go-template.
@NiklasPor is beta-9 released yet? I don't see it on npm
from prettier-plugin-go-template.
Accidentally only published to my local registry. Should be available now 😁
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
- Error: unexpected end keyword HOT 4
- 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.