Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion client/modules/IDE/components/Editor/stateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import {

import { css } from '@codemirror/lang-css';
import { html } from '@codemirror/lang-html';
import { json } from '@codemirror/lang-json';
import { json, jsonParseLinter } from '@codemirror/lang-json';
import { xml } from '@codemirror/lang-xml';
import { linter } from '@codemirror/lint';
import { JSHINT } from 'jshint';
Expand Down Expand Up @@ -230,6 +230,15 @@ function makeJsLinter(callback) {
};
}

function makeJsonLinter(callback) {
const baseJsonLinter = jsonParseLinter();
return (view) => {
const diagnostics = baseJsonLinter(view);
if (callback) callback(diagnostics);
return diagnostics;
};
}

function getFileLinter(fileName, callback) {
const fileMode = getFileMode(fileName);

Expand All @@ -240,6 +249,8 @@ function getFileLinter(fileName, callback) {
return linter(makeHtmlLinter(callback));
case 'css':
return linter(makeCssLinter(callback));
case 'application/json':
return linter(makeJsonLinter(callback));
default:
return null;
}
Expand Down
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"@babel/core": "^7.14.6",
"@babel/parser": "^7.27.5",
"@babel/register": "^7.14.5",
"@babel/traverse": "^7.27.4",
"@codemirror/autocomplete": "^6.18.6",
"@codemirror/commands": "^6.8.1",
"@codemirror/lang-css": "^6.3.1",
Expand All @@ -226,20 +227,19 @@
"@codemirror/language": "^6.11.0",
"@codemirror/lint": "^6.8.5",
"@codemirror/search": "^6.5.11",
"@codemirror/state": "^6.5.2",
"@codemirror/state": "^6.6.0",
"@codemirror/view": "^6.36.5",
"@emmetio/codemirror6-plugin": "^0.4.0",
"@babel/traverse": "^7.27.4",
"@emmetio/codemirror-plugin": "^1.2.4",
"@emmetio/codemirror6-plugin": "^0.4.0",
"@gatsbyjs/webpack-hot-middleware": "^2.25.3",
"@lezer/highlight": "^1.2.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@redux-devtools/core": "^3.11.0",
"@redux-devtools/dock-monitor": "^3.0.1",
"@redux-devtools/log-monitor": "^4.0.2",
"@reduxjs/toolkit": "^1.9.3",
"@uiw/codemirror-extensions-color": "^4.23.12",
"@types/express": "^5.0.3",
"@uiw/codemirror-extensions-color": "^4.23.12",
"acorn": "^8.14.1",
"acorn-walk": "^8.3.4",
"async": "^3.2.3",
Expand Down
Loading