babel / babel-eslint

:tokyo_tower: A wrapper for Babel's parser used for ESLint (renamed to @babel/eslint-parser)
https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser
MIT License
2.96k stars 208 forks source link

`RegExpLiteral` is not converted to `Literal` in an edge case #838

Closed futpib closed 4 years ago

futpib commented 4 years ago

Broken example:

> require('babel-eslint').parse('1 * /a/').body[0].expression.right.type
'RegExpLiteral'

Changing * to + makes babel-eslint behave properly:

> require('babel-eslint').parse('1 + /a/').body[0].expression.right.type
'Literal'

Version:

$ npm list babel-eslint
eslint-template-visitor@2.1.1 /home/futpib/code/eslint-template-visitor
└── babel-eslint@10.1.0

Of course no one writes x * /a/, but this bug breaks my fuzzing test.

kaicataldo commented 4 years ago

Thanks for the bug report. babel-eslint is currently being moved into the babel/babel monorepo. You can follow along on this issue. I'll be adding this to the list in that issue and take a look at it.

kaicataldo commented 4 years ago

Thank you for the PR. Now that @babel/eslint-parser has been released, we are making this repository read-only. If this is a change you would still like to advocate for, please reopen this in the babel/babel monorepo.