diff --git a/arkui-plugins/package.json b/arkui-plugins/package.json index 929c12377e1d5259d15b24c986a6e41ff93b5e70..99b4cbda4cab71cfec7107339fccf4a0f07e180f 100644 --- a/arkui-plugins/package.json +++ b/arkui-plugins/package.json @@ -31,6 +31,7 @@ "typescript": "^5.0.0" }, "dependencies": { - "@koalaui/libarkts": "../koala-wrapper" + "@koalaui/libarkts": "../koala-wrapper", + "json5": "2.2.3" } } diff --git a/arkui-plugins/ui-syntax-plugins/utils/index.ts b/arkui-plugins/ui-syntax-plugins/utils/index.ts index 0e3f34341be809724e5b4355f51a60b3c9707c88..0f01d41d95b978ea5d020f70037c456a8697761e 100644 --- a/arkui-plugins/ui-syntax-plugins/utils/index.ts +++ b/arkui-plugins/ui-syntax-plugins/utils/index.ts @@ -16,6 +16,7 @@ import * as arkts from '@koalaui/libarkts'; import * as fs from 'fs'; import * as path from 'path'; +import JSON5 from 'json5'; import { UISyntaxRuleContext } from 'ui-syntax-plugins/rules/ui-syntax-rule'; export const EXCLUDE_EXTERNAL_SOURCE_PREFIXES: Array = [ @@ -443,7 +444,7 @@ export function readJSON(path: string): T | null { if (!content) { return null; } - return JSON.parse(content) as T; + return JSON5.parse(content) as T; } export function tracePerformance any>(name: string, fn: T): T {