Babel compile html-entities@1.2.1
code generate invalid JavaScript code
#11338
Labels
i: bug
i: regression
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Bug Report
Current Behavior
When using
babel
to compilehtml-entities
fromnode_modules
, specifically when using the the following environment and configuration file, using the commandbabel --config-file ./babel.config.js node_modules/html-entities/lib/html5-entities.js > ~/Desktop/html5-entities.js
, the generated code is invalid.Original source code:
Generated source code
Input Code
Expected behavior/code
Should not convert subscription format into dot format when the key is an empty string.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
babel.config.js
Environment
cli
,babel-loader
, both displays the same resultPossible Solution
Determine if key to an object is an empty string, if it is then it should not be converted to . (dot notation).
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered: