Think I am seeing a prettier issue in a yaml file containing some ruby. How could I get this to pass?
SyntaxError: Nested mappings are not allowed in compact mappings (18:13)
16 | # Your application name. Renaming here affects where data displays in New
17 | # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
> 18 | app_name: <%= ENV["SERVER_ENV"] == 'staging' ? '12vBiz (Staging)' : '12vBiz' %>
this is in the config file tor NewRelic - newrelic.yml
Sorry here is more of the error
/node_modules/prettier/index.js:13588
throw error;
^
SyntaxError: Nested mappings are not allowed in compact mappings (19:13)
17 | # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
18 | # prettier-ignore
> 19 | app_name: <%= ENV["SERVER_ENV"] == 'staging' ? '12vBiz (Staging)' : '12vBiz' %>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 20 |
| ^
I tried adding the #prettier-ignore
per the prettier docs, but that doesn't seem to work either.
Hi. I am adding prettier to a repo and would like to use .eslintignore
as ignores file. The problem is to make this frictionless for the dozens of developers working on it.
While invoking the CLI is wrapped and --ignore-path
set accordingly, providing this for editor integrations seems harder. I canāt use a symlink .prettierignore -> .eslintignore
, because we also use windows, where git symlink support depends on local configuration. .prettierrc
does not support ignorePath
.
Is there any way to provide my team with a no-config experience? Thanks.
eslint --fix
& prettier --write
on save or reformat? Please don't point me to https://prettier.io/docs/en/integrating-with-linters.html, because I'm ugly & dumb, and that page is confusing to me.
Hey Guys, I just got prettier and it makes my
<a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA">Wikipedia</a>
into:
<a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA"
>Wikipedia</a
>
it it somehow possible to make my code look like this:
<a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA">
Wikipedia
</a>
?
See https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting
it works now with "ignore", thanks! Is it normal that it stays in one line if I change my print width settings from 80 to 100 or can I change it somehow that i looks like this:
<a href="https://de.wikipedia.org/wiki/Inlineframe" target="iframeA">
Wikipedia
</a>
?
it ignores the line wrap when i format on save:
<div
class="flex flex-row items-stretch w-full mx-auto space-x-1 justify-evenly justify-items-stretch h-80"
>
but when ran manually with format document it correctly wraps:
<div
class="
flex flex-row
items-stretch
w-full
mx-auto
space-x-1
justify-evenly justify-items-stretch
h-80
"
>
<body>
<shared-button name="Peter" class="sc-shared-button-h hydrated">
<div class="sc-shared-button">hi Peter,</div>
<button class="sc-shared-button">load tic</button>
</shared-button>
<my-input class="sc-my-input-h hydrated"
><input type="text" class="sc-my-input" /><button class="sc-my-input">
clear</button
><button class="sc-my-input">load</button></my-input
>
<h1>Hallo Welt</h1>
</body>
<my-input class="sc-my-input-h hydrated"
> <input type="text" class="sc-my-input" /><button class="sc-my-input">
clear</button
> <button class="sc-my-input">load</button></my-input
>
I have a question, if the following is possible with the plugin system.
I want to extend the javascript printer to have an embed for a tagged template literal with
hbs`<div></div>`
This would be similar to the html tagged template literal but would be for handlebars syntax inside.
If not that, potentially a version of the plugin that will process an alternative file extension .gjs which like react or something will have a <template>
tag on a class.
// ...
export default class MyComponent extends Component {
<template>
<div>Some Hbs here.</div>
<template>
};
This format, I don't think warrants a change in the main repo of prettier, because the API is not final but for current application development in glimmer.js experimental fork.
I've playing around with creating a plugin, but I can't really get the embed or print functions to recursively call as described from the documentation. I am seeing it get called once with the node being a file, but I thought it would be doing more.
*.txt
override with "parser" : "markdown"
, which is close enough for my needs. This seems like something I might have to submit as an Issue. Any advice or final checks I should try before I do?