Skip to content

Commit

Permalink
Deprecate Vue 2 only rules (#2675)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Feb 12, 2025
1 parent 2b8942a commit 9a5a584
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 4 deletions.
20 changes: 16 additions & 4 deletions docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
| [vue/no-use-v-if-with-v-for] | disallow using `v-if` on the same element as `v-for` | | :three::two::hammer: |
| [vue/no-useless-template-attributes] | disallow useless attribute on `<template>` | | :three::two::warning: |
| [vue/no-v-for-template-key-on-child] | disallow key of `<template v-for>` placed on child elements | | :three::warning: |
| [vue/no-v-for-template-key] | disallow `key` attribute on `<template v-for>` | | :two::warning: |
| [vue/no-v-model-argument] | disallow adding an argument to `v-model` used in custom component | | :two::warning: |
| [vue/no-v-for-template-key] | disallow `key` attribute on `<template v-for>` | :no_entry_sign: | :two::warning: |
| [vue/no-v-model-argument] | disallow adding an argument to `v-model` used in custom component | :no_entry_sign: | :two::warning: |
| [vue/no-v-text-v-html-on-component] | disallow v-text / v-html on component | | :three::two::warning: |
| [vue/no-watch-after-await] | disallow asynchronously registered `watch` | | :three::hammer: |
| [vue/prefer-import-from-vue] | enforce import from 'vue' instead of import from '@vue/*' | :wrench: | :three::hammer: |
Expand All @@ -110,10 +110,10 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
| [vue/valid-define-emits] | enforce valid `defineEmits` compiler macro | | :three::two::warning: |
| [vue/valid-define-options] | enforce valid `defineOptions` compiler macro | | :three::warning: |
| [vue/valid-define-props] | enforce valid `defineProps` compiler macro | | :three::two::warning: |
| [vue/valid-model-definition] | require valid keys in model option | | :two::warning: |
| [vue/valid-model-definition] | require valid keys in model option | :no_entry_sign: | :two::warning: |
| [vue/valid-next-tick] | enforce valid `nextTick` function calls | :wrench::bulb: | :three::two::warning: |
| [vue/valid-template-root] | enforce valid template root | | :three::two::warning: |
| [vue/valid-v-bind-sync] | enforce valid `.sync` modifier on `v-bind` directives | | :two::warning: |
| [vue/valid-v-bind-sync] | enforce valid `.sync` modifier on `v-bind` directives | :no_entry_sign: | :two::warning: |
| [vue/valid-v-bind] | enforce valid `v-bind` directives | | :three::two::warning: |
| [vue/valid-v-cloak] | enforce valid `v-cloak` directives | | :three::two::warning: |
| [vue/valid-v-else-if] | enforce valid `v-else-if` directives | | :three::two::warning: |
Expand Down Expand Up @@ -342,6 +342,18 @@ The following rules extend the rules provided by ESLint itself and apply them to

</rules-table>

## Deprecated

- :no_entry_sign: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
- :innocent: We don't fix bugs which are in deprecated rules since we don't have enough resources.

| Rule ID | Replaced by |
|:--------|:------------|
| [vue/no-v-for-template-key] | (no replacement) |
| [vue/no-v-model-argument] | (no replacement) |
| [vue/valid-model-definition] | (no replacement) |
| [vue/valid-v-bind-sync] | (no replacement) |

## Removed

- :no_entry: These rules have been removed in a previous major release, after they have been deprecated for a while.
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-v-for-template-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ since: v7.0.0

> disallow `key` attribute on `<template v-for>`
- :no_entry_sign: This rule was **deprecated**.
- :gear: This rule is included in all of `"plugin:vue/vue2-essential"`, `*.configs["flat/vue2-essential"]`, `"plugin:vue/vue2-strongly-recommended"`, `*.configs["flat/vue2-strongly-recommended"]`, `"plugin:vue/vue2-recommended"` and `*.configs["flat/vue2-recommended"]`.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-v-model-argument.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ since: v7.0.0

> disallow adding an argument to `v-model` used in custom component
- :no_entry_sign: This rule was **deprecated**.
- :gear: This rule is included in all of `"plugin:vue/vue2-essential"`, `*.configs["flat/vue2-essential"]`, `"plugin:vue/vue2-strongly-recommended"`, `*.configs["flat/vue2-strongly-recommended"]`, `"plugin:vue/vue2-recommended"` and `*.configs["flat/vue2-recommended"]`.

This rule checks whether `v-model` used on custom component do not have an argument.
Expand Down
1 change: 1 addition & 0 deletions docs/rules/valid-model-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ since: v9.0.0

> require valid keys in model option
- :no_entry_sign: This rule was **deprecated**.
- :gear: This rule is included in all of `"plugin:vue/vue2-essential"`, `*.configs["flat/vue2-essential"]`, `"plugin:vue/vue2-strongly-recommended"`, `*.configs["flat/vue2-strongly-recommended"]`, `"plugin:vue/vue2-recommended"` and `*.configs["flat/vue2-recommended"]`.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/valid-v-bind-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ since: v7.0.0

> enforce valid `.sync` modifier on `v-bind` directives
- :no_entry_sign: This rule was **deprecated**.
- :gear: This rule is included in all of `"plugin:vue/vue2-essential"`, `*.configs["flat/vue2-essential"]`, `"plugin:vue/vue2-strongly-recommended"`, `*.configs["flat/vue2-strongly-recommended"]`, `"plugin:vue/vue2-recommended"` and `*.configs["flat/vue2-recommended"]`.

This rule checks whether every `.sync` modifier on `v-bind` directives is valid.
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-v-for-template-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
url: 'https://eslint.vuejs.org/rules/no-v-for-template-key.html'
},
fixable: null,
deprecated: true,
schema: [],
messages: {
disallow:
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-v-model-argument.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
url: 'https://eslint.vuejs.org/rules/no-v-model-argument.html'
},
fixable: null,
deprecated: true,
schema: [],
messages: {
vModelRequireNoArgument: "'v-model' directives require no argument."
Expand Down
1 change: 1 addition & 0 deletions lib/rules/valid-model-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
url: 'https://eslint.vuejs.org/rules/valid-model-definition.html'
},
fixable: null,
deprecated: true,
schema: [],
messages: {
invalidKey: "Invalid key '{{name}}' in model option."
Expand Down
1 change: 1 addition & 0 deletions lib/rules/valid-v-bind-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ module.exports = {
url: 'https://eslint.vuejs.org/rules/valid-v-bind-sync.html'
},
fixable: null,
deprecated: true,
schema: [],
messages: {
unexpectedInvalidElement:
Expand Down

0 comments on commit 9a5a584

Please sign in to comment.