💅 useStrictMode mangles leading comments and shebangs in .cjs files #4841
Labels
A-Linter
Area: linter
good first issue
Good for newcomers
L-JavaScript
Language: JavaScript and super languages
S-Bug-confirmed
Status: report has been confirmed as a valid bug
S-Help-wanted
Status: you're familiar with the code base and want to help the project
Environment information
Rule name
useStrictMode
Playground link
https://biomejs.dev/playground/?lintRules=all&files.main.cjs=LwAvACAAYwBvAG0AbQBlAG4AdAA%3D
Expected result
When the input file has extension .cjs, and does not have a "use strict" directive, and the first line of the file is a comment or a shebang, it will apply an incorrect fix.
With leading comments -
Input file:
// leading comment
After applying fix:
With shebang -
Input file:
After applying fix:
Code of Conduct
The text was updated successfully, but these errors were encountered: