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
@@ -195,9 +197,10 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
195
197
196
198
|| Rule ID | Description |
197
199
|:---|:--------|:------------|
200
+
||[vue/attributes-order](./docs/rules/attributes-order.md)| enforce order of attributes |
198
201
|:wrench:|[vue/html-quotes](./docs/rules/html-quotes.md)| enforce quotes style of HTML attributes |
199
202
||[vue/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 |
200
-
||[vue/order-in-components](./docs/rules/order-in-components.md)| enforce order of properties in components |
203
+
|:wrench:|[vue/order-in-components](./docs/rules/order-in-components.md)| enforce order of properties in components |
201
204
||[vue/this-in-template](./docs/rules/this-in-template.md)| enforce usage of `this` in template |
202
205
203
206
### Uncategorized
@@ -207,6 +210,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
207
210
||[vue/attributes-order](./docs/rules/attributes-order.md)| enforce order of attributes |
208
211
|:wrench:|[vue/html-closing-bracket-newline](./docs/rules/html-closing-bracket-newline.md)| require or disallow a line break before tag's closing brackets |
209
212
|:wrench:|[vue/html-closing-bracket-spacing](./docs/rules/html-closing-bracket-spacing.md)| require or disallow a space before tag's closing brackets |
213
+
||[vue/prop-name-casing](./docs/rules/prop-name-casing.md)| enforce specific casing for the Prop name in Vue components |
210
214
|:wrench:|[vue/script-indent](./docs/rules/script-indent.md)| enforce consistent indentation in `<script>`|
211
215
212
216
<!--RULES_TABLE_END-->
@@ -235,14 +239,20 @@ If you already use other parser (e.g. `"parser": "babel-eslint"`), please move i
235
239
236
240
The `vue-eslint-parser` uses the parser which is set by `parserOptions.parser` to parse scripts.
237
241
238
-
### Can my javascript code have increased indentation?
242
+
### Why doesn't it work on .vue file?
239
243
240
-
It depends on the version of eslint you're using.
244
+
1. Make sure you don't have `eslint-plugin-html` in your config. The `eslint-plugin-html` extracts the content from `<script>` tags, but `eslint-vue-plugin` requires `<script>` tags and `<template>` tags in order to distinguish template and script in single file components.
241
245
242
-
[indent](https://eslint.org/docs/rules/indent) rule in `[email protected]` makes it possible, but if you use `[email protected]` be aware that this rule has been rewritten and is more strict now, thus it doesn't allow to have increased initial indentation.
246
+
```diff
247
+
"plugins": [
248
+
"vue",
249
+
- "html"
250
+
]
251
+
```
243
252
244
-
You can however use [indent-legacy](https://eslint.org/docs/rules/indent-legacy) rule instead.
245
-
More informations [here](https://eslint.org/docs/user-guide/migrating-to-4.0.0#indent-rewrite).
253
+
2. Make sure your tool is set to lint `.vue` files.
254
+
- CLI targets only `.js` files by default. You have to specify additional extensions by `--ext` option or glob patterns. E.g. `eslint "src/**/*.{js,vue}"` or `eslint src --ext .vue`.
255
+
- VSCode targets only JavaScript or HTML files by default. You have to add `{"autoFix": true, "language": "vue"}` into `eslint.validate` entry.
Copy file name to clipboardExpand all lines: docs/rules/attributes-order.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# enforce order of attributes (vue/attributes-order)
2
2
3
+
-:gear: This rule is included in `"plugin:vue/recommended"`.
4
+
3
5
## :book: Rule Details
4
6
5
7
This rule aims to enfore ordering of component attributes. The default order is specified in the [Vue styleguide](https://vuejs.org/v2/style-guide/#Element-attribute-order-recommended) and is:
Copy file name to clipboardExpand all lines: docs/rules/max-attributes-per-line.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# enforce the maximum number of attributes per line (vue/max-attributes-per-line)
2
2
3
3
-:gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
4
+
-:wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.
4
5
5
6
Limits the maximum number of attributes/properties per line to improve readability.
Copy file name to clipboardExpand all lines: docs/rules/order-in-components.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# enforce order of properties in components (vue/order-in-components)
2
2
3
3
-:gear: This rule is included in `"plugin:vue/recommended"`.
4
+
-:wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.
4
5
5
6
This rule makes sure you keep declared order of properties in components.
0 commit comments