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?
Thanks @gab, indeed we tried that recently without success.
I figured adding the .astro extension to the JavaScript file suffixes would do the trick, but no luck.
Is there a setting to make a scan recognize the astro files? As @ahmadalfy put it:
By the end of the day, astro component is no different than any React or Vue component. It just follow a different syntax.
So I would expect Sonar to be able to analyze .astro files as it does with other JS frameworks. I would be fine with a documented workaround such as adding the file extensions to different suffix settings for HTML/JS
The analysis just failed, in any configuration we tried.
EDIT: I just realized this is the SonarQube Server forum – we are using the Cloud product, if that makes a difference at all.