Skip to content
Advertisement

React-codemirror 2 linting feature not working

I have created a react-codemirror 2 component in my react app but the linting feature of the package is not working. I tried browsing other stack overflow questions but since the questions are at least 2 years old it looks like the file structure for the original library i.e. codemirror has been changed and none of the solution seem to work. I also opened an issue in their Github repo but no response on that. Hope you can help, here’s the code for my component.

JavaScript

Advertisement

Answer

The lint addon from CodeMirror requires jshint library. If you add it (npm i jshint), the following code should work:

JavaScript
Advertisement