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
I've encountered an issue with js-beautify where it incorrectly formats the code when an object literal follows an array declaration without a semicolon. Here's an example of the problematic code:
test()
function test(){
let a = [122, 234]
{
console.info(a)
}
}
Expected Output
The code should have looked like this after beautification:
test()
function test() {
let a = [122, 234];
{
console.info(a)
}
}
Actual Output
The code actually looked like this after beautification:
test()
function test() {
let a = [122, 234] {
console.info(a)
}
}
As you can see, the object literal's opening brace is incorrectly placed on the same line as the array declaration, causing the code to become invalid. The expected output should be:
Steps to Reproduce
Environment
OS:
Settings
The text was updated successfully, but these errors were encountered:
Description
Input
I've encountered an issue with js-beautify where it incorrectly formats the code when an object literal follows an array declaration without a semicolon. Here's an example of the problematic code:
Expected Output
The code should have looked like this after beautification:
Actual Output
The code actually looked like this after beautification:
As you can see, the object literal's opening brace is incorrectly placed on the same line as the array declaration, causing the code to become invalid. The expected output should be:
Steps to Reproduce
Environment
OS:
Settings
The text was updated successfully, but these errors were encountered: