我有个index.js 一编辑就报错,卡的不行。我查了下message编辑会报错,而且flycheck 也没有检查出语法错误。
node v14.16.0
eslint v7.29.0
flycheck
Error from syntax checker javascript-eslint: could not parse JSON stream: "unable to decode byte 0xc0", "<callback>", 1, 17946, 18272
我有个index.js 一编辑就报错,卡的不行。我查了下message编辑会报错,而且flycheck 也没有检查出语法错误。
Debugger entered--Lisp error: (json-parse-error "unable to decode byte 0xc0" "<callback>" 1 17968 18294)
json-parse-buffer(:object-type alist :array-type list :null-object nil :false-object nil)
#f(compiled-function () #<bytecode 0x35e6d4d>)()
flycheck-parse-json(#("[{\"filePath\":\"d:\\\\work\\\\comp\\\\MapEditor\\\\packages\\..." 15151 16300 (charset chinese-gbk) 17502 20191 (charset chinese-gbk) 20221 24152 (charset chinese-gbk) 24930 28120 (charset chinese-gbk) 28399 32052 (charset chinese-gbk) 32150 34704 (charset chinese-gbk)))
flycheck-parse-eslint(#("[{\"filePath\":\"d:\\\\work\\\\comp\\\\MapEditor\\\\packages\\..." 15151 16300 (charset chinese-gbk) 17502 20191 (charset chinese-gbk) 20221 24152 (charset chinese-gbk) 24930 28120 (charset chinese-gbk) 28399 32052 (charset chinese-gbk) 32150 34704 (charset chinese-gbk)) javascript-eslint #<buffer index.js>)
flycheck-parse-output(#("[{\"filePath\":\"d:\\\\work\\\\comp\\\\MapEditor\\\\packages\\..." 15151 16300 (charset chinese-gbk) 17502 20191 (charset chinese-gbk) 20221 24152 (charset chinese-gbk) 24930 28120 (charset chinese-gbk) 28399 32052 (charset chinese-gbk) 32150 34704 (charset chinese-gbk)) javascript-eslint #<buffer index.js>)
flycheck-finish-checker-process(javascript-eslint 1 nil #("[{\"filePath\":\"d:\\\\work\\\\comp\\\\MapEditor\\\\packages\\..." 15151 16300 (charset chinese-gbk) 17502 20191 (charset chinese-gbk) 20221 24152 (charset chinese-gbk) 24930 28120 (charset chinese-gbk) 28399 32052 (charset chinese-gbk) 32150 34704 (charset chinese-gbk)) #f(compiled-function (&rest args) #<bytecode 0x1b32c0d>) "d:/work/comp/MapEditor/packages/map-editor/")
flycheck-handle-signal(#<process flycheck-javascript-eslint> "exited abnormally with code 1\n")
但是我直接eslint packages/map-editor/index.js
就很正常的结果
... 省略n行
514:13 error 'Editor' is not defined no-undef
529:12 error 'Editor' is not defined no-undef
534:4 error 'Editor' is not defined no-undef
541:1 error 'Editor' is not defined no-undef
543:3 error 'Editor' is not defined no-undef
547:3 error 'Editor' is not defined no-undef
552:30 error 'Editor' is not defined no-undef
553:31 error 'Editor' is not defined no-undef
554:7 error 'app' is assigned a value but never used no-unused-vars
✖ 83 problems (83 errors, 0 warnings)
是需要指定版本的吗?