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

To make semicolon style consistent, change the option in the formatter that actually handles your files. In Prettier, set semi to true to print statement-ending semicolons or false to omit routine ones. In Biome, set javascript.formatter.semicolons to "always" or "asNeeded". A no-semicolon style can still include protective semicolons where JavaScript automatic semicolon insertion (ASI) could otherwise change how code is parsed.

First, identify the formatter for the file

A semicolon setting only affects files formatted by that tool. Check the project’s scripts, configuration files, and editor formatter selection to see whether the file is handled by Prettier or Biome before changing anything. Avoid having competing formatters rewrite the same files with different rules; their output can conflict.

Configure semicolons in Prettier

Set the semi option in your project’s Prettier configuration. For example, in a JSON configuration file:

{
  "semi": false
}

Use false to omit ordinary statement-ending semicolons, or true to print them. Prettier’s documented default is true, so you only need to set it explicitly when you want to override that behavior. The command-line override for the no-semicolon style is --no-semi; the API option is semi. See Prettier’s options documentation.

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

Configure semicolons in Biome

In biome.json, set the JavaScript formatter option. To omit semicolons except where needed for ASI safety:

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

Choose "always" to print semicolons after every statement, or "asNeeded" to print them only when needed to protect parsing. Biome’s documented default is "always". The CLI accepts --semicolons=always or --semicolons=as-needed; note that the configuration uses camel case (asNeeded), while the CLI spells the value with a hyphen (as-needed). See the Biome configuration reference and Biome CLI reference.

Why semicolons can remain in a no-semicolon style

“Remove semicolons” usually means remove routine statement-ending semicolons, not every semicolon in the file. JavaScript ASI can make a line beginning with certain expressions—for example, bracket syntax—continue the previous expression instead of starting a new one. Prettier therefore retains a protective semicolon at the start of a line when needed; Biome’s asNeeded mode follows the same broad principle. The formatter handles these safety cases automatically. Prettier explains the rationale in its formatting rationale.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make the change apply on save

The semicolon option controls the formatter’s output; formatting on save is a separate editor action that invokes the formatter. To apply the policy automatically when saving, make sure the editor runs the correct formatter for that language or file type on save. The exact menu names and settings vary by editor and installed extension, so select the project’s formatter rather than assuming that changing its configuration alone will trigger formatting.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

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.