Pular para o conteúdo

Language support

Este conteúdo não está disponível em sua língua ainda.

Biome aims to support every major language used in web projects, and support for each one comes in stages. The table below shows where each language stands today.

Language Parsing Formatting Linting GritQL plugins JavaScript plugins
JavaScript
TypeScript
JSX
TSX
Google Apps Script
JSON
JSONC
HTML*
SVG
Vue
Svelte
Astro
CSS
SCSS
YAML
GraphQL
Markdown
GritQL
  • Supported
  • Experimental
  • In progress
  • Not started

* Formatting requires an explicit opt-in.

Biome supports the ES2024 version of the language.

Biome supports only the official syntax. The team starts development of the new syntax when a proposal reaches Stage 3.

Biome supports the following languages embedded in template literals in JavaScript:

  • CSS (css or styled tag)
  • GraphQL (gql or graphql tag)

This feature is experimental and disabled by default. To enable it, set the javascript.experimentalEmbeddedSnippetsEnabled option:

biome.json
{
"javascript": {
"experimentalEmbeddedSnippetsEnabled": true
}
}

Biome supports Google Apps Script files with the .gs extension.

Apps Script is plain JavaScript that runs in Google’s runtime. It has no module system, so Biome parses .gs files as scripts rather than modules. Top-level import and export statements are reported as parse errors, matching the runtime.

Biome also recognizes the built-in service globals provided by Apps Script’s core, including SpreadsheetApp, DriveApp, and Logger. As a result:

Only core built-in services are recognized by default. If your project uses advanced services or other project-specific globals, declare them with the javascript.globals option:

biome.json
{
"javascript": {
"globals": ["MyLibrary", "BigQuery"]
}
}

Biome supports TypeScript version 5.9.

JSONC stands for “JSON with Comments”. Tools such as VS Code, TypeScript, and Babel use it because it lets you add comments to configuration files. JSONC is not a strictly defined standard, so tools differ in how they handle trailing commas.

For this reason, Biome has no separate language configuration for JSONC. Instead, three JSON options control how Biome handles comments and trailing commas, so you can support each variant of JSON.

For files with the .jsonc extension, or with the jsonc language identifier, Biome sets them as follows by default:

Some well-known files, such as tsconfig.json and .babelrc, do not use the .jsonc extension but still allow comments and trailing commas. Others, such as .eslintrc.json, only allow comments.

Biome recognizes these files by their name and sets json.parser.allowTrailingCommas accordingly, so it parses them correctly. See Well-known files for the full list.

Biome recognizes files with the .html and .htm extensions as HTML.

The HTML formatter is experimental and disabled by default. To format HTML files, set html.formatter.enabled to true.

Biome supports Vue, Svelte, and Astro files: it formats and lints their HTML, CSS, and JavaScript parts.

This support is experimental. Biome understands the syntax of each language, but newer features, rare syntax, and edge cases might not work yet. Some formatting and lint rules still need adjusting, and rules that work across embedded languages can report false positives.

For Svelte, Biome understands syntax such as control-flow blocks ({#if}{/if}), which covers most Svelte 5 projects. Svelte 4 and earlier versions are not supported.

Because full support is experimental, you must enable it explicitly. The HTML formatter is experimental too, so enable it as well:

biome.json
{
"html": {
"experimentalFullSupportEnabled": true,
"formatter": {
"enabled": true
}
}
}

If you keep full support disabled and still lint .svelte, .astro, or .vue files, Biome only partially understands them, so some rules report false positives. Turn these rules off for those files with overrides:

biome.json
{
"overrides": [
{
"includes": ["**/*.svelte", "**/*.astro", "**/*.vue"],
"linter": {
"rules": {
"style": {
"useConst": "off",
"useImportType": "off"
},
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "off"
}
}
}
}
]
}

Biome supports the CommonMark specification plus GitHub-Flavored Markdown by default.

Biome treats the info string of a fenced code block as a file extension and formats the block’s content accordingly. If Biome does not recognize the info string, it leaves the code block unchanged.

file.md
```js
function name () {
return "Lorem ipsum"
}
function name() {
return "Lorem ipsum"
}
```

Biome deliberately leaves fenced code blocks inside block quotes unchanged:

> ```js
> const foo = "bar";
> ```

You can set formatter options for each language. Because Biome can process several languages in the same file, different settings can produce inconsistent output.

For example, with full HTML support enabled, the following configuration formats the JavaScript in a Vue, Svelte, or Astro file with tabs and its CSS with spaces, so the file mixes both:

biome.json
{
"javascript": {
"formatter": {
"indentStyle": "tab"
}
},
"css": {
"formatter": {
"indentStyle": "space",
"indentWidth": 4
}
}
}

How Biome should handle this is still an open question. To share your use case, join the GitHub discussion.

Biome parses the following files as JSON, with both json.parser.allowComments and json.parser.allowTrailingCommas set to false:

  • .all-contributorsrc
  • .arcconfig
  • .auto-changelog
  • .bowerrc
  • .c8rc
  • .htmlhintrc
  • .imgbotconfig
  • .jslintrc
  • .nycrc
  • .tern-config
  • .tern-project
  • .vuerc
  • .watchmanconfig
  • mcmod.info

Biome parses the following files as JSON, with json.parser.allowComments set to true and json.parser.allowTrailingCommas set to false, because the tools that consume these files can only strip comments:

  • .ember-cli
  • .eslintrc.json
  • .jscsrc
  • .jshintrc
  • tslint.json
  • turbo.json

Biome parses the following files as JSON, with both json.parser.allowComments and json.parser.allowTrailingCommas set to true, because the tools that consume these files accept both:

  • .babelrc
  • .babelrc.json
  • .devcontainer.json
  • .hintrc
  • .hintrc.json
  • .oxlintrc.json
  • .swcrc
  • api-documenter.json
  • api-extractor.json
  • babel.config.json
  • deno.json
  • devcontainer.json
  • dprint.json
  • jsconfig.json
  • jsr.json
  • language-configuration.json
  • nx.json
  • project.json
  • tsconfig.json
  • typedoc.json
  • typescript.json
  • All .json files under the $PROJECT/.vscode/* folder and under the user VS Code settings folder
  • All .json files under the $PROJECT/.zed/* folder and under the user Zed settings folder
  • All .json files under the $PROJECT/.cursor/* folder and under the user Cursor settings folder