onecentlin / laravel-blade-snippets-vscode

Laravel blade snippets and syntax highlight support for Visual Studio Code
MIT License
137 stars 38 forks source link

Update BladeFormatter.ts #167

Closed 1cbyc closed 8 months ago

1cbyc commented 1 year ago

The code looks great but here are a few changes that might be helpful. I literally made 'newLine' and 'indentPattern' private, since they don't need to be accessed from outside the class literally. However, I added a return statement to the 'format' method to return the formatted input text with existing trailing white spaces removed. It might not be necessary, but I used the nullish coalescing operator ('??') instead of the 'typeof' check to set the default value for 'insertSpaces'.