From 4becc915a2aecd930f5f4c8547cee002c4d8f205 Mon Sep 17 00:00:00 2001 From: Samuel Imolorhe Date: Wed, 6 Dec 2023 18:34:12 +0100 Subject: [PATCH] lint json in environment manager --- .../environment-manager/environment-manager.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/altair-app/src/app/modules/altair/components/environment-manager/environment-manager.component.ts b/packages/altair-app/src/app/modules/altair/components/environment-manager/environment-manager.component.ts index d00d42c954..61037410af 100644 --- a/packages/altair-app/src/app/modules/altair/components/environment-manager/environment-manager.component.ts +++ b/packages/altair-app/src/app/modules/altair/components/environment-manager/environment-manager.component.ts @@ -15,9 +15,10 @@ import { EnvironmentState, } from 'altair-graphql-core/build/types/state/environments.interfaces'; import { Extension } from '@codemirror/state'; -import { json } from '@codemirror/lang-json'; +import { json, jsonParseLinter } from '@codemirror/lang-json'; import { Options as SortableOptions, SortableEvent } from 'sortablejs'; import { TODO } from 'altair-graphql-core/build/types/shared'; +import { linter } from '@codemirror/lint'; (window as any).jsonlint = (window as any).jsonlint || { parser: { parse: function (str: string) { @@ -57,10 +58,7 @@ export class EnvironmentManagerComponent implements OnInit, OnChanges { @ViewChild('subEnvironmentTitle') subEnvironmentTitleEl?: ElementRef; - editorExtensions: Extension[] = [ - json(), - // jsonParseLinter, - ]; + editorExtensions: Extension[] = [json(), linter(jsonParseLinter())]; selectedEnvironmentId = 'base'; selectedEnvironment?: EnvironmentState;