Repository: vuejs/eslint-plugin-vue
Pull request #1011 (2019-12-26 03:52:56)

Change document style for new rules added & Fixed new rule test cases to work with eslint v6


Patch:
diff --git a/docs/rules/README.md b/docs/rules/README.md
index 520e84fc..b77661eb 100644
--- a/docs/rules/README.md
+++ b/docs/rules/README.md
@@ -154,9 +154,11 @@ For example:
 | [vue/no-boolean-default](./no-boolean-default.md) | disallow boolean defaults | :wrench: |
 | [vue/no-deprecated-scope-attribute](./no-deprecated-scope-attribute.md) | disallow deprecated `scope` attribute (in Vue.js 2.5.0+) | :wrench: |
 | [vue/no-empty-pattern](./no-empty-pattern.md) | disallow empty destructuring patterns |  |
+| [vue/no-reserved-component-names](./no-reserved-component-names.md) | disallow the use of reserved names in component definitions |  |
 | [vue/no-restricted-syntax](./no-restricted-syntax.md) | disallow specified syntax |  |
 | [vue/object-curly-spacing](./object-curly-spacing.md) | enforce consistent spacing inside braces | :wrench: |
 | [vue/require-direct-export](./require-direct-export.md) | require the component to be directly exported |  |
+| [vue/require-name-property](./require-name-property.md) | require a name property in Vue components |  |
 | [vue/script-indent](./script-indent.md) | enforce consistent indentation in `<script>` | :wrench: |
 | [vue/space-infix-ops](./space-infix-ops.md) | require spacing around infix operators | :wrench: |
 | [vue/space-unary-ops](./space-unary-ops.md) | enforce consistent spacing before or after unary operators | :wrench: |
diff --git a/docs/rules/no-reserved-component-names.md b/docs/rules/no-reserved-component-names.md
index 57a00859..8f5a1b6c 100644
--- a/docs/rules/no-reserved-component-names.md
+++ b/docs/rules/no-reserved-component-names.md
@@ -1,8 +1,12 @@
+---
+pageClass: rule-details
+sidebarDepth: 0
+title: vue/no-reserved-component-names
+description: disallow the use of reserved names in component definitions
+---
 # vue/no-reserved-component-names
 > disallow the use of reserved names in component definitions
 
-- :gear: This rule is included in all of `"plugin:vue/essential"`, `"plugin:vue/recommended"`, and `"plugin:vue/strongly-recommended"`.
-
 ## :book: Rule Details
 
 This rule prevents name collisions between vue components and standard html elements. 
@@ -25,4 +29,9 @@ export default {
 - [List of html elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)
 - [List of SVG elements](https://developer.mozilla.org/en-US/docs/Web/SVG/Element)
 - [Kebab case elements](https://stackoverflow.com/questions/22545621/do-custom-elements-require-a-dash-in-their-name/22545622#22545622)
-- [Valid custom element name](https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name)
\ No newline at end of file
+- [Valid custom element name](https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name)
+
+## :mag: Implementation
+
+- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/no-reserved-component-names.js)
+- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/no-reserved-component-names.js)
diff --git a/docs/rules/require-name-property.md b/docs/rules/require-name-property.md
index 7217cb52..8b6959f3 100644
--- a/docs/rules/require-name-property.md
+++ b/docs/rules/require-name-property.md
@@ -2,10 +2,10 @@
 pageClass: rule-details
 sidebarDepth: 0
 title: vue/require-name-property
-description: require a component name property
+description: require a name property in Vue components
 ---
 # vue/require-name-property
-> require a component name property
+> require a name property in Vue components
 
 ## :book: Rule Details
 
@@ -19,11 +19,27 @@ This rule requires a `name` property to be set on components.
 export default {
   name: 'OurButton'
 }
+</script>
+```
+
+</eslint-code-block>
 
+<eslint-code-block :rules="{'vue/require-name-property': ['error']}">
+
+```vue
+<script>
 /* ✗ BAD */
 export default {
 }
+</script>
+```
+
+</eslint-code-block>
 
+<eslint-code-block :rules="{'vue/require-name-property': ['error']}">
+
+```vue
+<script>
 /* ✗ BAD */
 export default {
   notName: 'OurButton'
diff --git a/docs/rules/static-class-names-order.md b/docs/rules/static-class-names-order.md
index 6bb07a6f..8b27dc28 100644
--- a/docs/rules/static-class-names-order.md
+++ b/docs/rules/static-class-names-order.md
@@ -9,7 +9,9 @@ description: enforce static class names order
 
 - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
 
-### Example
+## :book: Rule Details
+
+This rule aims to enforce the order of static class names.
 
 <eslint-code-block fix :rules="{'vue/static-class-names-order': ['error']}">
 
@@ -25,11 +27,9 @@ description: enforce static class names order
 
 </eslint-code-block>
 
-## :books: Further reading
-
-- [static-class-names-order]
+## :wrench: Options
 
-[static-class-names-order]: https://eslint.org/docs/rules/static-class-names-order
+Nothing.
 
 ## :mag: Implementation
 
diff --git a/lib/index.js b/lib/index.js
index 4bc6b9f9..8a2fd803 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -42,6 +42,7 @@ module.exports = {
     'no-empty-pattern': require('./rules/no-empty-pattern'),
     'no-multi-spaces': require('./rules/no-multi-spaces'),
     'no-parsing-error': require('./rules/no-parsing-error'),
+    'no-reserved-component-names': require('./rules/no-reserved-component-names'),
     'no-reserved-keys': require('./rules/no-reserved-keys'),
     'no-restricted-syntax': require('./rules/no-restricted-syntax'),
     'no-shared-component-data': require('./rules/no-shared-component-data'),
@@ -60,6 +61,7 @@ module.exports = {
     'require-component-is': require('./rules/require-component-is'),
     'require-default-prop': require('./rules/require-default-prop'),
     'require-direct-export': require('./rules/require-direct-export'),
+    'require-name-property': require('./rules/require-name-property'),
     'require-prop-type-constructor': require('./rules/require-prop-type-constructor'),
     'require-prop-types': require('./rules/require-prop-types'),
     'require-render-return': require('./rules/require-render-return'),


Test patch:
diff --git a/tests/lib/rules/no-reserved-component-names.js b/tests/lib/rules/no-reserved-component-names.js
index 6d592396..0b5bed15 100644
--- a/tests/lib/rules/no-reserved-component-names.js
+++ b/tests/lib/rules/no-reserved-component-names.js
@@ -297,7 +297,7 @@ ruleTester.run('no-reserved-component-names', rule, {
           }
         </script>
       `,
-      parser: 'vue-eslint-parser',
+      parser: require.resolve('vue-eslint-parser'),
       parserOptions
     },
     {
@@ -309,7 +309,7 @@ ruleTester.run('no-reserved-component-names', rule, {
           }
         </script>
       `,
-      parser: 'vue-eslint-parser',
+      parser: require.resolve('vue-eslint-parser'),
       parserOptions
     }
   ],