We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to allow (and/or force) the top-level HTML tags in <template> section to be unindented.
<template>
Currently, 'vue/html-indent': 'error' forces this indentation:
'vue/html-indent': 'error'
<template> <div> <p>{{ hello }}</p> </div> </template>
this indentation contradicts the default styles for both <style> and <script> tags where the inner content is not indented, e.g.:
<style>
<script>
<style> body { color: red; } </style> <script lang="ts"> import Vue from 'vue' export default Vue.extend({ ... }) </script>
It's a common practice to NOT indent top-level HTML elements in a HTML document. See https://www.w3schools.com/html/html5_syntax.asp examples where elements under <html> are not indented:
<html>
<!DOCTYPE html> <html> <title>Page Title</title> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html>
I want to use this approach in Vue templates, so the example above will look like:
vue/html-indent options may have a new parameter such as contentIndent: 0 (other variants: topLevelIndent: 0, topLevelIndent: false).
vue/html-indent
contentIndent: 0
topLevelIndent: 0
topLevelIndent: false
The text was updated successfully, but these errors were encountered:
This option would be much appreciated. Another naming variant: rootIndent: 0
rootIndent: 0
Sorry, something went wrong.
Thank you for the issue.
This looks a duplicate of #292. Please track that.
No branches or pull requests
Tell us about your environment
The problem you want to solve
I would like to allow (and/or force) the top-level HTML tags in
<template>
section to be unindented.Currently,
'vue/html-indent': 'error'
forces this indentation:this indentation contradicts the default styles for both
<style>
and<script>
tags where the inner content is not indented, e.g.:It's a common practice to NOT indent top-level HTML elements in a HTML document. See https://www.w3schools.com/html/html5_syntax.asp examples where elements under
<html>
are not indented:I want to use this approach in Vue templates, so the example above will look like:
Your take on the correct solution to problem
vue/html-indent
options may have a new parameter such ascontentIndent: 0
(other variants:topLevelIndent: 0
,topLevelIndent: false
).The text was updated successfully, but these errors were encountered: