Skip to content

Commit

Permalink
Remove deprecated rules (#1881)
Browse files Browse the repository at this point in the history
* Remove deprecated rules

* Remove no longer needed `script-setup` test

* Restore docs from removed rules

* Mention in rule docs that they are removed

* Add "Removed" section to rules list in docs

* Use different emoji for removed rules

* Remove no longer necessary warning block

Co-authored-by: yosuke ota <[email protected]>
  • Loading branch information
FloEdelmann and ota-meshi authored May 12, 2022
1 parent 2f96315 commit a0cf018
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 1,742 deletions.
15 changes: 11 additions & 4 deletions docs/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,16 @@ The following rules extend the rules provided by ESLint itself and apply them to

| Rule ID | Replaced by |
|:--------|:------------|
| [vue/experimental-script-setup-vars](./experimental-script-setup-vars.md) | (no replacement) |
| [vue/name-property-casing](./name-property-casing.md) | [vue/component-definition-name-casing](./component-definition-name-casing.md) |
| [vue/no-confusing-v-for-v-if](./no-confusing-v-for-v-if.md) | [vue/no-use-v-if-with-v-for](./no-use-v-if-with-v-for.md) |
| [vue/no-invalid-model-keys](./no-invalid-model-keys.md) | [vue/valid-model-definition](./valid-model-definition.md) |
| [vue/no-unregistered-components](./no-unregistered-components.md) | [vue/no-undef-components](./no-undef-components.md) |
| [vue/script-setup-uses-vars](./script-setup-uses-vars.md) | (no replacement) |

## Removed

- :no_entry_sign: These rules have been removed in a previous major release, after they have been deprecated for a while.

| Rule ID | Replaced by | Deprecated in version | Removed in version |
|:--------|:------------|:-----------------------|:-------------------|
| [vue/experimental-script-setup-vars](./experimental-script-setup-vars.md) | (no replacement) | [v7.13.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v7.13.0) | [v9.0.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.0.0) |
| [vue/name-property-casing](./name-property-casing.md) | [vue/component-definition-name-casing](./component-definition-name-casing.md) | [v7.0.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v7.0.0) | [v9.0.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.0.0) |
| [vue/no-confusing-v-for-v-if](./no-confusing-v-for-v-if.md) | [vue/no-use-v-if-with-v-for](./no-use-v-if-with-v-for.md) | [v5.0.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v5.0.0) | [v9.0.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.0.0) |
| [vue/no-unregistered-components](./no-unregistered-components.md) | [vue/no-undef-components](./no-undef-components.md) | [v8.4.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v8.4.0) | [v9.0.0](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.0.0) |
6 changes: 1 addition & 5 deletions docs/rules/experimental-script-setup-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ since: v7.0.0

> prevent variables defined in `<script setup>` to be marked as undefined
- :warning: This rule was **deprecated**.

:::warning
This rule is an experimental rule. It may be removed without notice.
:::
- :no_entry_sign: This rule was **removed** in eslint-plugin-vue v9.0.0.

This rule will find variables defined in `<script setup="args">` and mark them as defined variables.

Expand Down
3 changes: 1 addition & 2 deletions docs/rules/name-property-casing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ since: v3.8.0

> enforce specific casing for the name property in Vue components
- :warning: This rule was **deprecated** and replaced by [vue/component-definition-name-casing](component-definition-name-casing.md) rule.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
- :no_entry_sign: This rule was **removed** in eslint-plugin-vue v9.0.0 and replaced by [vue/component-definition-name-casing](component-definition-name-casing.md) rule.

## :book: Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-confusing-v-for-v-if.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ since: v3.0.0

> disallow confusing `v-for` and `v-if` on the same element
- :warning: This rule was **deprecated** and replaced by [vue/no-use-v-if-with-v-for](no-use-v-if-with-v-for.md) rule.
- :no_entry_sign: This rule was **removed** in eslint-plugin-vue v9.0.0 and replaced by [vue/no-use-v-if-with-v-for](no-use-v-if-with-v-for.md) rule.

## :book: Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-unregistered-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ since: v7.0.0

> disallow using components that are not registered inside templates
- :warning: This rule was **deprecated** and replaced by [vue/no-undef-components](no-undef-components.md) rule.
- :no_entry_sign: This rule was **removed** in eslint-plugin-vue v9.0.0 and replaced by [vue/no-undef-components](no-undef-components.md) rule.

## :book: Rule Details

Expand Down
7 changes: 2 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports = {
'dot-location': require('./rules/dot-location'),
'dot-notation': require('./rules/dot-notation'),
eqeqeq: require('./rules/eqeqeq'),
'experimental-script-setup-vars': require('./rules/experimental-script-setup-vars'),
'first-attribute-linebreak': require('./rules/first-attribute-linebreak'),
'func-call-spacing': require('./rules/func-call-spacing'),
'html-button-has-type': require('./rules/html-button-has-type'),
Expand All @@ -54,7 +53,6 @@ module.exports = {
'multi-word-component-names': require('./rules/multi-word-component-names'),
'multiline-html-element-content-newline': require('./rules/multiline-html-element-content-newline'),
'mustache-interpolation-spacing': require('./rules/mustache-interpolation-spacing'),
'name-property-casing': require('./rules/name-property-casing'),
'new-line-between-multi-line-property': require('./rules/new-line-between-multi-line-property'),
'next-tick-style': require('./rules/next-tick-style'),
'no-arrow-functions-in-watch': require('./rules/no-arrow-functions-in-watch'),
Expand All @@ -63,7 +61,6 @@ module.exports = {
'no-boolean-default': require('./rules/no-boolean-default'),
'no-child-content': require('./rules/no-child-content'),
'no-computed-properties-in-data': require('./rules/no-computed-properties-in-data'),
'no-confusing-v-for-v-if': require('./rules/no-confusing-v-for-v-if'),
'no-constant-condition': require('./rules/no-constant-condition'),
'no-custom-modifiers-on-v-model': require('./rules/no-custom-modifiers-on-v-model'),
'no-deprecated-data-object-declaration': require('./rules/no-deprecated-data-object-declaration'),
Expand Down Expand Up @@ -133,7 +130,6 @@ module.exports = {
'no-this-in-before-route-enter': require('./rules/no-this-in-before-route-enter'),
'no-undef-components': require('./rules/no-undef-components'),
'no-undef-properties': require('./rules/no-undef-properties'),
'no-unregistered-components': require('./rules/no-unregistered-components'),
'no-unsupported-features': require('./rules/no-unsupported-features'),
'no-unused-components': require('./rules/no-unused-components'),
'no-unused-properties': require('./rules/no-unused-properties'),
Expand Down Expand Up @@ -237,7 +233,8 @@ module.exports = {
'.vue': require('./processor')
},
environments: {
// Deprecated
// TODO Remove in the next major version
/** @deprecated */
'setup-compiler-macros': {
globals: {
defineProps: 'readonly',
Expand Down
37 changes: 37 additions & 0 deletions lib/removed-rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
'use strict'

/**
* @typedef {object} RemovedRule
* @property {string} ruleName
* @property {string[]} replacedBy
* @property {string} deprecatedInVersion
* @property {string} removedInVersion
*/

/** @type {RemovedRule[]} */
module.exports = [
{
ruleName: 'experimental-script-setup-vars',
replacedBy: [],
deprecatedInVersion: 'v7.13.0',
removedInVersion: 'v9.0.0'
},
{
ruleName: 'name-property-casing',
replacedBy: ['component-definition-name-casing'],
deprecatedInVersion: 'v7.0.0',
removedInVersion: 'v9.0.0'
},
{
ruleName: 'no-confusing-v-for-v-if',
replacedBy: ['no-use-v-if-with-v-for'],
deprecatedInVersion: 'v5.0.0',
removedInVersion: 'v9.0.0'
},
{
ruleName: 'no-unregistered-components',
replacedBy: ['no-undef-components'],
deprecatedInVersion: 'v8.4.0',
removedInVersion: 'v9.0.0'
}
]
230 changes: 0 additions & 230 deletions lib/rules/experimental-script-setup-vars.js

This file was deleted.

Loading

0 comments on commit a0cf018

Please sign in to comment.