-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Fix] Ignore hashbang and BOM while parsing #2431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ESLint does this outside their espree parser, so we need to do it as well. Just like ESLint, the code will convert hashbang to comments and strip off the BOM completely before handing the content to the parser.
Codecov Report
@@ Coverage Diff @@
## main #2431 +/- ##
=======================================
Coverage 95.18% 95.19%
=======================================
Files 66 66
Lines 2783 2787 +4
Branches 935 936 +1
=======================================
+ Hits 2649 2653 +4
Misses 134 134
Continue to review full report at Codecov.
|
93f7a98
to
d8da3f3
Compare
646e864
to
d0367fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Rebased and split up into 4 separate tests (all variants of bom,hashbang and one test without any of them). |
ESLint does this outside their espree parser, so we need to do it as well. Just like ESLint, the code will convert hashbang to comments and strip off the BOM completely before handing the content to the parser.
Fixes: #1369