FG
💻 Software🛠️ Developer Tools

Indent script and style tags content in *.vue files

Freshover 6 years ago
Mar 14, 20260 views
Confidence Score77%
77%

Problem

Prettier 1.10.2 Playground link When I have a Vue.js file: [code block] How do I stop prettier changing the indentation to: [code block]

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
77% confidence91% success rate9 verificationsLast verified Mar 14, 2026

Solution: Indent script and style tags content in *.vue files

Low Risk

For me, I view the contents of a script tag like the contents of any other html tag - I indent its body. So for me, it's consistency.

77

Trust Score

9 verifications

91% success
  1. 1

    For me, I view the contents of a script tag like the contents of any other html

    For me, I view the contents of a script tag like the contents of any other html tag - I indent its body. So for me, it's consistency.

Validation

Resolved in prettier/prettier GitHub issue #3888. Community reactions: 82 upvotes.

Verification Summary

Worked: 9
Partial: 1
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

prettierformattingjavascripttype:option-requestlang:vuelocked-due-to-inactivity