You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A client developer is seeing this eslint error when running yarn lint:
$yarn lint
yarn run v1.22.10
$ yarn lint:js
$ eslint --ext .js,.jsx .
TypeError: Cannot read property 'range' of null
Occurred while linting xyz.jsx:1
The bug is triggered by a template string in a loop preceded by an optional chaining operator. This error prevents teamcity builds from succeeding as well.
The issue in the project can be resolved by not using an optional chaining operator in that jsx file, but
it might be worth seeing if the issue can be resolved by migrating from
use of parser: 'babel-eslint',
to parser: "@babel/eslint-parser"
in this project's (eslint-config) index.js file
But, @babel/eslint-parser comes with a pretty big new requirement: it must have a babel config file.
Our current babel config is inside our @xh/hoist-dev-utils project's configureWebpack.js file.
I ended up copying what I felt were the bits relevant for linting in a new babel.config.js file in @xh/eslint-config.
There may be a way to DRY this up, perhaps by having the configureWebpack.js import the @xh/eslint-configbabel.config.js into its babel-loader section, and merge it with the bits of the babel config that have more to do with targeting and bundling.
But I thought some discussion would be better before spending time on that.
A client developer is seeing this eslint error when running yarn lint:
The bug is triggered by a template string in a loop preceded by an optional chaining operator. This error prevents teamcity builds from succeeding as well.
The bug is reproduced in this toolbox branch:
https://github.com/xh/toolbox/tree/babel-eslint-bug
This issue is discussed extensively here:
babel/babel-eslint#799
The issue in the project can be resolved by not using an optional chaining operator in that jsx file, but
it might be worth seeing if the issue can be resolved by migrating from
use of
parser: 'babel-eslint',
to
parser: "@babel/eslint-parser"
in this project's (eslint-config) index.js file
as is described here:
https://babeljs.io/blog/2020/07/13/the-state-of-babel-eslint
The text was updated successfully, but these errors were encountered: