@shopify/lang-jsonc
v1.0.0
Published
JSONC language support for CodeMirror
Downloads
13,088
Keywords
Readme
@shopify/lang-jsonc
CodeMirror 6 Language Support for VS Code's flavour of JSON with Comments. Trailing commas included.
Usage
import { basicSetup } from 'codemirror';
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { jsonc } from '@shopify/lang-jsonc';
new EditorView({
parent: document.getElementById('json-editor'),
state: EditorState.create({
doc: `
{
// this is a comment
"product": "Apple",
/* block comment, with trailing comma */
"price": "1.00$",
}
`
extensions: [
basicSetup,
jsonc(),
],
}),
});
Credits
This project includes code from the following repositories. Thank you for your work!
See ThirdPartyNotices.txt for their licenses.
License
MIT.