Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk3 min

How to Resolve Semicolon Conflicts Between Your Formatter and Linter

Set one semicolon policy in Prettier, make ESLint agree, and check editor save actions if the tools keep rewriting the same lines.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose one semicolon policy, configure your formatter to apply it, and make the linter agree—or disable the linter’s conflicting style rule if the formatter owns formatting. With Prettier and ESLint, this usually means setting Prettier’s semi option and using eslint-config-prettier to turn off overlapping formatting rules. Keep JavaScript’s automatic semicolon insertion (ASI) in mind: a semicolon-less style can still require a leading semicolon in specific cases.

Find which tool is changing the semicolons

A semicolon conflict can come from project configuration, a lint rule, an editor’s default formatter, or multiple save-time actions. Check these settings before changing code style:

As an Amazon Associate I earn from qualifying purchases.

  • The formatter configuration in the repository.
  • The ESLint configuration and the rule that reports or fixes semicolons.
  • The installed Prettier and ESLint versions, since available rules and their status can vary by version.
  • Your editor’s default formatter and any actions configured to run on save.

The documentation for Prettier and ESLint explains how their tools work, but it cannot identify which editor settings or save actions are active in a particular project. If formatting and linting each pass when run separately but saving creates recurring diffs, inspect the editor’s save workflow for more than one formatter or fixer.

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

Choose one semicolon convention

Follow the existing repository and team convention where possible. The documentation does not designate semicolons or semicolon-free code as universally better; the important thing is that the formatter and linter do not enforce opposing choices.

Policy Prettier setting What it does
Use semicolons semi: true Prints a semicolon at the end of every statement.
Omit semicolons where possible semi: false Omits statement-ending semicolons, but retains leading semicolons where they may be needed to avoid an ASI hazard.

Prettier documents these behaviors in its semicolons options. Put the choice in a project configuration file so it is repeatable for contributors and tools; see Prettier’s configuration-file guidance.

Make the formatter and linter agree

If Prettier owns formatting

Set Prettier’s semi option to the selected convention. Then use eslint-config-prettier to disable ESLint rules that conflict with, or are unnecessary alongside, Prettier. Keep linting focused on correctness and code-quality checks rather than asking both tools to make the same formatting decision. This division is the approach Prettier recommends in its guide to integrating with linters.

Check which ESLint semicolon rule is active

ESLint’s core semi rule supports always and never modes, but its documentation marks the rule deprecated since ESLint v8.53.0. Check the rule and plugin configuration used by your installed ESLint version rather than copying an old configuration example. The current documentation is at ESLint’s semi rule page.

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

Understand the semicolon-free edge case

JavaScript’s automatic semicolon insertion does not mean every line break ends a statement. A new line beginning with certain tokens can continue the preceding expression instead. ESLint’s no-unexpected-multiline documentation identifies continuation-sensitive tokens including [, (, +, *, /, -, and .. That is why Prettier’s semi: false mode can still add a semicolon at the beginning of a line when it may prevent an ASI problem.

Apply the fix and verify the workflow

  1. Inspect the repository: identify its formatter configuration, ESLint rules, package versions, and editor save actions.
  2. Choose the convention: retain the project’s established style unless the team intentionally agrees to change it.
  3. Configure Prettier: set semi: true or semi: false in the project configuration.
  4. Remove the overlap: if Prettier owns formatting, use eslint-config-prettier to turn off conflicting stylistic rules, while retaining lint rules for code quality.
  5. Test a representative file: run the formatter and linter, then save the file in the editor. If each command passes alone but saving changes the same lines repeatedly, investigate the editor’s formatter and fix-on-save configuration.

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
PC Slower Than It Used to Be?Free scan - under a minute

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.