JavaScript’s strict mode adds several useful errors to prevent mistakes. Some of these errors are syntax errors that occur at parse time. Since Prettier’s goal is to format all syntactically valid JavaScript code regardless of whether it will actually run, we’ve opted to leave this error checking to linters, compilers, and the runtime.
// Input
function foo() { var bar = 1; delete bar; }
// Prettier stable
SyntaxError: Deleting local variable in strict mode. (1:31)
> 1 | function foo() { var bar = 1; delete bar; }
| ^
// Prettier main
function foo() {
var bar = 1;
delete bar;
}