Repository: vuejs/eslint-plugin-vue
Pull request #703 (2018-12-04 07:04:03)

Chore: move component-name-in-template-casing rule to uncategorized
This PR moves `component-name-in-template-casing` to uncategorized from `strongly-recommended` category.

There are some reasons:

1. This rule can break user code by autofix. If a user uses `x-element` Web Component, the rule breaks it. To avoid this broken, the user needs to configure `ignores` option. Therefore, this rule doesn't fit `vue/strongly-recommended` preset.
1. There is a bikeshedding. https://github.com/vuejs/eslint-plugin-vue/pull/397#issuecomment-443663855, https://github.com/vuejs/eslint-plugin-vue/pull/397#issuecomment-443886771, https://github.com/vuejs/eslint-plugin-vue/issues/691#issuecomment-443400173, and https://github.com/vuejs/eslint-plugin-vue/issues/691#issuecomment-443400290. Users which use kebab-casing is much and our style guide allows it.


Patch:
diff --git a/docs/.vuepress/components/eslint-code-block.vue b/docs/.vuepress/components/eslint-code-block.vue
index d7789c7b..13d824a5 100644
--- a/docs/.vuepress/components/eslint-code-block.vue
+++ b/docs/.vuepress/components/eslint-code-block.vue
@@ -1,18 +1,20 @@
 <template>
-  <eslint-editor
-    :linter="linter"
-    :config="config"
-    :code="code"
-    :style="{ height }"
-    class="eslint-code-block"
-    filename="example.vue"
-    language="html"
-    :preprocess="preprocess"
-    :postprocess="postprocess"
-    dark
-    :format="format"
-    :fix="fix"
-  />
+  <div class="eslint-code-container">
+    <eslint-editor
+      :linter="linter"
+      :config="config"
+      :code="code"
+      :style="{ height }"
+      class="eslint-code-block"
+      filename="example.vue"
+      language="html"
+      :preprocess="preprocess"
+      :postprocess="postprocess"
+      dark
+      :format="format"
+      :fix="fix"
+    />
+  </div>
 </template>
 
 <script>
@@ -92,7 +94,7 @@ export default {
 
     height () {
       const lines = this.code.split('\n').length
-      return `${Math.max(120, 20 * (1 + lines))}px`
+      return `${Math.max(120, 19 * lines)}px`
     }
   },
 
@@ -129,8 +131,18 @@ export default {
 </script>
 
 <style>
+.eslint-code-container {
+  border-radius: 6px;
+  padding: 1.25rem 0;
+  margin: 1em 0;
+  background-color: #1e1e1e;
+}
+
 .eslint-code-block {
   width: 100%;
-  margin: 1em 0;
+}
+
+.eslint-editor-actions {
+  bottom: -0.9rem;
 }
 </style>
diff --git a/docs/rules/html-quotes.md b/docs/rules/html-quotes.md
index 5aca1d22..c63dcbd0 100644
--- a/docs/rules/html-quotes.md
+++ b/docs/rules/html-quotes.md
@@ -63,7 +63,7 @@ Default is set to `double`.
 ```
 </eslint-code-block>
 
-## Related links
+## :books: Further reading
 
 - [Style guide - Quoted attribute values](https://vuejs.org/v2/style-guide/#Quoted-attribute-values-strongly-recommended)
 
diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md
index bf1fb7d1..ad0033a1 100644
--- a/docs/user-guide/README.md
+++ b/docs/user-guide/README.md
@@ -150,7 +150,7 @@ If you use `Vetur` plugin, set `"vetur.validation.template": false` to avoid def
 
 Use [SublimeLinter-eslint](https://github.com/SublimeLinter/SublimeLinter-eslint) extension that SublimeLinter provides for eslint.
 
-You have to open command-palette via `cmd/ctrl+shift+p` and type `Preferences: SublimeLinter Settings`, paste to the config on the right side:
+You have to open command-palette via `Cmd/Ctrl+Shift+P` and type `Preferences: SublimeLinter Settings`, paste to the config on the right side:
 
 ```json
 {
@@ -168,7 +168,7 @@ You need to go into `Settings -> Packages -> linter-eslint`, under the option "L
 
 #### IntelliJ IDEA / JetBrains WebStorm
 
-In the **Settings/Preferences** dialog (`Ctrl+Alt+S`), choose JavaScript under **Languages and Frameworks** and then choose **ESLint** under **Code Quality Tools**.
+In the **Settings/Preferences** dialog (`Cmd+,`/`Ctrl+Alt+S`), choose JavaScript under **Languages and Frameworks** and then choose **ESLint** under **Code Quality Tools**.
 On the **ESLint page** that opens, select the *Enable* checkbox.
 
 If your ESLint configuration is updated (manually or from your version control), open it in the editor and choose **Apply ESLint Code Style Rules** on the context menu.
diff --git a/lib/rules/component-name-in-template-casing.js b/lib/rules/component-name-in-template-casing.js
index c48ba50c..05630b19 100644
--- a/lib/rules/component-name-in-template-casing.js
+++ b/lib/rules/component-name-in-template-casing.js
@@ -23,7 +23,7 @@ module.exports = {
     type: 'suggestion',
     docs: {
       description: 'enforce specific casing for the component naming style in template',
-      category: 'strongly-recommended',
+      category: undefined,
       url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0/docs/rules/component-name-in-template-casing.md'
     },
     fixable: 'code',
diff --git a/lib/rules/order-in-components.js b/lib/rules/order-in-components.js
index cc8b4874..b9992daf 100644
--- a/lib/rules/order-in-components.js
+++ b/lib/rules/order-in-components.js
@@ -168,7 +168,7 @@ module.exports = {
         const propertiesAbove = properties.slice(0, i)
         const unorderedProperties = propertiesAbove
           .filter(p => orderMap.get(p.name) > orderMap.get(property.name))
-          .sort((p1, p2) => orderMap.get(p1.name) > orderMap.get(p2.name))
+          .sort((p1, p2) => orderMap.get(p1.name) > orderMap.get(p2.name) ? 1 : -1)
 
         const firstUnorderedProperty = unorderedProperties[0]
 
diff --git a/lib/utils/indent-common.js b/lib/utils/indent-common.js
index c86460da..28e68b0a 100644
--- a/lib/utils/indent-common.js
+++ b/lib/utils/indent-common.js
@@ -895,7 +895,7 @@ module.exports.defineVisitor = function create (context, tokenStore, defaultOpti
       if (!PREFORMATTED_ELEMENT_NAMES.includes(node.name)) {
         const isTopLevel = node.parent.type !== 'VElement'
         const offset = isTopLevel ? options.baseIndent : 1
-        processNodeList(node.children.filter(isNotEmptyTextNode), node.startTag, node.endTag, offset)
+        processNodeList(node.children.filter(isNotEmptyTextNode), node.startTag, node.endTag, offset, false)
       } else {
         const startTagToken = tokenStore.getFirstToken(node)
         const endTagToken = node.endTag && tokenStore.getFirstToken(node.endTag)
@@ -991,7 +991,7 @@ module.exports.defineVisitor = function create (context, tokenStore, defaultOpti
       const firstTokenInfo = offsets.get(tokenStore.getFirstToken(node))
 
       for (const token of tokens) {
-        offsets.set(token, firstTokenInfo)
+        offsets.set(token, Object.assign({}, firstTokenInfo))
       }
     },
 
diff --git a/package.json b/package.json
index f00a94c0..09bbdf61 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
   "files": [
     "lib"
   ],
-  "homepage": "https://github.com/vuejs/eslint-plugin-vue#readme",
+  "homepage": "https://vuejs.github.io/eslint-plugin-vue/",
   "keywords": [
     "eslint",
     "eslint-plugin",


Test patch:
diff --git a/tests/fixtures/html-indent/issue729.vue b/tests/fixtures/html-indent/issue729.vue
new file mode 100644
index 00000000..d9d39660
--- /dev/null
+++ b/tests/fixtures/html-indent/issue729.vue
@@ -0,0 +1,29 @@
+<!--{}-->
+<template>
+  <div>
+    <div>text
+      <a/>
+    </div>
+    <div>text
+      text
+      <a/>
+    </div>
+    <div>text
+      <!-- comment -->
+      <a/>
+    </div>
+    <div>text
+      <!-- comment -->
+    </div>
+    <div><a/>
+      <a/>
+    </div>
+    <div><a/>
+      <!-- comment -->
+      <a/>
+    </div>
+    <div><a/>
+      <a/>
+    </div>
+  </div>
+</template>