-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
🚀 Feature Proposal
Prettier applied on a .vue file will remove the base indentation of <script> and <style> content:
Input:
<script>
console.log('Hello World!');
</script>Output:
<script>
console.log('Hello World!');
</script>Not everyone is happy with this tho: prettier/prettier#3888
Prettyhtml actually do the opposite:
Input:
<script>
console.log('Hello World!');
</script>Output:
<script>
console.log('Hello World!');
</script>Desired output
There are two solutions imo:
- Follow the current convention established by Vue guidelines and followed by Prettier: remove initial indentation on <script> and <style> content
- Be flexible and align the base indentation with the first line of the element. For instance:
Input:
<script>
console.log('Hello');
console.log('World!');
</script>Output:
<script>
console.log('Hello');
console.log('World!');
</script>Input:
<script>
console.log('Hello');
console.log('World!');
</script>Output:
<script>
console.log('Hello');
console.log('World!');
</script>Motivation
Either respect the current Vue / Prettier convention, or respect the current initial base indentation.