Skip to content

Allow deprecated rules in configs #2234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/rules/experimental-script-setup-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ since: v7.0.0

> prevent variables defined in `<script setup>` to be marked as undefined

- :no_entry_sign: This rule was **removed** in eslint-plugin-vue v9.0.0.
- :no_entry: 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
4 changes: 2 additions & 2 deletions docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ The following rules extend the rules provided by ESLint itself and apply them to

## Deprecated

- :warning: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
- :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 |
Expand All @@ -341,7 +341,7 @@ The following rules extend the rules provided by ESLint itself and apply them to

## Removed

- :no_entry_sign: These rules have been removed in a previous major release, after they have been deprecated for a while.
- :no_entry: 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 |
|:--------|:------------|:-----------------------|:-------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/name-property-casing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ since: v3.8.0

> enforce specific casing for the name property in Vue components

- :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.
- :no_entry: 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

- :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.
- :no_entry: 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-invalid-model-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ since: v7.9.0

> require valid keys in model option

- :warning: This rule was **deprecated** and replaced by [vue/valid-model-definition](valid-model-definition.md) rule.
- :no_entry_sign: This rule was **deprecated** and replaced by [vue/valid-model-definition](valid-model-definition.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

- :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.
- :no_entry: 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
2 changes: 1 addition & 1 deletion docs/rules/script-setup-uses-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ since: v7.13.0

> prevent `<script setup>` variables used in `<template>` to be marked as unused

- :warning: This rule was **deprecated**.
- :no_entry_sign: This rule was **deprecated**.

::: tip

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/v-on-function-call.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ since: v5.2.0

> enforce or forbid parentheses after method calls without arguments in `v-on` directives

- :warning: This rule was **deprecated** and replaced by [vue/v-on-handler-style](v-on-handler-style.md) rule.
- :no_entry_sign: This rule was **deprecated** and replaced by [vue/v-on-handler-style](v-on-handler-style.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.

## :book: Rule Details
Expand Down
4 changes: 1 addition & 3 deletions tools/lib/categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ module.exports = categoryIds
.map((categoryId) => ({
categoryId,
title: categoryTitles[categoryId],
rules: (categoryRules[categoryId] || []).filter(
(rule) => !rule.meta.deprecated
)
rules: categoryRules[categoryId] || []
}))
.filter((category) => category.rules.length > 0)
11 changes: 4 additions & 7 deletions tools/update-docs-rules-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const VUE2_EMOJI = ':two:'

// -----------------------------------------------------------------------------
const categorizedRules = rules.filter(
(rule) =>
rule.meta.docs.categories &&
!rule.meta.docs.extensionRule &&
!rule.meta.deprecated
(rule) => rule.meta.docs.categories && !rule.meta.docs.extensionRule
)
const uncategorizedRules = rules.filter(
(rule) =>
Expand All @@ -44,7 +41,7 @@ function toRuleRow(rule, kindMarks = []) {
const mark = [
rule.meta.fixable ? ':wrench:' : '',
rule.meta.hasSuggestions ? ':bulb:' : '',
rule.meta.deprecated ? ':warning:' : ''
rule.meta.deprecated ? ':no_entry_sign:' : ''
].join('')
const kindMark = [...kindMarks, TYPE_MARK[rule.meta.type]].join('')
const link = `[${rule.ruleId}](./${rule.name}.md)`
Expand Down Expand Up @@ -225,7 +222,7 @@ if (deprecatedRules.length > 0) {
rulesTableContent += `
## Deprecated

- :warning: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
- :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 |
Expand All @@ -238,7 +235,7 @@ ${deprecatedRules.map(toDeprecatedRuleRow).join('\n')}
rulesTableContent += `
## Removed

- :no_entry_sign: These rules have been removed in a previous major release, after they have been deprecated for a while.
- :no_entry: 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 |
|:--------|:------------|:-----------------------|:-------------------|
Expand Down
10 changes: 5 additions & 5 deletions tools/update-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For example:
# rule description (vue/rule-name)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :warning: This rule was **deprecated**.
- :no_entry_sign: This rule was **deprecated**.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.
```
*/
Expand Down Expand Up @@ -95,13 +95,13 @@ class DocFile {
(name) => `[vue/${name}](${name}.md) rule`
)
notes.push(
`- :no_entry_sign: This rule was **removed** in eslint-plugin-vue ${
`- :no_entry: This rule was **removed** in eslint-plugin-vue ${
meta.removedInVersion
} and replaced by ${formatItems(replacedRules)}.`
)
} else {
notes.push(
`- :no_entry_sign: This rule was **removed** in eslint-plugin-vue ${meta.removedInVersion}.`
`- :no_entry: This rule was **removed** in eslint-plugin-vue ${meta.removedInVersion}.`
)
}
} else if (meta.deprecated) {
Expand All @@ -110,12 +110,12 @@ class DocFile {
(name) => `[vue/${name}](${name}.md) rule`
)
notes.push(
`- :warning: This rule was **deprecated** and replaced by ${formatItems(
`- :no_entry_sign: This rule was **deprecated** and replaced by ${formatItems(
replacedRules
)}.`
)
} else {
notes.push(`- :warning: This rule was **deprecated**.`)
notes.push(`- :no_entry_sign: This rule was **deprecated**.`)
}
} else if (meta.docs.categories) {
const presets = getPresetIds(meta.docs.categories).map(
Expand Down