Skip to content

Commit 25821ea

Browse files
committed
Merge branch 'master' into eslint-v10
2 parents 037bf19 + 5023e75 commit 25821ea

File tree

72 files changed

+1802
-1665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1802
-1665
lines changed

.changeset/gorgeous-colts-bathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-vue": patch
3+
---
4+
5+
Updates resources

.changeset/rich-bags-turn.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/rich-zebras-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-vue": minor
3+
---
4+
5+
Changed `vue/no-negated-v-if-condition` suggestion to autofix

.changeset/swift-spies-nail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-vue": minor
3+
---
4+
5+
Added new `ignoreEOLComments` option to `vue/no-multi-spaces` rule

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
"console": "integratedTerminal"
1919
}
2020
]
21-
}
21+
}

.vscode/settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"editor.tabSize": 2,
3-
"eslint.validate": ["javascript", "javascriptreact", "vue", "json", "jsonc", "markdown"],
3+
"eslint.validate": [
4+
"javascript",
5+
"javascriptreact",
6+
"vue",
7+
"json",
8+
"jsonc",
9+
"markdown"
10+
],
411
"typescript.tsdk": "./node_modules/typescript/lib",
512
"vetur.validation.script": false,
613
"[typescript]": {

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# eslint-plugin-vue
22

3+
## 10.6.2
4+
5+
### Patch Changes
6+
7+
- Fixed false positives in non-intersecting conditions in [`vue/no-duplicate-class-names`](https://eslint.vuejs.org/rules/no-duplicate-class-names.html) and correctly detect duplicates in combining expressions ([#2980](https://github.com/vuejs/eslint-plugin-vue/pull/2980))
8+
- Fixed false positives for `TSImportType` in [`vue/script-indent`](https://eslint.vuejs.org/rules/script-indent.html) rule ([#2969](https://github.com/vuejs/eslint-plugin-vue/pull/2969))
9+
- Improved performance and type safety in [`vue/prefer-use-template-ref`](https://eslint.vuejs.org/rules/prefer-use-template-ref.html) ([#2982](https://github.com/vuejs/eslint-plugin-vue/pull/2982))
10+
311
## 10.6.1
412

513
### Patch Changes
@@ -11,15 +19,12 @@
1119
### Minor Changes
1220

1321
- Updated [`vue/no-import-compiler-macros`](https://eslint.vuejs.org/rules/no-import-compiler-macros.html) to clarify that macros are not allowed outside `<script setup>` ([#2938](https://github.com/vuejs/eslint-plugin-vue/pull/2938))
14-
1522
- Added new [`vue/no-duplicate-class-names`](https://eslint.vuejs.org/rules/no-duplicate-class-names.html) rule ([#2934](https://github.com/vuejs/eslint-plugin-vue/pull/2934))
1623

1724
### Patch Changes
1825

1926
- Fixed [`vue/no-v-html`](https://eslint.vuejs.org/rules/no-v-html.html) rule to allow ignoring call expressions ([#2950](https://github.com/vuejs/eslint-plugin-vue/pull/2950))
20-
2127
- Improved [`vue/define-macros-order`](https://eslint.vuejs.org/rules/define-macros-order.html) error messages to distinguish between macro placement and ordering issues ([#2953](https://github.com/vuejs/eslint-plugin-vue/pull/2953))
22-
2328
- Updated dependency [postcss-selector-parser](https://github.com/postcss/postcss-selector-parser) to v7.1.0 ([#2947](https://github.com/vuejs/eslint-plugin-vue/pull/2947))
2429

2530
## 10.5.1

docs/rules/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ For example:
238238
| [vue/no-empty-component-block] | disallow the `<template>` `<script>` `<style>` block to be empty | :wrench: | :hammer: |
239239
| [vue/no-import-compiler-macros] | disallow importing Vue compiler macros | :wrench: | :warning: |
240240
| [vue/no-multiple-objects-in-class] | disallow passing multiple objects in an array to class | | :hammer: |
241-
| [vue/no-negated-v-if-condition] | disallow negated conditions in v-if/v-else | :bulb: | :hammer: |
241+
| [vue/no-negated-v-if-condition] | disallow negated conditions in v-if/v-else | :wrench: | :hammer: |
242242
| [vue/no-potential-component-option-typo] | disallow a potential typo in your component property | :bulb: | :hammer: |
243243
| [vue/no-ref-object-reactivity-loss] | disallow usages of ref objects that can lead to loss of reactivity | | :warning: |
244244
| [vue/no-restricted-block] | disallow specific block | | :hammer: |

docs/rules/no-async-in-computed-properties.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ since: v3.8.0
1212
1313
- :gear: This rule is included in all of `"plugin:vue/essential"`, `*.configs["flat/essential"]`, `"plugin:vue/vue2-essential"`, `*.configs["flat/vue2-essential"]`, `"plugin:vue/strongly-recommended"`, `*.configs["flat/strongly-recommended"]`, `"plugin:vue/vue2-strongly-recommended"`, `*.configs["flat/vue2-strongly-recommended"]`, `"plugin:vue/recommended"`, `*.configs["flat/recommended"]`, `"plugin:vue/vue2-recommended"` and `*.configs["flat/vue2-recommended"]`.
1414

15-
Computed properties and functions 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.
16-
If you need async computed properties you might want to consider using additional plugin [vue-async-computed]
15+
Computed properties and functions should be synchronous. Asynchronous actions inside them may not work as expected and can lead to unexpected behaviour; that's why you should avoid them.
16+
If you need async computed properties, consider using the [`computedAsync`] composable from VueUse.
1717

1818
## :book: Rule Details
1919

@@ -147,9 +147,9 @@ const fetchData = computed(() => {
147147

148148
## :books: Further Reading
149149

150-
- [vue-async-computed]
150+
- [`computedAsync`]
151151

152-
[vue-async-computed]: https://github.com/foxbenjaminfox/vue-async-computed
152+
[`computedAsync`]: https://vueuse.org/core/computedAsync
153153

154154
## :rocket: Version
155155

docs/rules/no-multi-spaces.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ This rule aims at removing multiple spaces in tags, which are not used for inden
5151
```json
5252
{
5353
"vue/no-multi-spaces": ["error", {
54-
"ignoreProperties": false
54+
"ignoreProperties": false,
55+
"ignoreEOLComments": false
5556
}]
5657
}
5758
```
5859

5960
- `ignoreProperties` ... whether or not objects' properties should be ignored. default `false`
61+
- `ignoreEOLComments` ... whether or not the spaces before EOL comments should be ignored. default `false`
6062

6163
### `"ignoreProperties": true`
6264

@@ -76,6 +78,24 @@ This rule aims at removing multiple spaces in tags, which are not used for inden
7678

7779
</eslint-code-block>
7880

81+
### `"ignoreEOLComments": true`
82+
83+
<eslint-code-block fix :rules="{'vue/no-multi-spaces': ['error', { 'ignoreEOLComments': true }]}">
84+
85+
```vue
86+
<template>
87+
<!-- ✓ GOOD -->
88+
<div
89+
:class="{
90+
'fa-angle-up' : isExpanded, // comment
91+
'fa-angle-down' : !isExpanded, /* multiline comment */
92+
}"
93+
/>
94+
</template>
95+
```
96+
97+
</eslint-code-block>
98+
7999
## :rocket: Version
80100

81101
This rule was introduced in eslint-plugin-vue v3.12.0

0 commit comments

Comments
 (0)