Skip to content

Commit 148cc44

Browse files
committed
refactor: rename
1 parent 3f1ea34 commit 148cc44

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

docs/rules/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ For example:
281281
| [vue/require-prop-comment](./require-prop-comment.md) | require props to have a comment | | :hammer: |
282282
| [vue/require-typed-object-prop](./require-typed-object-prop.md) | enforce adding type declarations to object props | :bulb: | :hammer: |
283283
| [vue/require-typed-ref](./require-typed-ref.md) | require `ref` and `shallowRef` functions to be strongly typed | | :hammer: |
284+
| [vue/restricted-component-names](./restricted-component-names.md) | enforce consistency in component names | | :warning: |
284285
| [vue/script-indent](./script-indent.md) | enforce consistent indentation in `<script>` | :wrench: | :lipstick: |
285286
| [vue/sort-keys](./sort-keys.md) | enforce sort-keys in a manner that is compatible with order-in-components | | :hammer: |
286287
| [vue/static-class-names-order](./static-class-names-order.md) | enforce static class names order | :wrench: | :hammer: |
287288
| [vue/v-for-delimiter-style](./v-for-delimiter-style.md) | enforce `v-for` directive's delimiter style | :wrench: | :lipstick: |
288289
| [vue/v-if-else-key](./v-if-else-key.md) | require key attribute for conditionally rendered repeated components | :wrench: | :warning: |
289290
| [vue/v-on-handler-style](./v-on-handler-style.md) | enforce writing style for handlers in `v-on` directives | :wrench: | :hammer: |
290-
| [vue/valid-component-name](./valid-component-name.md) | enforce consistency in component names | | :warning: |
291291
| [vue/valid-define-options](./valid-define-options.md) | enforce valid `defineOptions` compiler macro | | :warning: |
292292

293293
</rules-table>

docs/rules/no-restricted-component-names.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export default {
8484

8585
</eslint-code-block>
8686

87+
## :couple: Related Rules
88+
89+
- [vue/restricted-component-names](./restricted-component-names.md)
90+
8791
## :rocket: Version
8892

8993
This rule was introduced in eslint-plugin-vue v9.15.0

docs/rules/valid-component-name.md renamed to docs/rules/restricted-component-names.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
pageClass: rule-details
33
sidebarDepth: 0
4-
title: vue/valid-component-name
4+
title: vue/restricted-component-names
55
description: enforce consistency in component names
66
---
77

8-
# vue/valid-component-name
8+
# vue/restricted-component-names
99

1010
> enforce consistency in component names
1111
@@ -15,7 +15,7 @@ description: enforce consistency in component names
1515

1616
This rule enforces consistency in component names.
1717

18-
<eslint-code-block :rules="{ 'vue/valid-component-name': ['error'] }">
18+
<eslint-code-block :rules="{ 'vue/restricted-component-names': ['error'] }">
1919

2020
```vue
2121
<template>
@@ -34,15 +34,15 @@ This rule enforces consistency in component names.
3434

3535
```json
3636
{
37-
"vue/valid-component-name": ["error", {
37+
"vue/restricted-component-names": ["error", {
3838
"allow": []
3939
}]
4040
}
4141
```
4242

4343
### `"allow"`
4444

45-
<eslint-code-block :rules="{'vue/valid-component-name': ['error', { 'allow': ['/^custom-/'] }]}">
45+
<eslint-code-block :rules="{'vue/restricted-component-names': ['error', { 'allow': ['/^custom-/'] }]}">
4646

4747
```vue
4848
<template>
@@ -56,7 +56,11 @@ This rule enforces consistency in component names.
5656

5757
</eslint-code-block>
5858

59+
## :couple: Related Rules
60+
61+
- [vue/no-restricted-component-names](./no-restricted-component-names.md)
62+
5963
## :mag: Implementation
6064

61-
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/valid-component-name.js)
62-
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/valid-component-name.js)
65+
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/restricted-component-names.js)
66+
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/restricted-component-names.js)

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ const plugin = {
231231
'require-typed-ref': require('./rules/require-typed-ref'),
232232
'require-v-for-key': require('./rules/require-v-for-key'),
233233
'require-valid-default-prop': require('./rules/require-valid-default-prop'),
234+
'restricted-component-names': require('./rules/restricted-component-names'),
234235
'return-in-computed-property': require('./rules/return-in-computed-property'),
235236
'return-in-emits-validator': require('./rules/return-in-emits-validator'),
236237
'script-indent': require('./rules/script-indent'),
@@ -253,7 +254,6 @@ const plugin = {
253254
'v-on-style': require('./rules/v-on-style'),
254255
'v-slot-style': require('./rules/v-slot-style'),
255256
'valid-attribute-name': require('./rules/valid-attribute-name'),
256-
'valid-component-name': require('./rules/valid-component-name'),
257257
'valid-define-emits': require('./rules/valid-define-emits'),
258258
'valid-define-options': require('./rules/valid-define-options'),
259259
'valid-define-props': require('./rules/valid-define-props'),

lib/rules/valid-component-name.js renamed to lib/rules/restricted-component-names.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = {
4848
docs: {
4949
description: 'enforce consistency in component names',
5050
categories: undefined,
51-
url: 'https://eslint.vuejs.org/rules/valid-component-name.html'
51+
url: 'https://eslint.vuejs.org/rules/restricted-component-names.html'
5252
},
5353
fixable: null,
5454
schema: [

tests/lib/rules/valid-component-name.js renamed to tests/lib/rules/restricted-component-names.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'use strict'
66

77
const RuleTester = require('../../eslint-compat').RuleTester
8-
const rule = require('../../../lib/rules/valid-component-name')
8+
const rule = require('../../../lib/rules/restricted-component-names')
99

1010
const tester = new RuleTester({
1111
languageOptions: {
@@ -15,7 +15,7 @@ const tester = new RuleTester({
1515
}
1616
})
1717

18-
tester.run('valid-component-name', rule, {
18+
tester.run('restricted-component-names', rule, {
1919
valid: [
2020
'<template><keep-alive></keep-alive></template>',
2121
'<template><button/></template>',

0 commit comments

Comments
 (0)