vue-codemirror
vue-codemirror copied to clipboard
lint is not triggered on change
Hey Surmon,
I just configured jsonlint and vue-codemirror but it looks like linting is not triggered. I found few problem and walkarounds for them like fixing jsonlint issue
// See https://github.com/zaach/jsonlint/issues/57
node: {
fs: 'empty'
}
import jsonlint from 'jsonlint'
window.jsonlint = jsonlint
require('codemirror/addon/lint/lint.js')
require('codemirror/addon/lint/json-lint.js')
...
<style lang="scss">
@import "~codemirror/addon/lint/lint.css";
$editor.getOption('lint') returns true
Do I have to manually triger linting like editor.lint.json or something?
Thanks for help! :)
Hey did you get any update on this issue from @surmon-china ?
@satishk88 unfortunately not. I abandoned this feature as it wasn't a must-have.
@satishk88 @marekkaczkowski you should replace this:
import jsonlint from 'jsonlint'
window.jsonlint = jsonlint
with the following:
import { parser } from 'jsonlint'
window.jsonlint = parser
It did not work because https://github.com/zaach/jsonlint has multiple named exports, but you need only parser. Checked it on Codemirror 5.20 and @josdejong fork (https://github.com/josdejong/jsonlint)