Skip to content

Commit

Permalink
Apply some Prettier formatting in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Feb 13, 2024
1 parent 36cebcf commit e5640f2
Show file tree
Hide file tree
Showing 83 changed files with 628 additions and 669 deletions.
4 changes: 2 additions & 2 deletions docs/rules/component-api-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
<script>
export default {
/* ✗ BAD */
data () {
data() {
return {
msg: 'Hello World!',
// ...
Expand Down Expand Up @@ -93,7 +93,7 @@ export default {
<script>
export default {
/* ✓ GOOD */
data () {
data() {
return {
msg: 'Hello World!',
// ...
Expand Down
16 changes: 4 additions & 12 deletions docs/rules/component-definition-name-casing.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ export default {

```js
/* ✓ GOOD */
Vue.component('MyComponent', {

})
Vue.component('MyComponent', {})

/* ✗ BAD */
Vue.component('my-component', {

})
Vue.component('my-component', {})
```

</eslint-code-block>
Expand Down Expand Up @@ -108,14 +104,10 @@ export default {

```js
/* ✓ GOOD */
Vue.component('my-component', {

})
Vue.component('my-component', {})

/* ✗ BAD */
Vue.component('MyComponent', {

})
Vue.component('MyComponent', {})
```

</eslint-code-block>
Expand Down
12 changes: 6 additions & 6 deletions docs/rules/component-name-in-template-casing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This rule aims to warn the tag names other than the configured casing in Vue.js
<template>
<!-- ✓ GOOD -->
<CoolComponent />
<!-- ✗ BAD -->
<cool-component />
<coolComponent />
Expand All @@ -62,7 +62,7 @@ export default {
components: {
CoolComponent,
'registered-in-kebab-case': VueComponent1,
'registeredInCamelCase': VueComponent2
registeredInCamelCase: VueComponent2
}
}
</script>
Expand Down Expand Up @@ -108,7 +108,7 @@ export default {
<!-- ✓ GOOD -->
<CoolComponent />
<UnregisteredComponent />
<!-- ✗ BAD -->
<cool-component />
<unregistered-component />
Expand All @@ -131,11 +131,11 @@ export default {
```vue
<template>
<!-- ✓ GOOD -->
<CoolComponent/>
<CoolComponent />
<custom-element></custom-element>
<custom-button></custom-button>
<custom-input />
<!-- ✗ BAD -->
<magic-element></magic-element>
</template>
Expand All @@ -151,7 +151,7 @@ export default {
<template>
<!-- ✓ GOOD -->
<RouterView></RouterView>
<!-- ✗ BAD -->
<router-view></router-view>
</template>
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/custom-event-name-casing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This rule enforces camelCase by default.
<script>
export default {
methods: {
onClick () {
onClick() {
/* ✓ GOOD */
this.$emit('myEvent')
this.$emit('update:myProp', myProp)
Expand Down Expand Up @@ -90,7 +90,7 @@ export default {
<script>
export default {
methods: {
onClick () {
onClick() {
/* ✓ GOOD */
this.$emit('my-event')
Expand Down Expand Up @@ -119,7 +119,7 @@ export default {
<script>
export default {
methods: {
onClick () {
onClick() {
/* ✓ GOOD */
this.$emit('myEvent')
Expand Down Expand Up @@ -149,7 +149,7 @@ export default {
<script>
export default {
methods: {
onClick () {
onClick() {
/* ✓ GOOD */
this.$emit('click:row')
this.$emit('foo-bar')
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/define-props-declaration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This rule only works in setup script and `lang="ts"`.
<script setup lang="ts">
/* ✓ GOOD */
const props = defineProps<{
kind: string,
kind: string
options: { title: string }
}>()
Expand Down Expand Up @@ -59,7 +59,7 @@ const props = defineProps({
/* ✗ BAD */
const props = defineProps<{
kind: string,
kind: string
options: { title: string }
}>()
</script>
Expand Down
1 change: 1 addition & 0 deletions docs/rules/experimental-script-setup-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: vue/experimental-script-setup-vars
description: prevent variables defined in `<script setup>` to be marked as undefined
since: v7.0.0
---

# vue/experimental-script-setup-vars

> prevent variables defined in `<script setup>` to be marked as undefined
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/html-comment-content-newline.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ This rule will enforce consistency of line break after the `<!--` and before the
```

- The first option is either an object with `"singleline"` and `"multiline"` keys.

- `singleline` ... the configuration for single-line comments.
- `"never"` (default) ... disallow line breaks after the `<!--` and before the `-->`.
- `"always"` ... require one line break after the `<!--` and before the `-->`.
Expand All @@ -67,6 +68,7 @@ This rule will enforce consistency of line break after the `<!--` and before the
You can also set the same value for both `singleline` and `multiline` by specifies a string.

- This rule can also take a 2nd option, an object with the following key: `"exceptions"`.

- The `"exceptions"` value is an array of string patterns which are considered exceptions to the rule.

```json
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/html-comment-content-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ Whitespace after the `<!--` and before the `-->` makes it easier to read text in
```

- The first is a string which be either `"always"` or `"never"`. The default is `"always"`.

- `"always"` (default) ... there must be at least one whitespace at after the `<!--` and before the `-->`.
- `"never"` ... there should be no whitespace at after the `<!--` and before the `-->`.

- This rule can also take a 2nd option, an object with the following key: `"exceptions"`.

- The `"exceptions"` value is an array of string patterns which are considered exceptions to the rule.
Please note that exceptions are ignored if the first argument is `"never"`.
Please note that exceptions are ignored if the first argument is `"never"`.

```json
"vue/html-comment-content-spacing": ["error", "always", { "exceptions": ["*"] }]
Expand Down
38 changes: 19 additions & 19 deletions docs/rules/match-component-file-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export default {
```vue
<!-- file name: src/MyComponent.vue -->
<script>
export default {
/* The default does not verify to `.vue`. */
name: 'MComponent',
template: '<div />'
}
export default {
/* The default does not verify to `.vue`. */
name: 'MComponent',
template: '<div />'
}
</script>
```

Expand Down Expand Up @@ -131,11 +131,11 @@ export default {
```vue
<!-- file name: src/MyComponent.vue -->
<script>
export default {
/* ✓ GOOD */
name: 'MyComponent',
template: '<div />'
}
export default {
/* ✓ GOOD */
name: 'MyComponent',
template: '<div />'
}
</script>
```

Expand All @@ -146,11 +146,11 @@ export default {
```vue
<!-- file name: src/MyComponent.vue -->
<script>
export default {
/* ✗ BAD */
name: 'MComponent',
template: '<div />'
}
export default {
/* ✗ BAD */
name: 'MComponent',
template: '<div />'
}
</script>
```

Expand All @@ -161,10 +161,10 @@ export default {
```vue
<!-- file name: src/MyComponent.vue -->
<script>
/* no name property defined */
export default {
template: '<div />'
}
/* no name property defined */
export default {
template: '<div />'
}
</script>
```

Expand Down
8 changes: 4 additions & 4 deletions docs/rules/multi-word-component-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
<!-- filename: Todo.vue -->
<!-- ✗ BAD -->
<script setup>
// ...
// ...
</script>
```

Expand All @@ -95,7 +95,7 @@ export default {
<!-- filename: TodoItem.vue -->
<!-- ✓ GOOD -->
<script setup>
// ...
// ...
</script>
```

Expand All @@ -107,7 +107,7 @@ export default {
<!-- filename: Todo.vue -->
<!-- ✓ GOOD -->
<script setup>
// ...
// ...
</script>
<script>
export default {
Expand Down Expand Up @@ -164,7 +164,7 @@ export default {
<!-- filename: Todo.vue -->
<!-- ✓ GOOD -->
<script setup>
// ...
// ...
</script>
```

Expand Down
33 changes: 17 additions & 16 deletions docs/rules/name-property-casing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: vue/name-property-casing
description: enforce specific casing for the name property in Vue components
since: v3.8.0
---

# vue/name-property-casing

> enforce specific casing for the name property in Vue components
Expand All @@ -19,10 +20,10 @@ This rule aims at enforcing the style for the `name` property casing for consist

```vue
<script>
/* ✓ GOOD */
export default {
name: 'MyComponent'
}
/* ✓ GOOD */
export default {
name: 'MyComponent'
}
</script>
```

Expand All @@ -32,10 +33,10 @@ This rule aims at enforcing the style for the `name` property casing for consist

```vue
<script>
/* ✗ BAD */
export default {
name: 'my-component'
}
/* ✗ BAD */
export default {
name: 'my-component'
}
</script>
```

Expand All @@ -58,10 +59,10 @@ This rule aims at enforcing the style for the `name` property casing for consist

```vue
<script>
/* ✓ GOOD */
export default {
name: 'my-component'
}
/* ✓ GOOD */
export default {
name: 'my-component'
}
</script>
```

Expand All @@ -71,10 +72,10 @@ This rule aims at enforcing the style for the `name` property casing for consist

```vue
<script>
/* ✗ BAD */
export default {
name: 'MyComponent'
}
/* ✗ BAD */
export default {
name: 'MyComponent'
}
</script>
```

Expand Down
Loading

0 comments on commit e5640f2

Please sign in to comment.