New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to lint code #469
Comments
@Jenny-pyl Here's how to add linting to react-codemirror import CodeMirror from "@uiw/react-codemirror";
import { json, jsonParseLinter } from "@codemirror/lang-json";
import { linter } from "@codemirror/lint";
import { useState } from "react";
export function JsonEditor() {
const [value, setValue] = useState("");
return (
<div>
<CodeMirror
value={value}
onChange={(value) => setValue(value)}
height="200px"
extensions={[json(), linter(jsonParseLinter())]}
/>
</div>
);
} |
Can this be added to the documentatoin or readme? Consider also the very important but almost hiddenly documented lintGutter. |
@fabpico Welcome to update the documentation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use 'uiwjs/react-codemmmirror' to write a 'json-editor' component, but I have no idea about how to lint code.Thanks
The text was updated successfully, but these errors were encountered: