Giter Club home page Giter Club logo

Comments (5)

mark-reason avatar mark-reason commented on August 16, 2024 5

I get the same issue within <script> tags within .astro files

from prettier-plugin-astro.

at-the-vr avatar at-the-vr commented on August 16, 2024

setting up the global parser to typescript is a gotcha here. What I did was remove it and the warning list was reduced significantly. I noticed svelteStrictMode flag related warnings coming as well but it appeared as an "unknown option" in the prettier logs so I don't have any much thought about it

from prettier-plugin-astro.

andrevandal avatar andrevandal commented on August 16, 2024

hey, I'm facing the same issue but in a different code.

Screenshot 2024-05-11 at 16 46 15
    <script define:vars={{ googleAnalyticsId, isDev }}>
      window.dataLayer = window.dataLayer || []
      function gtag() {
        dataLayer.push(arguments)
      }
      gtag('js', new Date())
      gtag('config', googleAnalyticsId, {
        debug_mode: isDev,
      })
    </script>

versions:

  • "astro": "^4.6.0"
  • "prettier": "^3.2.5",
  • "prettier-plugin-astro": "^0.13.0",

from prettier-plugin-astro.

FlipFloop avatar FlipFloop commented on August 16, 2024

My version:

{Condition &&
        <style>
          body, h1, h2, h3, h4, h5, h6, code, p, a, li, span, ul {
          font-family:"Comic Sans MS", "Comic Sans", cursive;
        }
        </style>
        <script src="....."></script>
        <script lang="javascript">
        .....
        </script>
        <p style="text-align: center;">
          .....
        </p>
    }
.astro: SyntaxError: Unexpected token, expected "}" (4:22)
[error]   2 |         <style>
[error]   3 |           body, h1, h2, h3, h4, h5, h6, code, p, a, li, span, ul {
[error] > 4 |           font-family:"Comic Sans MS", "Comic Sans", cursive;
[error]     |                      ^
[error]   5 |         }
[error]   6 |         </style>

from prettier-plugin-astro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.