# Code formatting in VS Code

**URL:** <https://community.hubspot.com/t/code-formatting-in-vs-code/141853>\
**Category:** CMS Development\
**Tags:** free\
**Created:** [October 30, 2025, 6:54pm UTC](https://community.hubspot.com/t/code-formatting-in-vs-code/141853 "2025-10-30T18:54:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danbraun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danbraun/32/76793_2.png) [@danbraun](https://community.hubspot.com/u/danbraun)\
**Post date:** [October 30, 2025, 6:54pm UTC](https://community.hubspot.com/t/code-formatting-in-vs-code/141853/1 "2025-10-30T18:54:33Z")

</div>

I have the Prettier, Hubspot extensions installed and have installed the npm plugin package:

{

“devDependencies”: {

“@hubspot/prettier-plugin-hubl”: “^0.2.5”

}

}  
I have in my user settings json:

{

“files.associations”: {

“\*.html”: “html-hubl”,

“\*.css”: “css-hubl”

},

}

I have correctly selected the file type in vscode for each:

![160075i32BF5FEDCE8CEEDA.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/0/90bef70df22a4e10fc4000c8a84a634ecc5bfcce.png)

![160076iC2FBF6DD84467C80.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/1/81e9b002abd6214c1dc9306fd2c91bfaf0620d23.png)

Running format command messes up html files by placing all hubl on one line.

 ![160074i1FF5AF0F4C18FBEB.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/f/5f049d737cd4f846fe05d8832acb05f0323dfd49.png)

CSS files with hubl won’t even format, prettier breaks on first encounter with hubl:

[“ERROR” - 1:34:14 PM] CssSyntaxError: Unknown word (5:2)

3 | \*/

4 |

\> 5 | {% include ‘./resets/\_reset.css’ %}  
…  
What could I be messing or is this not possible today?

---

<div class="post-metadata">

**Author:** ![STierney](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stierney/32/186066_2.png) [@STierney](https://community.hubspot.com/u/STierney)\
**Post date:** [October 30, 2025, 9:54pm UTC](https://community.hubspot.com/t/code-formatting-in-vs-code/141853/2 "2025-10-30T21:54:21Z")

</div>

Hey @danbraun - thanks for posting in the Community!  
I’d like to tag in some Community experts to see if they have any insight for us! @ashleyidesign, [@Mike\_Eastwood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259), and @alyssamwilie - any thoughts here?  
Shane, Senior Community Moderator

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [September 23, 2026, 2:07pm UTC](https://community.hubspot.com/t/code-formatting-in-vs-code/141853/3 "2026-09-23T14:07:09Z")

</div>

Hi @danbraun

I’ve faced this with HubL files too. Prettier can sometimes get confused by HubL syntax, especially when you have HubL inside your CSS or HTML.

I’d try using the HubSpot/HubL Prettier extension and make sure it’s selected as the formatter for those files. If it still messes up the formatting, I usually just disable formatting on those specific CSS files and format them manually.

I hope this helps you out. Please mark it as **Solution Accepted and Like** to help another Community member.  
This post was created with the assistance of AI tools

Thanks!
