Software Development

แก้ปัญหา formatter ใน vscode/cursor ไม่ทำงานในไฟล์ templ

วิธีแก้ปัญหาเมื่อ vscode/cursor ไม่ทำการ format ไฟล์ .templ ได้อย่างถูกต้อง
แก้ปัญหา formatter ใน vscode/cursor ไม่ทำงานในไฟล์ templ
Share this

วิธีแก้ปัญหาเมื่อ vscode/cursor ไม่ทำการ format ไฟล์ .templ ได้อย่างถูกต้อง

ให้ทำการเปิด settings.json ของ vscode/cursor แล้วเพิ่ม code ด้านล่างนี้เข้าไป

{
    "editor.formatOnSave": true,
    "[templ]": {
        "editor.defaultFormatter": "a-h.templ"
    },
{

อ้างอิง: https://github.com/a-h/templ/issues/230

Post Views: 196