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
lint addon is not working #89
Comments
Running into the same issue here. So far can't figure out what the problem is. |
Hey gents, I'd appreciate it if you tried my forked branch (see #93) to see if it fixes the problem with lint. |
So, I couldn't get your branch to work and realized in the process that I needed to add <script src="//ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js"></script> to my HTML . Now everything is working for JavaScript atleast 👍 (Just used current version of react-codemirror) |
Got this branch to work just fine. (hint: make sure you have the JSHINT function imported globally) I recommend a merge of this PR. |
This should be fixed now, I've merged the changes in #93 |
I can't seem to get this to work still. Here's my code
What is this missing? |
@depaolif Instead of:
try this:
|
O WOW I fixed it! My problem was I didn't load this ... codemirror/addon/lint/lint.css Boom! God is good 👍 For further clarification here are my imports: import CodeMirror from 'react-codemirror'
import { JSHINT } from 'jshint'
import 'codemirror/addon/lint/lint'
import 'codemirror/addon/lint/javascript-lint'
import 'codemirror/mode/javascript/javascript'
window.JSHINT = JSHINT And don't forget these options: var options = {
mode: 'javascript',
gutters: ['CodeMirror-lint-markers'],
lint: true
} |
import 'codemirror/addon/lint/lint.css';
import 'codemirror/addon/lint/lint'; 👍 |
I've been trying to add javascript-lint gutter markers to my code editor and I haven't been getting anywhere. I am importing the lint.js and javascript-lint.js files from codemirror like I assume I am supposed to do. I have also added the lint and gutter options to my options object like I've also seen. I am getting everything to work properly except the lint gutter markers. Below is the code I am using to make the code editor and the result after I have bundled the code and am running it on my website. Am I doing something wrong? Help is much appreciated, thanks!
Javascipt File
Result
The text was updated successfully, but these errors were encountered: