Skip to content

Commit 93ca30f

Browse files
committed
Add documentation changes from code review
1 parent bbf56b5 commit 93ca30f

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

README.md

+24-8
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,33 @@ module.exports = {
4444
}
4545
```
4646

47-
### This plugin currently is able to detect both components and new instances of vue:
47+
### Attention
4848

49-
#### Components are detected based on:
50-
- `Vue.component` expression
51-
- `export default {` in **.vue** and **.jsx** files
49+
All component-related rules are being applied to code that passes any of the following checks:
5250

53-
If you want to support custom **.js** files to be checked in terms of the available rules you needs to add comment in line before object declaration witch contains phrase `@vue/component`.
51+
* `Vue.component()` expression
52+
* `export default {}` in `.vue` or `.jsx` file
5453

55-
#### New instances of vue are detected based on:
56-
- `new Vue(`
57-
- `Vue.extends(`
54+
If you however want to take advantage of our rules in any of your custom objects that are Vue components, you might need to use special comment `// @vue/component` that marks object in the next line as a Vue component in any file, e.g.:
55+
56+
```js
57+
// @vue/component
58+
const CustomComponent = {
59+
name: 'custom-component',
60+
template: '<div></div>'
61+
}
62+
```
63+
```js
64+
Vue.component('AsyncComponent', (resolve, reject) => {
65+
setTimeout(() => {
66+
// @vue/component
67+
resolve({
68+
name: 'async-component',
69+
template: '<div></div>'
70+
})
71+
}, 500)
72+
})
73+
```
5874

5975
## :gear: Configs
6076

0 commit comments

Comments
 (0)