react-codemirror
react-codemirror copied to clipboard
Add custom lint error marker on react-codemirror
I want to display lint errors which I receive from external API. Error information I receive from the API is 1. Line number 2. Error description
I would like to add a custom marker with tooltip in the codemirror gutter area. I've found this answer on stackoverflow https://stackoverflow.com/a/72219083 but unable to implement on react-codemirror.
@venkat-subramani This is not a codemirror 6 solution.
https://codemirror.net/docs/ref/#lint
https://discuss.codemirror.net/t/yaml-linter-for-uiw-react-codemirror-or-codemirror-v6/4976
Example: Linter: https://codemirror.net/examples/lint/
@jaywcjlove Thanks for your response. I'm able to use linter on code area now. Is it possible to display error marker on line numbers in gutter area ?
@venkat-subramani https://codemirror.net/examples/gutter/
Adding lintGutter() in the extensions list added the error marking for my lints.
@venkat-subramani I'm sorry to reopen this thread but could you help with an example of how you used js-yaml
with react-codemirror for the lint source? I'm having trouble according to the link provided