Visual Studio Code - Which extension to format CFML

Hi all, what extension are you using to format CFML code on VS Code?

1 Like

This is a good question. I really didn’t find the perfect one for cfml cftags cfscript, but the best one I could get good results with is beautify. After some time, I’ve found the coding standards from Ortus Solutions, and within their repositories a real good .jsbeautifyrc file I wish I’d have found iearlier. I can warmly recommend it to you. Of course, you can tweak it as you want. Here you are

1 Like

If you want automatic formatting, look into CFFormat. it’s a CLI tool that has a watcher that can auto-format as you save. It’s not a proper VSCode plugin, but it is super configurable. You can see the formatting defaults Ortus uses in our coldbox templates in the .cfformat.json file

2 Likes

Thanks both, gonna check it out :+1:

@bdw429s just saw this video you’ve recorded. Thanks for that!!!

https://youtu.be/XscTjfrDveU

2 Likes

I use this one:

https://marketplace.visualstudio.com/items?itemName=KamasamaK.vscode-cfml

We use CFFormat before we push.

1 Like