independent full stack developer

/ Developer's blog

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

Friday, March 29, 2024

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

CodeDormatter

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, // indentation size
    "syntaxes": "javascript,json,javascriptnext,json (javascriptnext)",
    "preserve_newlines": true
  },
}

And everything will work properly.

Have a nice day!

2885 people already saw it