October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Configure Prettier or Biome to Add or Remove Semicolons Automatically

Use Prettier's `semi` option or Biome's `javascript.formatter.semicolons` setting to choose routine semicolons or ASI-safe semicolons only.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure the formatter that already handles your file: Prettier uses the semi option, while Biome uses javascript.formatter.semicolons. Choose whether it should print semicolons routinely or only where needed to protect JavaScript parsing. A no-semicolon style does not necessarily mean every semicolon disappears.

First, identify the formatter used for the file

A setting only affects output when the relevant formatter is actually run on that file. Check your project configuration, scripts, or editor formatter selection to determine whether the file is handled by Prettier or Biome before changing anything. The two tools use different option names and value formats.

As an Amazon Associate I earn from qualifying purchases.

Configure semicolons in Prettier

Set semi in the project’s Prettier configuration. For example, to omit routine statement-ending semicolons, use:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "semi": false
}

Set "semi": true to print semicolons at statement ends; this is Prettier’s documented default. You can also use Prettier’s CLI override --no-semi. The API option is named semi. See Prettier’s options documentation.

Configure semicolons in Biome

In biome.json, set javascript.formatter.semicolons. To emit semicolons only where needed, configure:

{
  "javascript": {
    "formatter": {
      "semicolons": "asNeeded"
    }
  }
}

Use "always" to print a semicolon after every statement; that is Biome’s documented default. The configuration value is camel-cased as asNeeded, while the CLI spells the equivalent option --semicolons=as-needed (or --semicolons=always). Refer to the Biome configuration reference and Biome CLI reference.

Why a no-semicolon style may still show semicolons

JavaScript’s automatic semicolon insertion (ASI) can make a line that begins with certain syntax—such as a bracket—continue the expression on the preceding line. To avoid changing how code parses, Prettier with semi: false still inserts protective semicolons at the beginning of lines in those cases. Biome’s asNeeded mode likewise emits semicolons when needed to protect against ASI. These are safety measures, not evidence that the style option failed. See Prettier’s semicolon rationale.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make the formatter run when you save

The semicolon option controls how a formatter prints code; formatting on save is a separate editor behavior that triggers the formatter. To have edits applied automatically, enable your editor’s format-on-save behavior and ensure the intended formatter is selected for the file’s language. The exact setting names and menus vary by editor and installed extension, so use the instructions for your specific setup.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.