From 3f8e40cb58ca903f3e06afac2c1918cec59df34d Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 27 Jan 2022 14:29:51 +0100 Subject: [PATCH] Meta: Fix `replacedBy` position --- lib/rules/name-property-casing.js | 4 ++-- lib/rules/no-confusing-v-for-v-if.js | 4 ++-- lib/rules/no-unregistered-components.js | 4 ++-- tools/update-docs-rules-index.js | 2 +- tools/update-docs.js | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/rules/name-property-casing.js b/lib/rules/name-property-casing.js index d86435a95..29c100db5 100644 --- a/lib/rules/name-property-casing.js +++ b/lib/rules/name-property-casing.js @@ -19,10 +19,10 @@ module.exports = { description: 'enforce specific casing for the name property in Vue components', categories: ['vue3-strongly-recommended', 'strongly-recommended'], - url: 'https://eslint.vuejs.org/rules/name-property-casing.html', - replacedBy: ['component-definition-name-casing'] + url: 'https://eslint.vuejs.org/rules/name-property-casing.html' }, deprecated: true, + replacedBy: ['component-definition-name-casing'], fixable: 'code', // or "code" or "whitespace" schema: [ { diff --git a/lib/rules/no-confusing-v-for-v-if.js b/lib/rules/no-confusing-v-for-v-if.js index 4135f163a..1842f7c8c 100644 --- a/lib/rules/no-confusing-v-for-v-if.js +++ b/lib/rules/no-confusing-v-for-v-if.js @@ -43,10 +43,10 @@ module.exports = { docs: { description: 'disallow confusing `v-for` and `v-if` on the same element', categories: ['vue3-recommended', 'recommended'], - url: 'https://eslint.vuejs.org/rules/no-confusing-v-for-v-if.html', - replacedBy: ['no-use-v-if-with-v-for'] + url: 'https://eslint.vuejs.org/rules/no-confusing-v-for-v-if.html' }, deprecated: true, + replacedBy: ['no-use-v-if-with-v-for'], fixable: null, schema: [] }, diff --git a/lib/rules/no-unregistered-components.js b/lib/rules/no-unregistered-components.js index efd265e55..4ba755dd3 100644 --- a/lib/rules/no-unregistered-components.js +++ b/lib/rules/no-unregistered-components.js @@ -44,10 +44,10 @@ module.exports = { 'disallow using components that are not registered inside templates', categories: null, recommended: false, - url: 'https://eslint.vuejs.org/rules/no-unregistered-components.html', - replacedBy: ['no-undef-components'] + url: 'https://eslint.vuejs.org/rules/no-unregistered-components.html' }, deprecated: true, + replacedBy: ['no-undef-components'], fixable: null, schema: [ { diff --git a/tools/update-docs-rules-index.js b/tools/update-docs-rules-index.js index 913db1b91..9b177d7ac 100644 --- a/tools/update-docs-rules-index.js +++ b/tools/update-docs-rules-index.js @@ -38,7 +38,7 @@ function toRuleRow(rule) { function toDeprecatedRuleRow(rule) { const link = `[${rule.ruleId}](./${rule.name}.md)` - const replacedRules = rule.meta.docs.replacedBy || [] + const replacedRules = rule.meta.replacedBy || [] const replacedBy = replacedRules .map((name) => `[vue/${name}](./${name}.md)`) .join(', ') diff --git a/tools/update-docs.js b/tools/update-docs.js index 098585887..a7b847eee 100644 --- a/tools/update-docs.js +++ b/tools/update-docs.js @@ -120,8 +120,8 @@ class DocFile { const notes = [] if (meta.deprecated) { - if (meta.docs.replacedBy) { - const replacedRules = meta.docs.replacedBy.map( + if (meta.replacedBy) { + const replacedRules = meta.replacedBy.map( (name) => `[vue/${name}](${name}.md) rule` ) notes.push(