Create formatForType method for handling type formatting (support for HTML, JS, AMD, and CommonJS)