Skip to content

Commit e97c749

Browse files
committed
docs: add docs
1 parent f5c426c commit e97c749

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

docs/rules/no-use-computed-property-like-method.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,55 @@
22
pageClass: rule-details
33
sidebarDepth: 0
44
title: vue/no-use-computed-property-like-method
5-
description: disallow use computed properties like methods
5+
description: disallow use computed property like method
66
---
7+
8+
# vue/no-use-computed-property-like-method
9+
> disallow use computed property like method
10+
11+
## :book: Rule Details
12+
13+
This rule disallows to use computed property like method.
14+
15+
<eslint-code-block :rules="{'vue/no-use-computed-property-like-method': ['error']}">
16+
17+
```vue
18+
<template>
19+
<div>
20+
</div>
21+
</template>
22+
23+
<script>
24+
export default {
25+
props: {
26+
name: {
27+
type: String
28+
},
29+
},
30+
computed: {
31+
isExpectedName() {
32+
return this.name === 'name';
33+
}
34+
},
35+
methods: {
36+
getName() {
37+
return this.isExpectedName
38+
},
39+
getNameCallLikeMethod() {
40+
return this.isExpectedName()
41+
}
42+
}
43+
}
44+
</script>
45+
```
46+
47+
</eslint-code-block>
48+
49+
## :wrench: Options
50+
51+
Nothing.
52+
53+
## :mag: Implementation
54+
55+
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/no-use-computed-property-like-method.js)
56+
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/no-use-computed-property-like-method.js)

lib/rules/no-use-computed-property-like-method.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
meta: {
2424
type: 'problem',
2525
docs: {
26-
description: 'enforce',
26+
description: 'disallow use computed property like method',
2727
categories: undefined,
2828
url:
2929
'https://eslint.vuejs.org/rules/no-use-computed-property-like-method.html'

0 commit comments

Comments
 (0)