eslint error cannot read property 'range' of null
These .eslintrc rules fixed the problem for me:
rules : {
"template-curly-spacing" : "off",
"indent": ["error", 2, {
"ignoredNodes": ["TemplateLiteral"]
}]
}
babel-eslint has been deprecated in favor of @babel/eslint-parser. read here
Here are steps to upgrade from babel-eslint to @babel/eslint-parser:
- replace babel-eslint with @babel/eslint-parser:
npm
npm uninstall babel-eslint babel-eslint-plugin
npm install --save-dev @babel/eslint-parser @babel/eslint-plugin
Yarn
yarn remove babel-eslint babel-eslint-plugin
yarn add --dev @babel/eslint-parser @babel/eslint-plugin
- Upgrade .eslintrc.js:
module.exports = { --- parser: "babel-eslint", +++ parser: "@babel/eslint-parser" plugins: [ --- "babel" +++ "@babel ] };
As @Vasan mentioned, specifically, on issue 530, this was the comment that helped me to solve the issue:
Most likely the issue is causing of wrong parsing.
import(`some_path/${variable}`) // issue exists
Fix
import("some_path" + variable) // issue fixed