1. 程式人生 > >eslint Cannot read property 'range' of null錯誤

eslint Cannot read property 'range' of null錯誤

.get temp 項目 重新 pos spa source list modules

手動添加的配置,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後能正常跑起來了.

eslint Cannot read property 'range' of null錯誤