junstyle / vscode-django-support

django formatter, highlight...
https://marketplace.visualstudio.com/items?itemName=junstyle.vscode-django-support
Apache License 2.0
4 stars 0 forks source link

cannot use {# prettier-ignore-end #} within js script tag #20

Open devkral opened 6 months ago

devkral commented 6 months ago

Currently because of #9 I have to escape a part of my js code. For this I use the extended ignore syntax in a js script block.

But for the line with {# prettier-ignore-end #} an invalid token warning is generated.

Trying to escape doesn't work either: e.g. // {# prettier-ignore-end #} is completely ignored

/**
{# prettier-ignore-end #}
*/

causes still an warning

So there is currently no workaround except using a separate script block, or refactoring out the js part in a seperate file

junstyle commented 6 months ago

in script tags it's different

you can try

for next line:

// prettier-ignore

for block:


/* prettier-ignore-start */
  some js.....
/* prettier-ignore-end */
junstyle commented 6 months ago

also ignore the whole tags


{# prettier-ignore-start #}
<script>
var a=1;
</script>
{# prettier-ignore-end #}
devkral commented 6 months ago

ignoring the whole tags didn't work for me, the code still is affected by #9