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后能正常跑起來了.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM