Repository: vuejs/eslint-plugin-vue
Pull request #723 (2018-12-13 14:19:24)

docs: Add macOS key bind for opening preference
Hello, this PR fix docs of a key bind description for macOS.


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/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/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))
       }
     },
 


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>