-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Area:EditorFor CodeMirror-related featuresFor CodeMirror-related featuresEnhancementImprovement to an existing featureImprovement to an existing feature
Description
This issue is part of the ongoing work to upgrade CodeMirror from v5 to v6 (see the parent issue for additional context). This issue references the develop-codemirror-v6 branch, and not the main develop branch.
Increasing Access
As we're preparing to release the new CodeMirror v6 feature, we want to ensure that commonly used file types receive consistent editor feedback. At the moment, JavaScript, HTML, and CSS files have linting feedback, but JSON files will not raise syntax errors. Adding a JSON linter will help users more easily catch and correct any errors in these files.
Feature Details
The editor's linting behavior is currently setup in stateUtils.js, specifically within the getFileLinter() function on line 233. The image below shows what linting would look like:
Suggestions to Start
- Review how linting is setup for each case in
getFileLinter()for HTML, CSS, and JavaScript. Afterwards, add a case for JSON using CodeMirror's linting infrastructure (@codemirror/lint). - Ensure that the linter detects invalid JSON syntax and highlights the correct location within the editor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area:EditorFor CodeMirror-related featuresFor CodeMirror-related featuresEnhancementImprovement to an existing featureImprovement to an existing feature