eslint Cannot read property 'range' of null错误

eslint Cannot read property 'range' of null错误

 

手动添加的配置,2个项目OK,还个项目 运行报错

复制代码
Cannot read property 'range' of null
TypeError: Cannot read property 'range' of null
    at SourceCode.getTokenBefore (/Users/jason/my-project/node_modules/eslint/lib/token-store/index.js:303:17)
    at checkSpacingBefore (/Users/jason/my-project/node_modules/eslint/lib/rules/template-curly-spacing.js:51:42)
    at TemplateElement (/Users/jason/my-project/node_modules/eslint/lib/rules/template-curly-spacing.js:116:17)
    at listeners.(anonymous function).forEach.listener (/Users/jason/my-project/node_modules/eslint/lib/util/safe-emitter.js:47:58)
复制代码

3个项目eslint的配置包都是相同版本,最后这个报错的解决方案是将

"babel-eslint": "^8.2.1", 改为 "babel-eslint": "8.0.1",
重新install后能正常跑起来了.

posted on 2019-12-21 15:33  刘应杰  阅读(7858)  评论(0编辑  收藏  举报

导航