Validating JSON data

In VS Code, if I have a JSON file open, it will automatically highlight areas that do not validate. For example, if double quotes are missing from a field, VSCode will mark it in red. On Replit, there is no feedback given when JSON is invalid, and I end up sending students to an external validator. I wonder if there is a way to turn on validation / syntax check for JSON.

Hi @harold.sikkema welcome to the community!

This isn’t a feature available in replit at the moment so your solution to use an external validator is the best option.

You can suggest improvements / features using the share feedback option when in any Repl :


This feature of highlighting code is made through lsp(language server protocol), and lsp are supported by replit

Which language(template) do you use with your students in replit?

I’m using HTML, CSS, JS for the language. Is it possible to change LSP settings to allow JSON highlighting in this context?

Click on the three dots on the files tab

Will appear the hidden files, click on the file .replit

Click Switch to code editor

Add this code to the end of the file:

pattern = "**/*.json

start = "vscode-json-language-server --stdio"

Look, ultimately, the file .replit is unstable, this may exclude all of the other languages server, so if this happen, just overcopy the code bellow into the file, wait some seconds(to autosave), and close the .replit file


# hosting is currently hardcoded for this language
# [hosting]
# route = "/"
# directory= "/"

channel = "stable-21_11"

requiredFiles = [".replit", "replit.nix", ".config"]


pattern = "**/*.html"

start = "vscode-html-language-server --stdio"

pattern = "**/{*.js,*.jsx,*.ts,*.tsx,*.mjs,*.cjs}"

start = "typescript-language-server --stdio"

pattern = "**/{*.less,*.scss,*.css}"

start = "vscode-css-language-server --stdio"

pattern = "**/*.json"

start = "vscode-json-language-server --stdio"

Great suggestion @nullmetry !

1 Like