You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
||[no-async-in-computed-properties](./docs/rules/no-async-in-computed-properties.md)| Check if there are no asynchronous actions inside computed properties. |
69
70
|:white_check_mark:|[no-confusing-v-for-v-if](./docs/rules/no-confusing-v-for-v-if.md)| disallow confusing `v-for` and `v-if` on the same element. |
||[no-side-effects-in-computed-properties](./docs/rules/no-side-effects-in-computed-properties.md)| Don't introduce side effects in computed properties |
71
73
|:white_check_mark:|[no-textarea-mustache](./docs/rules/no-textarea-mustache.md)| disallow mustaches in `<textarea>`. |
72
74
||[order-in-components](./docs/rules/order-in-components.md)| Keep order of properties in components |
73
75
|:white_check_mark:|[require-component-is](./docs/rules/require-component-is.md)| require `v-bind:is` of `<component>` elements. |
@@ -79,8 +81,9 @@ The `--fix` option on the command line automatically fixes problems reported by
79
81
|| Rule ID | Description |
80
82
|:---|:--------|:------------|
81
83
||[html-quotes](./docs/rules/html-quotes.md)| enforce quotes style of HTML attributes. |
|:white_check_mark:|[no-parsing-error](./docs/rules/no-parsing-error.md)| disallow parsing errors in `<template>`. |
115
+
||[no-shared-component-data](./docs/rules/no-shared-component-data.md)| Enforces component's data property to be a function. |
116
+
||[no-template-key](./docs/rules/no-template-key.md)| disallow `key` attribute on `<template>`. |
117
+
||[return-in-computed-property](./docs/rules/return-in-computed-property.md)| Enforces that a return statement is present in computed property. |
112
118
113
119
<!--RULES_TABLE_END-->
114
120
121
+
## :couple: FAQ
122
+
123
+
### What is the "Use the latest vue-eslint-parser" error?
124
+
125
+
The most rules of `eslint-plugin-vue` require `vue-eslint-parser` to check `<template>` ASTs.
126
+
127
+
Make sure you have one of the following settings in your **.eslintrc**:
128
+
129
+
-`"extends": ["plugin:vue/recommended"]`
130
+
-`"extends": ["plugin:vue/base"]`
131
+
132
+
If you already use other parser (e.g. `"parser": "babel-eslint"`), please move it into `parserOptions`, so it doesn't collide with the `vue-eslint-parser` used by this plugin's configuration:
133
+
134
+
```diff
135
+
- "parser": "babel-eslint",
136
+
"parserOptions": {
137
+
+ "parser": "babel-eslint",
138
+
"ecmaVersion": 2017,
139
+
"sourceType": "module"
140
+
}
141
+
```
142
+
143
+
The `vue-eslint-parser` uses the parser which is set by `parserOptions.parser` to parse scripts.
144
+
115
145
## :anchor: Semantic Versioning Policy
116
146
117
147
This plugin follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
# Check if there are no asynchronous actions inside computed properties (no-async-in-computed-properties)
2
+
3
+
Computed properties should be synchronous. Asynchronous actions inside them may not work as expected and can lead to an unexpected behaviour, that's why you should avoid them.
4
+
If you need async computed properties you might want to consider using additional plugin [vue-async-computed]
5
+
6
+
## :book: Rule Details
7
+
8
+
This rule is aimed at preventing asynchronous methods from being called in computed properties.
9
+
10
+
:-1: Examples of **incorrect** code for this rule:
0 commit comments