prettier-plugin-astro icon indicating copy to clipboard operation
prettier-plugin-astro copied to clipboard

🐛 BUG: HTML-style `prettier-ignore` comments do not work for script tags

Open ony3000 opened this issue 1 year ago • 0 comments

Describe the Bug

Hello. I maintain three Prettier plugins.

I've recently been implementing Astro support in a plugin, and while adding tests, I found two bugs. I'm going to report them in this issue and the next issue.

Steps to Reproduce

  1. Prepare Astro code in the following form: (I'll call it foobar.astro here.)
    <!-- prettier-ignore -->
    <script>
    const foo = '123'
    </script>
    
  2. In terminal, run pnpm prettier --check foobar.astro --no-config --plugin=prettier-plugin-astro --parser=astro. (Depending on the package manager you use, the first part of the command may be slightly different.)

The current behavior

current

The expected behavior

expected

ony3000 avatar Feb 26 '24 12:02 ony3000