Aleksey Dorogov freelance software engineer
← All writing JavaScript / Node.js

How to fix JavaScript and JSON error in Sublime with CodeFormatter package

Aug 2024 1 min read Aleksey Dorogov

For the last several months I try to migrate from PHPStorm to Sublime or Atom code editors. The reasons for my decision deserve a separate story, and I will write about it little soon. But now, I want to share how to fix a bug message when you try to format javascript or JSON code in Sublime Text 3 wit CodeFormatter package. So, if you got the message

CodeFormatter

Formatter for this file type (json (javascriptnext)) not found

Let’s got to settings, and push some changes.

Just open Preferences -> Package Settings -> CodeFormatter -> Settings - User and place the next code

{
  "codeformatter_js_options":
  {
    "indent_size": 2,
    "syntaxes": "javascript,json,javascriptnext,json (javascriptnext)",
    "preserve_newlines": true
  }
}

And everything will work properly.

Have a nice day!

Sitting on a version of this problem right now? I'd rather look at it than guess.

Email me
Site down? Message me now Live chat · usually reply in minutes