Support for Astro Framework

Greetings,

Astro is a static site generator that allows developers to use web frameworks like Vue or React to build websites.

The astro files look likes this:

---
// Component Script (JavaScript)
---
<!-- Component Template (HTML + JS Expressions) -->

This is similar to markdown format where the area in the top between the dashes --- is called frontmatter. Frontmatter contains the JavaScript/TypeScript code that will be evaluated and executed. The rest is HTML and JS expressions. To work with Astro, there is an extension provided by the team that provides what a developer requires like syntax highlighting, IntelliSense, autocomplete … etc.

By the end of the day, astro component is no different than any React or Vue component. It just follow a different syntax.

The current version of SonarQube does not analyze the .astro files despite adding these files to the extension list of JavaScript.

Astro is becoming extremely popular tool and a lot of organizations are using it. In this thread I am asking to add support for Astro or if anyone can provide me with guidance on the best approach to support this framework. Should it be done as a new plugin or maybe an update needs to be done to the parser?

Thank you

4 Likes

Hi Ahmad,

I know this topic is super old, but I’m tracking interest for Astro, so I added you voice :slight_smile:

Please let me know if there is something particularly interesting you’d like Sonar to detect in Astro code!

Kinds regards,