Skip to content

☂️ HTML-ish languages #6657

@ematipico

Description

@ematipico

Description

Addresses #1726

This issue serves as an entry point to collect tasks, comments, and feedback regarding the support of Vue, Svelte and Astro files inside Biome.

We don't have a definitive solution, architecturally speaking, for it yet, as highlighted in #1726

Parser

The support for those languages requires the next tasks:

  • Expand a few aspects of the parsers to support .astro files
    • support the --- / --- frontmatter
    • support JSX-like syntax
  • Expand possible aspects to support Vue and Svelte files
  • Enhance HTML parsing to define possible templating nodes e.g. {{ variable }}
  • Creates syntax nodes that can be sent across threads and that aren't necessarily roots

Semantic models

We will need to create new semantic models. It's not clear if these semantic models need to be per language, or if we can have one single, generic, model for all templating languages.

What we want to achieve is the ability to collect bindings from the JavaScript code of the template, so we can analyse them when analyze the HTML part of the template e.g.

<script setup>
import { ref } from 'vue'

const count = ref(0) // `const` is automatically exported
</script>

<template>
   <!-- Here we should be able to query `count` and make sure it exists -->
  <button @click="count++">You clicked me {{ count }} times.</button>
</template>

Formatter

If we're able to implement #3334, I believe we can use the same principle

Metadata

Metadata

Assignees

Labels

S-EnhancementStatus: Improve an existing featureS-FeatureStatus: new feature to implement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions