vue-codemirror icon indicating copy to clipboard operation
vue-codemirror copied to clipboard

lint is not triggered on change

Open marekkaczkowski opened this issue 8 years ago • 3 comments

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! :)

marekkaczkowski avatar Nov 30 '17 15:11 marekkaczkowski

Hey did you get any update on this issue from @surmon-china ?

satishk88 avatar Jun 26 '19 09:06 satishk88

@satishk88 unfortunately not. I abandoned this feature as it wasn't a must-have.

marekkaczkowski avatar Jun 27 '19 12:06 marekkaczkowski

@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)

pavl1 avatar Sep 18 '19 09:09 pavl1