Skip to content

Commit

Permalink
Improve vue/multi-word-component-names rule docs (#1871)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjfresh authored Apr 26, 2022
1 parent 635c338 commit 309cace
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/rules/multi-word-component-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,47 @@ export default {

</eslint-code-block>

<eslint-code-block filename="src/Todo.vue" :rules="{'vue/multi-word-component-names': ['error']}">

```vue
<!-- filename: Todo.vue -->
<!-- ✗ BAD -->
<script setup>
// ...
</script>
```

</eslint-code-block>

<eslint-code-block filename="src/TodoItem.js" :rules="{'vue/multi-word-component-names': ['error']}">

```vue
<!-- filename: TodoItem.vue -->
<!-- ✓ GOOD -->
<script setup>
// ...
</script>
```

</eslint-code-block>

<eslint-code-block filename="src/Todo.vue" :rules="{'vue/multi-word-component-names': ['error']}">

```vue
<!-- filename: Todo.vue -->
<!-- ✓ GOOD -->
<script setup>
// ...
</script>
<script>
export default {
name: 'TodoItem'
}
</script>
```

</eslint-code-block>

## :wrench: Options

```json
Expand Down Expand Up @@ -116,6 +157,18 @@ export default {

</eslint-code-block>

<eslint-code-block filename="src/Todo.vue" :rules="{'vue/multi-word-component-names': ['error', {ignores: ['Todo']}]}">

```vue
<!-- filename: Todo.vue -->
<!-- ✓ GOOD -->
<script setup>
// ...
</script>
```

</eslint-code-block>

## :books: Further Reading

- [Style guide - Multi-word component names](https://vuejs.org/style-guide/rules-essential.html#use-multi-word-component-names)
Expand Down

0 comments on commit 309cace

Please sign in to comment.